fingerd_bsd: "merge" with finger_bsd

In order to reduce duplicated code

+31 -104
-26
pkgs/servers/fingerd/bsd-fingerd/default.nix
··· 1 - { lib, stdenv, fetchurl }: 2 - 3 - # !!! Duplication: this package is almost exactly the same as `bsd-fingerd'. 4 - 5 - stdenv.mkDerivation rec { 6 - pname = "bsd-fingerd"; 7 - version = "0.17"; 8 - 9 - src = fetchurl { 10 - url = "mirror://ibiblioPubLinux/system/network/finger/bsd-finger-${version}.tar.gz"; 11 - sha256 = "1yhkiv0in588il7f84k2xiy78g9lv12ll0y7047gazhiimk5v244"; 12 - }; 13 - 14 - NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; 15 - 16 - patches = [ ./ubuntu-0.17-9.patch ]; 17 - 18 - preBuild = "cd fingerd"; 19 - 20 - preInstall = "mkdir -p $out/man/man8 $out/sbin "; 21 - 22 - meta = with lib; { 23 - platforms = platforms.linux; 24 - license = licenses.bsdOriginal; 25 - }; 26 - }
···
-67
pkgs/servers/fingerd/bsd-fingerd/ubuntu-0.17-9.patch
··· 1 - --- bsd-finger-0.17.orig/fingerd/fingerd.8 2 - +++ bsd-finger-0.17/fingerd/fingerd.8 3 - @@ -36,10 +36,10 @@ 4 - .Dt FINGERD 8 5 - .Os "Linux NetKit (0.17)" 6 - .Sh NAME 7 - -.Nm fingerd 8 - +.Nm in.fingerd 9 - .Nd remote user information server 10 - .Sh SYNOPSIS 11 - -.Nm fingerd 12 - +.Nm in.fingerd 13 - .Op Fl wulf 14 - .Op Fl pL Ar path 15 - .Op Fl t Ar timeout 16 - @@ -61,7 +61,7 @@ 17 - banner 18 - which also shows some informations (e.g. uptime, operating system name and 19 - release) about the system the 20 - -.Nm fingerd 21 - +.Nm in.fingerd 22 - is running on. Some sites may consider this a security risk as it 23 - gives out information that may be useful to crackers. 24 - .Pp 25 - @@ -85,7 +85,7 @@ 26 - .Pp 27 - The 28 - .Fl p 29 - -option allows specification of an alternate location for fingerd to find 30 - +option allows specification of an alternate location for in.fingerd to find 31 - the 32 - .Dq finger 33 - program. The 34 - @@ -97,7 +97,7 @@ 35 - option specifies the time to wait for a request before closing the 36 - connection. A value of 0 waits forever. The default is 60 seconds. 37 - .Pp 38 - -Options to fingerd should be specified in 39 - +Options to in.fingerd should be specified in 40 - .Pa /etc/inetd.conf . 41 - .Pp 42 - The finger protocol consists mostly of specifying command arguments. 43 - @@ -105,12 +105,12 @@ 44 - .Xr inetd 8 45 - .Dq super-server 46 - runs 47 - -.Nm fingerd 48 - +.Nm in.fingerd 49 - for 50 - .Tn TCP 51 - requests received on port 79. 52 - Once connected 53 - -.Nm fingerd 54 - +.Nm in.fingerd 55 - reads a single command line 56 - terminated by a 57 - .Aq Tn CRLF 58 - --- bsd-finger-0.17.orig/fingerd/fingerd.c 59 - +++ bsd-finger-0.17/fingerd/fingerd.c 60 - @@ -55,6 +55,7 @@ 61 - #include <netinet/in.h> 62 - #include <sys/utsname.h> 63 - #include <sys/wait.h> 64 - +#include <sys/socket.h> 65 - 66 - #include "pathnames.h" 67 - #include "../version.h"
···
+30 -9
pkgs/tools/networking/bsd-finger/default.nix
··· 1 - { lib, stdenv, fetchurl }: 2 - 3 - # !!! Duplication: this package is almost exactly the same as `bsd-finger'. 4 5 stdenv.mkDerivation rec { 6 - pname = "bsd-finger"; 7 version = "0.17"; 8 9 src = fetchurl { 10 - url = "mirror://ibiblioPubLinux/system/network/finger/bsd-finger-${version}.tar.gz"; 11 - sha256 = "1yhkiv0in588il7f84k2xiy78g9lv12ll0y7047gazhiimk5v244"; 12 }; 13 14 NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; 15 16 - patches = [ ./ubuntu-0.17-9.patch ]; 17 18 - preBuild = "cd finger"; 19 20 - preInstall = "mkdir -p $out/man/man1 $out/bin "; 21 22 meta = with lib; { 23 platforms = platforms.linux; 24 license = licenses.bsdOriginal; 25 }; 26 }
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , buildClient ? true 5 + }: 6 7 stdenv.mkDerivation rec { 8 + srcName = "bsd-finger"; 9 + pname = srcName + lib.optionalString (!buildClient) "d"; 10 version = "0.17"; 11 12 src = fetchurl { 13 + url = "mirror://ibiblioPubLinux/system/network/finger/${srcName}-${version}.tar.gz"; 14 + hash = "sha256-hIhdZo0RfvUOAccDSkXYND10fOxiEuQOjQgVG8GOE/o="; 15 }; 16 17 + # outputs = [ "out" "man" ]; 18 + 19 NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; 20 21 + patches = [ 22 + ./ubuntu-0.17-9.patch 23 + ]; 24 25 + preBuild = let 26 + srcdir = if buildClient then "finger" else "fingerd"; 27 + in '' 28 + cd ${srcdir} 29 + ''; 30 31 + preInstall = let 32 + bindir = if buildClient then "bin" else "sbin"; 33 + mandir = if buildClient then "man/man1" else "man/man8"; 34 + in '' 35 + mkdir -p $out/${bindir} $out/${mandir} 36 + ''; 37 38 meta = with lib; { 39 + description = 40 + if buildClient 41 + then "User information lookup program" 42 + else "Remote user information server"; 43 platforms = platforms.linux; 44 license = licenses.bsdOriginal; 45 }; 46 } 47 + # TODO: multiple outputs (manpage)
+1 -2
pkgs/top-level/all-packages.nix
··· 5476 findutils = callPackage ../tools/misc/findutils { }; 5477 5478 finger_bsd = callPackage ../tools/networking/bsd-finger { }; 5479 5480 iprange = callPackage ../applications/networking/firehol/iprange.nix {}; 5481 ··· 21263 felix = callPackage ../servers/felix { }; 21264 21265 felix_remoteshell = callPackage ../servers/felix/remoteshell.nix { }; 21266 - 21267 - fingerd_bsd = callPackage ../servers/fingerd/bsd-fingerd { }; 21268 21269 inherit (callPackages ../servers/firebird { }) firebird_4 firebird_3 firebird_2_5 firebird; 21270
··· 5476 findutils = callPackage ../tools/misc/findutils { }; 5477 5478 finger_bsd = callPackage ../tools/networking/bsd-finger { }; 5479 + fingerd_bsd = finger_bsd.override({ buildClient = false; }); 5480 5481 iprange = callPackage ../applications/networking/firehol/iprange.nix {}; 5482 ··· 21264 felix = callPackage ../servers/felix { }; 21265 21266 felix_remoteshell = callPackage ../servers/felix/remoteshell.nix { }; 21267 21268 inherit (callPackages ../servers/firebird { }) firebird_4 firebird_3 firebird_2_5 firebird; 21269