diff --git a/.travis.yml b/.travis.yml index 64b6a0f2..61b8b3e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,12 +19,14 @@ addons: - libminiupnpc-dev - gcc - g++ + - help2man before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list scons &>/dev/null || brew install scons ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list boost &>/dev/null || brew install boost ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list openssl &>/dev/null || brew install openssl ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list miniupnpc &>/dev/null || brew install miniupnpc ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list help2man &>/dev/null || brew install help2man ; fi cache: apt: true script: scons install apps samples diff --git a/SConscript b/SConscript index a5c64b0a..22bd219b 100644 --- a/SConscript +++ b/SConscript @@ -17,6 +17,7 @@ dirs = { 'include': Dir('include'), 'lib': Dir('lib'), 'bin': Dir('bin'), + 'man': Dir('man'), } env.Append(CPPPATH=[dirs['include']]) @@ -51,13 +52,14 @@ for x in Glob('libs/*'): apps = [] configurations = [] +help = [] for x in Glob('apps/*'): sconscript_path = x.File('SConscript') if sconscript_path.exists(): name = os.path.basename(str(x)) - app, configuration = SConscript(sconscript_path, exports='env dirs name') + app, configuration, help = SConscript(sconscript_path, exports='env dirs name') apps.extend(app) configurations.extend(configuration) @@ -87,4 +89,4 @@ if env.mode != 'retail': else: samples.extend(env.SymLink(y.File('%sd' % os.path.basename(str(y))).srcnode(), sample)) -Return('libraries includes apps samples configurations') +Return('libraries includes apps samples configurations help') diff --git a/SConstruct b/SConstruct index 74287014..6797a04e 100644 --- a/SConstruct +++ b/SConstruct @@ -216,27 +216,28 @@ else: if mode in ('all', 'release'): env = FreelanEnvironment(mode='release', prefix=prefix, bin_prefix=bin_prefix, mongoose=mongoose, upnp=upnp) - libraries, includes, apps, samples, configurations = SConscript('SConscript', exports='env', variant_dir=os.path.join('build', env.mode)) + libraries, includes, apps, samples, configurations, help = SConscript('SConscript', exports='env', variant_dir=os.path.join('build', env.mode)) install = env.Install(os.path.join(env.bin_install_prefix, 'bin'), apps) + install = env.Install(os.path.join(env.bin_install_prefix, 'man', 'man1'), help) install.extend(env.Install(os.path.join(env.install_prefix, 'etc', 'freelan'), configurations)) Alias('install', install) - Alias('apps', apps) + Alias('apps', apps + help) Alias('samples', samples) - Alias('all', install + apps + samples) + Alias('all', install + apps + help + samples) if mode in ('all', 'debug'): env = FreelanEnvironment(mode='debug', prefix=prefix, mongoose=mongoose, upnp=upnp) - libraries, includes, apps, samples, configurations = SConscript('SConscript', exports='env', variant_dir=os.path.join('build', env.mode)) - Alias('apps', apps) + libraries, includes, apps, samples, configurations, help = SConscript('SConscript', exports='env', variant_dir=os.path.join('build', env.mode)) + Alias('apps', apps + help) Alias('samples', samples) - Alias('all', apps + samples) + Alias('all', apps + help + samples) if sys.platform.startswith('darwin'): retail_prefix = '/usr/local' env = FreelanEnvironment(mode='retail', prefix=retail_prefix, mongoose=mongoose, upnp=upnp) - libraries, includes, apps, samples, configurations = SConscript('SConscript', exports='env', variant_dir=os.path.join('build', env.mode)) - package = SConscript('packaging/osx/SConscript', exports='env apps configurations retail_prefix') + libraries, includes, apps, samples, configurations, help = SConscript('SConscript', exports='env', variant_dir=os.path.join('build', env.mode)) + package = SConscript('packaging/osx/SConscript', exports='env apps configurations retail_prefix help') install_package = env.Install('.', package) Alias('package', install_package) diff --git a/apps/freelan/SConscript b/apps/freelan/SConscript index 0b678eac..36442a82 100644 --- a/apps/freelan/SConscript +++ b/apps/freelan/SConscript @@ -72,5 +72,11 @@ env.Prepend(LIBS=libraries) sources = list(sorted(set(env.RGlob('src', '*.cpp')) - set(env.RGlob(os.path.join('src', 'windows'), '*.cpp')))) app = env.Program(target=os.path.join(str(dirs['bin']), name), source=sources) configuration = env.File(env.RGlob('config', '*.cfg')) +help = [] -Return('app configuration') +h2m = env.WhereIs('help2man', os.environ['PATH']) +if h2m: + env['HELP2MAN'] = h2m + help = env.Command(target=os.path.join(str(dirs['man']), name + '.1'), source=os.path.join(str(dirs['bin']), name), action ='$HELP2MAN $SOURCE > $TARGET') + +Return('app configuration help') diff --git a/packaging/rpm/freelan.1 b/packaging/rpm/freelan.1 deleted file mode 100644 index bbaf7a29..00000000 --- a/packaging/rpm/freelan.1 +++ /dev/null @@ -1,267 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.44.1. -.TH FREELAN "1" "June 2015" "freelan 2.0.0 (2.0-8-g0545b2d) Sun 21 Jun 2015" "User Commands" -.SH NAME -freelan \- peer-to-peer VPN -.SH DESCRIPTION -.SS "Generic options:" -.TP -\fB\-h\fR [ \fB\-\-help\fR ] -Produce help message. -.TP -\fB\-v\fR [ \fB\-\-version\fR ] -Get the program version. -.TP -\fB\-d\fR [ \fB\-\-debug\fR ] -Enables debug output. -.TP -\fB\-t\fR [ \fB\-\-threads\fR ] arg (=0) -The number of threads to use. -.HP -\fB\-c\fR [ \fB\-\-configuration_file\fR ] arg The configuration file to use. -.PP -Configuration: -.SS "FreeLAN Server options:" -.TP -\fB\-\-server\fR.enabled arg (=no) -Whether to enable the server mechanism. -.HP -\fB\-\-server\fR.listen_on arg (=0.0.0.0:443) The endpoint to listen on. -.TP -\fB\-\-server\fR.protocol arg (=https) -The protocol to use for clients to -contact the server. -.TP -\fB\-\-server\fR.server_certificate_file arg (="") -The server certificate file. -.TP -\fB\-\-server\fR.server_private_key_file arg (="") -The server private key file. -.TP -\fB\-\-server\fR.certification_authority_certificate_file arg (="") -The certification authority certificate -file. -.TP -\fB\-\-server\fR.certification_authority_private_key_file arg (="") -The certification authority private key -file. -.TP -\fB\-\-server\fR.authentication_script arg (="") -The authentication script to use. -.SS "FreeLAN Client options:" -.TP -\fB\-\-client\fR.enabled arg (=no) -Whether to enable the client mechanism. -.TP -\fB\-\-client\fR.server_endpoint arg (=127.0.0.1:443) -The endpoint to connect to. -.TP -\fB\-\-client\fR.protocol arg (=https) -The protocol to use to contact the -server. -.TP -\fB\-\-client\fR.disable_peer_verification arg (=no) -Whether to disable peer verification. -.TP -\fB\-\-client\fR.disable_host_verification arg (=no) -Whether to disable host verification. -.TP -\fB\-\-client\fR.username arg -The client username. -.TP -\fB\-\-client\fR.password arg -The client password. -.TP -\fB\-\-client\fR.public_endpoint arg -A hostname or IP address to advertise. -.SS "FreeLAN Secure Channel Protocol (FSCP) options:" -.TP -\fB\-\-fscp\fR.hostname_resolution_protocol arg (=ipv4) -The hostname resolution protocol to -use. -.HP -\fB\-\-fscp\fR.listen_on arg (=0.0.0.0:12000) The endpoint to listen on. -.TP -\fB\-\-fscp\fR.listen_on_device arg -The endpoint to listen on. -.TP -\fB\-\-fscp\fR.hello_timeout arg (=3000) -The default timeout for HELLO messages, -in milliseconds. -.TP -\fB\-\-fscp\fR.contact arg -The address of an host to contact. -.TP -\fB\-\-fscp\fR.accept_contact_requests arg (=yes) -Whether to accept CONTACT\-REQUEST -messages. -.TP -\fB\-\-fscp\fR.accept_contacts arg (=yes) -Whether to accept CONTACT messages. -.TP -\fB\-\-fscp\fR.dynamic_contact_file arg -The certificate of an host to -dynamically contact. -.TP -\fB\-\-fscp\fR.never_contact arg -A network address to avoid when -dynamically contacting hosts. -.TP -\fB\-\-fscp\fR.cipher_suite_capability arg -A cipher suite to allow. -.TP -\fB\-\-fscp\fR.elliptic_curve_capability arg -A elliptic curve to allow. -.SS "Security options:" -.TP -\fB\-\-security\fR.passphrase arg -A passphrase to generate the pre \- -shared key from. -.TP -\fB\-\-security\fR.passphrase_salt arg (=freelan) -The salt to use during the pre\-shared -key derivation. -.TP -\fB\-\-security\fR.passphrase_iterations_count arg (=2000) -The number of iterations to use during -the pre\-shared key derivation. -.TP -\fB\-\-security\fR.signature_certificate_file arg -The certificate file to use for -signing. -.TP -\fB\-\-security\fR.signature_private_key_file arg -The private key file to use for -signing. -.TP -\fB\-\-security\fR.certificate_validation_method arg (=default) -The certificate validation method. -.TP -\fB\-\-security\fR.certificate_validation_script arg (="") -The certificate validation script to -use. -.TP -\fB\-\-security\fR.authority_certificate_file arg -An authority certificate file to use. -.TP -\fB\-\-security\fR.certificate_revocation_validation_method arg (=none) -The certificate revocation validation -method. -.TP -\fB\-\-security\fR.certificate_revocation_list_file arg -A certificate revocation list file to -use. -.SS "Tap adapter options:" -.TP -\fB\-\-tap_adapter\fR.type arg (=tap) -The TAP adapter type. -.TP -\fB\-\-tap_adapter\fR.enabled arg (=yes) -Whether to enable the tap adapter. -.TP -\fB\-\-tap_adapter\fR.name arg -The name of the tap adapter to use or -create. -.TP -\fB\-\-tap_adapter\fR.mtu arg (=auto) -The MTU of the tap adapter. -.TP -\fB\-\-tap_adapter\fR.mss_override arg (=auto) -The MSS override. -.TP -\fB\-\-tap_adapter\fR.metric arg (=auto) -The metric of the tap adapter. -.TP -\fB\-\-tap_adapter\fR.ipv4_address_prefix_length arg -The tap adapter IPv4 address and prefix -length. -.TP -\fB\-\-tap_adapter\fR.ipv6_address_prefix_length arg -The tap adapter IPv6 address and prefix -length. -.HP -\fB\-\-tap_adapter\fR.remote_ipv4_address arg The tap adapter IPv4 remote address. -.TP -\fB\-\-tap_adapter\fR.arp_proxy_enabled arg (=0) -Whether to enable the ARP proxy. -.TP -\fB\-\-tap_adapter\fR.arp_proxy_fake_ethernet_address arg (=00:aa:bb:cc:dd:ee) -The ARP proxy fake ethernet address. -.TP -\fB\-\-tap_adapter\fR.dhcp_proxy_enabled arg (=1) -Whether to enable the DHCP proxy. -.TP -\fB\-\-tap_adapter\fR.dhcp_server_ipv4_address_prefix_length arg (=9.0.0.0/24) -The DHCP proxy server IPv4 address and -prefix length. -.TP -\fB\-\-tap_adapter\fR.dhcp_server_ipv6_address_prefix_length arg (=fe80::/10) -The DHCP proxy server IPv6 address and -prefix length. -.TP -\fB\-\-tap_adapter\fR.up_script arg (="") -The tap adapter up script. -.TP -\fB\-\-tap_adapter\fR.down_script arg (="") -The tap adapter down script. -.SS "Switch options:" -.HP -\fB\-\-switch\fR.routing_method arg (=switch) The routing method for messages. -.HP -\fB\-\-switch\fR.relay_mode_enabled arg (=no) Whether to enable the relay mode. -.SS "Router options:" -.TP -\fB\-\-router\fR.local_ip_route arg -A route to advertise to the other -peers. -.TP -\fB\-\-router\fR.local_dns_server arg -A DNS server to advertise to the other -peers. -.TP -\fB\-\-router\fR.client_routing_enabled arg (=yes) -Whether to enable client routing. -.TP -\fB\-\-router\fR.accept_routes_requests arg (=yes) -Whether to accept routes requests. -.TP -\fB\-\-router\fR.internal_route_acceptance_policy arg (=unicast_in_network) -The internal route acceptance policy. -.TP -\fB\-\-router\fR.system_route_acceptance_policy arg (=none) -The system route acceptance policy. -.TP -\fB\-\-router\fR.maximum_routes_limit arg (=1) -The maximum count of routes to accept -for a given host. -.TP -\fB\-\-router\fR.dns_servers_acceptance_policy arg (=in_network) -The DNS servers acceptance policy. -.TP -\fB\-\-router\fR.dns_script arg (="") -The DNS script. -.SS "Daemon:" -.TP -\fB\-f\fR [ \fB\-\-foreground\fR ] -Do not run as a daemon. -.TP -\fB\-s\fR [ \fB\-\-syslog\fR ] -Always log to syslog (useful when running with -\fB\-\-foreground\fR on OSX with launchd). -.HP -\fB\-p\fR [ \fB\-\-pid_file\fR ] arg A pid file to use. -.SS "Miscellaneous:" -.TP -\fB\-\-nocolor\fR -Disable color output. -.SH "SEE ALSO" -The full documentation for -.B freelan -is maintained as a Texinfo manual. If the -.B info -and -.B freelan -programs are properly installed at your site, the command -.IP -.B info freelan -.PP -should give you access to the complete manual. diff --git a/packaging/rpm/freelan.spec b/packaging/rpm/freelan.spec index c1b7eed0..d5129c41 100644 --- a/packaging/rpm/freelan.spec +++ b/packaging/rpm/freelan.spec @@ -15,6 +15,7 @@ BuildRequires: openssl-devel BuildRequires: boost-devel BuildRequires: libcurl-devel BuildRequires: miniupnpc-devel +BuildRequires: help2man Requires: openssl Requires: boost Requires: libcurl @@ -47,7 +48,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/freelan cp -a apps/freelan/config/freelan.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/freelan/ # manpage mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 -cp packaging/rpm/freelan.1 $RPM_BUILD_ROOT/%{_mandir}/man1/freelan.1 +cp build/release/man/freelan.1 $RPM_BUILD_ROOT/%{_mandir}/man1/freelan.1 # systemd unit mkdir -p $RPM_BUILD_ROOT/%{_unitdir} cp -p packaging/rpm/freelan@.service $RPM_BUILD_ROOT/%{_unitdir}/ diff --git a/packaging/sailfishos/README.md b/packaging/sailfishos/README.md index 515cb3af..fc5f1758 100644 --- a/packaging/sailfishos/README.md +++ b/packaging/sailfishos/README.md @@ -16,17 +16,17 @@ mersdk@localhost` ## Setup environment -On the VM ssh shell, install scons boost-devel openssl-devel and libcurl-devel. +On the VM ssh shell, install some dependencies. For x86 target: `sb2 -t SailfishOS-i486 -m sdk-install -R zypper install scons boost-devel -openssl-devel libcurl-devel boost-thread` +openssl-devel libcurl-devel boost-thread help2man` For ARM target: `sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper install scons boost-devel -openssl-devel libcurl-devel boost-thread` +openssl-devel libcurl-devel boost-thread help2man` Retrieve sources: diff --git a/packaging/sailfishos/freelan.spec b/packaging/sailfishos/freelan.spec index d203e930..9208454a 100644 --- a/packaging/sailfishos/freelan.spec +++ b/packaging/sailfishos/freelan.spec @@ -14,6 +14,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: openssl-devel BuildRequires: boost-devel BuildRequires: libcurl-devel +BuildRequires: help2man Requires: openssl-libs Requires: boost-thread Requires: boost-iostreams @@ -50,7 +51,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/freelan cp -a apps/freelan/config/freelan.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/freelan/ # manpage mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 -cp packaging/rpm/freelan.1 $RPM_BUILD_ROOT/%{_mandir}/man1/freelan.1 +cp build/release/man/freelan.1 $RPM_BUILD_ROOT/%{_mandir}/man1/freelan.1 # systemd unit mkdir -p $RPM_BUILD_ROOT/%{_unitdir} cp -p packaging/rpm/freelan@.service $RPM_BUILD_ROOT/%{_unitdir}/ diff --git a/provisioning/roles/freelan-build/tasks/main.yml b/provisioning/roles/freelan-build/tasks/main.yml index 2627c9c9..05453c7c 100644 --- a/provisioning/roles/freelan-build/tasks/main.yml +++ b/provisioning/roles/freelan-build/tasks/main.yml @@ -9,6 +9,7 @@ - libssl-dev - libcurl4-openssl-dev - libminiupnpc-dev + - help2man tags: - build sudo: True