diff options
-rw-r--r-- | pkgs/servers/portmap/default.nix | 39 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 9 |
2 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/servers/portmap/default.nix b/pkgs/servers/portmap/default.nix new file mode 100644 index 0000000000000..df50c3320296a --- /dev/null +++ b/pkgs/servers/portmap/default.nix @@ -0,0 +1,39 @@ +{ fetchurl, stdenv, lib, tcpWrapper +, daemonUser, daemonUID, daemonGID }: + +assert daemonUser -> (!daemonUID && !daemonGID); + +stdenv.mkDerivation rec { + name = "portmap-6.0"; + src = fetchurl { + url = "http://neil.brown.name/portmap/${name}.tgz"; + sha256 = "1pj13ll4mbfwjwpn3fbg03qq9im6v2i8fcpa3ffp4viykz9j1j02"; + }; + + patchPhase = '' + substituteInPlace "Makefile" --replace "/usr/share" "" \ + --replace "install -o root -g root" "install" + ''; + + makeFlags = + lib.concatStringsSep " " + (lib.optional daemonUser "RPCUSER=\"${daemonUser}\"" + ++ lib.optional daemonUID "DAEMON_UID=${daemonUID}" + ++ lib.optional daemonGID "DAEMON_GID=${daemonGID}"); + + buildInputs = [ tcpWrapper ]; + + installPhase = '' + ensureDir "$out/sbin" && ensureDir "$out/man/man8" && \ + make install BASEDIR=$out + ''; + + meta = { + description = ''portmap is a part of the ONC RPC software collection + implementing remote procedure calls (RPCs) between + computer programs. It is widely used by NFS and NIS, + among others.''; + homepage = http://neil.brown.name/portmap/; + license = "BSD"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 19adb2111355e..2dcb1ee8619e8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3656,6 +3656,15 @@ rec { inherit fetchurl stdenv apacheHttpd jdk; }; + portmap = import ../servers/portmap { + inherit fetchurl stdenv lib tcpWrapper; + + # This settings should typically be defined by NixOS Upstart job. + daemonUser = false; + daemonGID = false; + daemonUID = false; + }; + mysql4 = import ../servers/sql/mysql { inherit fetchurl stdenv ncurses zlib perl; ps = procps; /* !!! Linux only */ |