2017-07-22 14:49:53 +00:00
// VpnCloud - Peer-to-Peer VPN
2019-02-14 21:53:08 +00:00
// Copyright (C) 2015-2019 Dennis Schwerdel
2017-07-22 14:49:53 +00:00
// This software is licensed under GPL-3 or newer (see LICENSE.md)
2019-01-01 23:35:14 +00:00
extern crate cc ;
2016-04-11 07:10:29 +00:00
2019-02-14 21:53:08 +00:00
use std ::process ::Command ;
use std ::env ;
use std ::path ::Path ;
use std ::fs ;
2015-11-19 15:34:20 +00:00
fn main ( ) {
2019-02-14 21:53:08 +00:00
let out_dir = env ::var ( " OUT_DIR " ) . unwrap ( ) ;
// Compile tun/tap C code
println! ( " rerun-if-changed=src/c/tuntap.c " ) ;
2019-01-01 23:35:14 +00:00
cc ::Build ::new ( ) . file ( " src/c/tuntap.c " ) . include ( " src " ) . compile ( " libtuntap.a " ) ;
2019-02-14 21:53:08 +00:00
// Process manpage using ronn command
println! ( " rerun-if-changed=vpncloud.md " ) ;
fs ::copy ( " vpncloud.md " , Path ::new ( & out_dir ) . join ( " vpncloud.1.ronn " ) ) . unwrap ( ) ;
Command ::new ( " ronn " ) . args ( & [ " -r " , " vpncloud.1.ronn " ] ) . current_dir ( & Path ::new ( & out_dir ) ) . status ( ) . expect ( " Failed to process manpage, ronn command missing? " ) ;
Command ::new ( " gzip " ) . args ( & [ " vpncloud.1 " ] ) . current_dir ( & Path ::new ( & out_dir ) ) . status ( ) . unwrap ( ) ;
fs ::copy ( Path ::new ( & out_dir ) . join ( " vpncloud.1.gz " ) , " target/vpncloud.1.gz " ) . unwrap ( ) ;
2015-11-21 16:06:57 +00:00
}