2012-11-29 15:14:16 +01:00
|
|
|
{ fetchurl, stdenv, lib, tcp_wrappers
|
2009-03-20 17:17:08 +01:00
|
|
|
, daemonUser ? false, daemonUID ? false, daemonGID ? false }:
|
2008-03-15 23:51:46 +01:00
|
|
|
|
|
|
|
assert daemonUser -> (!daemonUID && !daemonGID);
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "portmap-6.0";
|
2009-03-20 17:17:08 +01:00
|
|
|
|
2008-03-15 23:51:46 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://neil.brown.name/portmap/${name}.tgz";
|
|
|
|
sha256 = "1pj13ll4mbfwjwpn3fbg03qq9im6v2i8fcpa3ffp4viykz9j1j02";
|
|
|
|
};
|
|
|
|
|
2012-03-16 18:42:14 +01:00
|
|
|
patches = [ ./reuse-socket.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2008-03-15 23:51:46 +01:00
|
|
|
substituteInPlace "Makefile" --replace "/usr/share" "" \
|
|
|
|
--replace "install -o root -g root" "install"
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags =
|
2012-03-16 18:20:04 +01:00
|
|
|
lib.optional (daemonUser != false) "RPCUSER=\"${daemonUser}\""
|
|
|
|
++ lib.optional (daemonUID != false) "DAEMON_UID=${toString daemonUID}"
|
|
|
|
++ lib.optional (daemonGID != false) "DAEMON_GID=${toString daemonGID}";
|
2008-03-15 23:51:46 +01:00
|
|
|
|
2012-11-29 15:14:16 +01:00
|
|
|
buildInputs = [ tcp_wrappers ];
|
2008-03-15 23:51:46 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2012-03-16 18:20:04 +01:00
|
|
|
mkdir -p "$out/sbin" "$out/man/man8"
|
2008-03-15 23:51:46 +01:00
|
|
|
make install BASEDIR=$out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2008-03-20 15:35:03 +01:00
|
|
|
description = "ONC RPC portmapper";
|
|
|
|
longDescription = ''
|
|
|
|
Portmap is 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.
|
|
|
|
'';
|
|
|
|
|
2008-03-15 23:51:46 +01:00
|
|
|
homepage = http://neil.brown.name/portmap/;
|
|
|
|
license = "BSD";
|
|
|
|
};
|
|
|
|
}
|