summary refs log tree commit diff
path: root/pkgs/tools/networking/zerotierone
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-06-30 11:12:20 +0100
committerzimbatm <zimbatm@zimbatm.com>2016-06-30 11:12:20 +0100
commit4932524080c8e187f698927b21cb667b814cf0cd (patch)
tree7c2c1f6f653f0789ad7da6366f4ff7740beabef0 /pkgs/tools/networking/zerotierone
parent7298dd8cca8f575586fc7026b388f3928abeeb56 (diff)
downloadnixpkgs-4932524080c8e187f698927b21cb667b814cf0cd.tar
nixpkgs-4932524080c8e187f698927b21cb667b814cf0cd.tar.gz
nixpkgs-4932524080c8e187f698927b21cb667b814cf0cd.tar.bz2
nixpkgs-4932524080c8e187f698927b21cb667b814cf0cd.tar.lz
nixpkgs-4932524080c8e187f698927b21cb667b814cf0cd.tar.xz
nixpkgs-4932524080c8e187f698927b21cb667b814cf0cd.tar.zst
nixpkgs-4932524080c8e187f698927b21cb667b814cf0cd.zip
zerotierone: build manpages
Diffstat (limited to 'pkgs/tools/networking/zerotierone')
-rw-r--r--pkgs/tools/networking/zerotierone/default.nix34
1 files changed, 21 insertions, 13 deletions
diff --git a/pkgs/tools/networking/zerotierone/default.nix b/pkgs/tools/networking/zerotierone/default.nix
index 29d131b509b..69529e8ba73 100644
--- a/pkgs/tools/networking/zerotierone/default.nix
+++ b/pkgs/tools/networking/zerotierone/default.nix
@@ -1,6 +1,4 @@
-{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute }:
-
-with stdenv.lib;
+{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute, ronn }:
 
 stdenv.mkDerivation rec {
   version = "1.1.6";
@@ -13,28 +11,38 @@ stdenv.mkDerivation rec {
 
   preConfigure = ''
       substituteInPlace ./make-linux.mk \
-          --replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc";
+        --replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc";
       substituteInPlace ./make-linux.mk \
-          --replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++";
+        --replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++";
       substituteInPlace ./osdep/LinuxEthernetTap.cpp \
-          --replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",'
-  '';
+        --replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",'
 
-  buildInputs = [ openssl lzo zlib gcc iproute ];
+      patchShebangs ./doc/build.sh
+      substituteInPlace ./doc/build.sh \
+        --replace '/usr/bin/ronn' '${ronn}/bin/ronn' \
+        --replace 'ronn -r' '${ronn}/bin/ronn -r'
+  '';
 
-  buildFlags = [ "one" ]; # TODO: Add support for building and installing manpages as well.
+  buildInputs = [ openssl lzo zlib gcc iproute ronn ];
 
   installPhase = ''
     install -Dt "$out/bin/" zerotier-one
     ln -s $out/bin/zerotier-one $out/bin/zerotier-idtool
     ln -s $out/bin/zerotier-one $out/bin/zerotier-cli
+
+    mkdir -p $man/share/man/man8
+    for cmd in zerotier-one.8 zerotier-cli.1 zerotier-idtool.1; do
+      cat doc/$cmd | gzip -9 > $man/share/man/man8/$cmd.gz
+    done
   '';
 
-  meta = {
+  outputs = [ "out" "man" ];
+
+  meta = with stdenv.lib; {
     description = "Create flat virtual Ethernet networks of almost unlimited size";
     homepage = https://www.zerotier.com;
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.sjmackenzie ];
-    platforms = with stdenv.lib; platforms.allBut [ "i686-linux" ];
+    license = licenses.gpl3;
+    maintainers = [ sjmackenzie ];
+    platforms = platforms.allBut [ "i686-linux" ];
   };
 }