summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2003-12-26 23:51:19 +0000
committerMartin Schlemmer <azarah@gentoo.org>2003-12-26 23:51:19 +0000
commitcd8b63f35edc80c76a0fcc33887a81b3b5e76dd9 (patch)
tree62207d18cfc47498677ef0938211a9a512341dc7 /net-nds
parentCleanup ebuild a bit. Add some RH patches. Fix to work with (diff)
downloadhistorical-cd8b63f35edc80c76a0fcc33887a81b3b5e76dd9.tar.gz
historical-cd8b63f35edc80c76a0fcc33887a81b3b5e76dd9.tar.bz2
historical-cd8b63f35edc80c76a0fcc33887a81b3b5e76dd9.zip
Cleanup ebuild a bit. Add some RH patches. Fix to work with
>=sys-apps/tcp-wrappers-7.6-r7 that moved libwrap.a to /lib.
Diffstat (limited to 'net-nds')
-rw-r--r--net-nds/portmap/Manifest6
-rw-r--r--net-nds/portmap/files/digest-portmap-5b-r81
-rw-r--r--net-nds/portmap/files/portmap-4.0-cleanup.patch85
-rw-r--r--net-nds/portmap/files/portmap-4.0-malloc.patch338
-rw-r--r--net-nds/portmap/files/portmap-4.0-rpc_user.patch59
-rw-r--r--net-nds/portmap/files/portmap-4.0-sigpipe.patch12
-rw-r--r--net-nds/portmap/portmap-5b-r8.ebuild62
7 files changed, 561 insertions, 2 deletions
diff --git a/net-nds/portmap/Manifest b/net-nds/portmap/Manifest
index 5ac1bfba8dc7..2e6b5521b936 100644
--- a/net-nds/portmap/Manifest
+++ b/net-nds/portmap/Manifest
@@ -1,5 +1,6 @@
-MD5 5f4e7c541f1bd2f954f1951d84612ffc portmap-5b-r8.ebuild 1721
-MD5 ae3adb0dd0a3cec387a03dfcbfc8359e ChangeLog 1725
+MD5 58642c19fb76ffe84bbac697d74af1ca portmap-5b-r8.ebuild 1677
+MD5 2eaa0f2b4241c799bea8871a8fb026a1 ChangeLog 2090
+MD5 4cafe9508f31c35a21881a3389d282c9 portmap-5b-r7.ebuild 1359
MD5 5f14c7c839e8d07220428f20da22117d portmap-5b-r6.ebuild 1086
MD5 49ef87c468b07ca837a1282faca5647b files/portmap-4.0-rpc_user.patch 1779
MD5 c4cab1b374730a709460d95211200852 files/portmap-4.0-cleanup.patch 2193
@@ -10,3 +11,4 @@ MD5 7667fe1c5070f9f57c1beb25015bb7be files/portmap-4.0-malloc.patch 9067
MD5 887940376974bf01ecf94fd032f224eb files/portmap-5b-include-errno_h.patch 403
MD5 aba313626e59d574e050ab392749a9ba files/portmap.rc6 1098
MD5 44dae63001c0ad007604a7ba55403838 files/digest-portmap-5b-r6 64
+MD5 44dae63001c0ad007604a7ba55403838 files/digest-portmap-5b-r7 64
diff --git a/net-nds/portmap/files/digest-portmap-5b-r8 b/net-nds/portmap/files/digest-portmap-5b-r8
new file mode 100644
index 000000000000..61f9e105bbe8
--- /dev/null
+++ b/net-nds/portmap/files/digest-portmap-5b-r8
@@ -0,0 +1 @@
+MD5 781e16ed4487c4caa082c6fef09ead4f portmap_5beta.tar.gz 18702
diff --git a/net-nds/portmap/files/portmap-4.0-cleanup.patch b/net-nds/portmap/files/portmap-4.0-cleanup.patch
new file mode 100644
index 000000000000..2e005afe28e4
--- /dev/null
+++ b/net-nds/portmap/files/portmap-4.0-cleanup.patch
@@ -0,0 +1,85 @@
+Some cleanup for my last patch.
+
+
+--
+H.J. Lu (hjl@gnu.org)
+--
+--- portmap_4/pmap_check.c.hostname Wed May 10 10:23:35 2000
++++ portmap_4/pmap_check.c Wed May 10 11:03:22 2000
+@@ -35,6 +35,7 @@
+ static char sccsid[] = "@(#) pmap_check.c 1.6 93/11/21 20:58:59";
+ #endif
+ #include <unistd.h>
++#include <string.h>
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_prot.h>
+ #include <syslog.h>
+@@ -69,8 +70,6 @@ int deny_severity = LOG_WARNING;
+ /* coming from libwrap.a (tcp_wrappers) */
+ extern int hosts_ctl(char *daemon, char *name, char *addr, char *user);
+
+-#define good_client(a) hosts_ctl("portmap", "", inet_ntoa(a->sin_addr), "")
+-
+ #define reserved_port(p) (IPPORT_RESERVED/2 < (p) && (p) < IPPORT_RESERVED)
+
+ #define unreserved_port(p) (IPPORT_RESERVED <= (p) && (p) != NFS_PORT)
+@@ -88,6 +87,59 @@ extern int hosts_ctl(char *daemon, char
+
+ #define log_client(addr, proc, prog) \
+ logit(allow_severity, addr, proc, prog, "")
++
++#ifdef HOSTS_ACCESS
++static int
++good_client(addr)
++struct sockaddr_in *addr;
++{
++ struct hostent *hp;
++ char **sp;
++ char *tmpname;
++
++ /* Check the IP address first. */
++ if (hosts_ctl("portmap", "", inet_ntoa(addr->sin_addr), ""))
++ return 1;
++
++ /* Check the hostname. */
++ hp = gethostbyaddr ((const char *) &(addr->sin_addr),
++ sizeof (addr->sin_addr), AF_INET);
++
++ if (!hp)
++ return 0;
++
++ /* must make sure the hostent is authorative. */
++ tmpname = alloca (strlen (hp->h_name) + 1);
++ strcpy (tmpname, hp->h_name);
++ hp = gethostbyname(tmpname);
++ if (hp) {
++ /* now make sure the "addr->sin_addr" is on the list */
++ for (sp = hp->h_addr_list ; *sp ; sp++) {
++ if (memcmp(*sp, &(addr->sin_addr), hp->h_length)==0)
++ break;
++ }
++ if (!*sp)
++ /* it was a FAKE. */
++ return 0;
++ }
++ else
++ /* never heard of it. misconfigured DNS? */
++ return 0;
++
++ /* Check the official name first. */
++ if (hosts_ctl("portmap", "", hp->h_name, ""))
++ return 1;
++
++ /* Check aliases. */
++ for (sp = hp->h_aliases; *sp ; sp++) {
++ if (hosts_ctl("portmap", "", *sp, ""))
++ return 1;
++ }
++
++ /* No match */
++ return 0;
++}
++#endif
+
+ /* check_startup - additional startup code */
+
diff --git a/net-nds/portmap/files/portmap-4.0-malloc.patch b/net-nds/portmap/files/portmap-4.0-malloc.patch
new file mode 100644
index 000000000000..db3bf09eea93
--- /dev/null
+++ b/net-nds/portmap/files/portmap-4.0-malloc.patch
@@ -0,0 +1,338 @@
+diff -urN portmap_4/daemon.c portmap_4.new/daemon.c
+--- portmap_4/daemon.c Thu Jun 11 13:53:12 1992
++++ portmap_4.new/daemon.c Mon Nov 29 18:37:28 1999
+@@ -35,7 +35,9 @@
+ static char sccsid[] = "@(#)daemon.c 5.3 (Berkeley) 12/28/90";
+ #endif /* LIBC_SCCS and not lint */
+
++#include <sys/types.h>
+ #include <fcntl.h>
++#include <unistd.h>
+
+ /* From unistd.h */
+ #define STDIN_FILENO 0
+@@ -44,7 +46,7 @@
+
+ /* From paths.h */
+ #define _PATH_DEVNULL "/dev/null"
+-
++int
+ daemon(nochdir, noclose)
+ int nochdir, noclose;
+ {
+diff -urN portmap_4/from_local.c portmap_4.new/from_local.c
+--- portmap_4/from_local.c Fri May 31 06:52:58 1996
++++ portmap_4.new/from_local.c Tue Nov 30 01:21:27 1999
+@@ -46,12 +46,14 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <stdio.h>
+-#include <stdlib.h>
++#include <unistd.h>
+ #include <netdb.h>
+ #include <netinet/in.h>
+ #include <net/if.h>
+ #include <sys/ioctl.h>
+ #include <syslog.h>
++#include <stdlib.h>
++#include <string.h>
+
+ #ifndef TRUE
+ #define TRUE 1
+@@ -95,7 +98,7 @@
+ }
+
+ /* find_local - find all IP addresses for this host */
+-
++int
+ find_local()
+ {
+ struct ifconf ifc;
+@@ -153,7 +156,7 @@
+ }
+
+ /* from_local - determine whether request comes from the local system */
+-
++int
+ from_local(addr)
+ struct sockaddr_in *addr;
+ {
+diff -urN portmap_4/pmap_check.c portmap_4.new/pmap_check.c
+--- portmap_4/pmap_check.c Sun Nov 21 11:59:01 1993
++++ portmap_4.new/pmap_check.c Tue Nov 30 01:19:37 1999
+@@ -34,7 +34,7 @@
+ #ifndef lint
+ static char sccsid[] = "@(#) pmap_check.c 1.6 93/11/21 20:58:59";
+ #endif
+-
++#include <unistd.h>
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_prot.h>
+ #include <syslog.h>
+@@ -66,6 +66,9 @@
+
+ /* A handful of macros for "readability". */
+
++/* coming from libwrap.a (tcp_wrappers) */
++extern int hosts_ctl(char *daemon, char *name, char *addr, char *user);
++
+ #define good_client(a) hosts_ctl("portmap", "", inet_ntoa(a->sin_addr), "")
+
+ #define legal_port(a,p) \
+@@ -104,6 +107,7 @@
+
+ /* check_default - additional checks for NULL, DUMP, GETPORT and unknown */
+
++int
+ check_default(addr, proc, prog)
+ struct sockaddr_in *addr;
+ u_long proc;
+@@ -121,7 +125,7 @@
+ }
+
+ /* check_privileged_port - additional checks for privileged-port updates */
+-
++int
+ check_privileged_port(addr, proc, prog, port)
+ struct sockaddr_in *addr;
+ u_long proc;
+@@ -147,6 +147,6 @@
+
+ #ifdef LOOPBACK_SETUNSET
+-
++int
+ check_setunset(xprt, ludp_xprt, ltcp_xprt, proc, prog, port)
+ SVCXPRT *xprt;
+ SVCXPRT *ludp_xprt;
+@@ -173,6 +174,6 @@
+
+ #else
+-
++int
+ check_setunset(addr, proc, prog, port)
+ struct sockaddr_in *addr;
+ u_long proc;
+@@ -160,7 +164,7 @@
+ }
+
+ /* check_callit - additional checks for forwarded requests */
+-
++int
+ check_callit(addr, proc, prog, aproc)
+ struct sockaddr_in *addr;
+ u_long proc;
+@@ -213,13 +217,13 @@
+ };
+ struct proc_map *procp;
+ static struct proc_map procmap[] = {
+- PMAPPROC_CALLIT, "callit",
+- PMAPPROC_DUMP, "dump",
+- PMAPPROC_GETPORT, "getport",
+- PMAPPROC_NULL, "null",
+- PMAPPROC_SET, "set",
+- PMAPPROC_UNSET, "unset",
+- 0, 0,
++ { PMAPPROC_CALLIT, "callit"},
++ { PMAPPROC_DUMP, "dump"},
++ { PMAPPROC_GETPORT, "getport"},
++ { PMAPPROC_NULL, "null"},
++ { PMAPPROC_SET, "set"},
++ { PMAPPROC_UNSET, "unset"},
++ { 0, 0},
+ };
+
+ /*
+@@ -233,7 +237,7 @@
+
+ if (prognum == 0) {
+ progname = "";
+- } else if (rpc = getrpcbynumber((int) prognum)) {
++ } else if ((rpc = getrpcbynumber((int) prognum))) {
+ progname = rpc->r_name;
+ } else {
+ sprintf(progname = progbuf, "%lu", prognum);
+diff -urN portmap_4/pmap_dump.c portmap_4.new/pmap_dump.c
+--- portmap_4/pmap_dump.c Thu Jun 11 13:53:16 1992
++++ portmap_4.new/pmap_dump.c Tue Nov 30 01:22:07 1999
+@@ -22,7 +22,7 @@
+ #include <rpc/pmap_prot.h>
+
+ static char *protoname();
+-
++int
+ main(argc, argv)
+ int argc;
+ char **argv;
+diff -urN portmap_4/pmap_set.c portmap_4.new/pmap_set.c
+--- portmap_4/pmap_set.c Thu Jun 11 13:53:17 1992
++++ portmap_4.new/pmap_set.c Tue Nov 30 01:23:49 1999
+@@ -17,6 +17,9 @@
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_clnt.h>
+
++int parse_line(char *buf, u_long *, u_long *, int *, unsigned *);
++
++int
+ main(argc, argv)
+ int argc;
+ char **argv;
+@@ -42,7 +45,7 @@
+ }
+
+ /* parse_line - convert line to numbers */
+-
++int
+ parse_line(buf, prog, vers, prot, port)
+ char *buf;
+ u_long *prog;
+diff -urN portmap_4/portmap.c portmap_4.new/portmap.c
+--- portmap_4/portmap.c Fri May 31 06:52:59 1996
++++ portmap_4.new/portmap.c Tue Nov 30 01:01:32 1999
+@@ -83,6 +83,7 @@
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_prot.h>
+ #include <stdio.h>
++#include <unistd.h>
+ #include <syslog.h>
+ #include <netdb.h>
+ #include <sys/socket.h>
+@@ -128,6 +129,7 @@
+
+ #include "pmap_check.h"
+
++int
+ main(argc, argv)
+ int argc;
+ char **argv;
+@@ -229,6 +231,7 @@
+ svc_run();
+ syslog(LOG_ERR, "run_svc returned unexpectedly");
+ abort();
++ /* never reached */
+ }
+
+ #ifndef lint
+@@ -290,7 +293,7 @@
+ */
+ /* remote host authorization check */
+ check_default(svc_getcaller(xprt), rqstp->rq_proc, (u_long) 0);
+- if (!svc_sendreply(xprt, xdr_void, (caddr_t)0) && debugging) {
++ if (!svc_sendreply(xprt, (xdrproc_t)xdr_void, (caddr_t)0) && debugging) {
+ abort();
+ }
+ break;
+@@ -299,7 +302,7 @@
+ /*
+ * Set a program,version to port mapping
+ */
+- if (!svc_getargs(xprt, xdr_pmap, &reg))
++ if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (caddr_t)&reg))
+ svcerr_decode(xprt);
+ else {
+ /* reject non-local requests, protect priv. ports */
+@@ -341,7 +344,7 @@
+ ans = 1;
+ }
+ done:
+- if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) &&
++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) &&
+ debugging) {
+ (void) fprintf(stderr, "svc_sendreply\n");
+ abort();
+@@ -353,7 +356,7 @@
+ /*
+ * Remove a program,version to port mapping.
+ */
+- if (!svc_getargs(xprt, xdr_pmap, &reg))
++ if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (caddr_t)&reg))
+ svcerr_decode(xprt);
+ else {
+ ans = 0;
+@@ -387,7 +390,7 @@
+ prevpml->pml_next = pml;
+ free(t);
+ }
+- if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) &&
++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) &&
+ debugging) {
+ (void) fprintf(stderr, "svc_sendreply\n");
+ abort();
+@@ -399,7 +402,7 @@
+ /*
+ * Lookup the mapping for a program,version and return its port
+ */
+- if (!svc_getargs(xprt, xdr_pmap, &reg))
++ if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (caddr_t)&reg))
+ svcerr_decode(xprt);
+ else {
+ /* remote host authorization check */
+@@ -414,7 +417,7 @@
+ port = fnd->pml_map.pm_port;
+ else
+ port = 0;
+- if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&port)) &&
++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&port)) &&
+ debugging) {
+ (void) fprintf(stderr, "svc_sendreply\n");
+ abort();
+@@ -426,7 +429,7 @@
+ /*
+ * Return the current set of mapped program,version
+ */
+- if (!svc_getargs(xprt, xdr_void, NULL))
++ if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL))
+ svcerr_decode(xprt);
+ else {
+ /* remote host authorization check */
+@@ -437,7 +440,7 @@
+ } else {
+ p = pmaplist;
+ }
+- if ((!svc_sendreply(xprt, xdr_pmaplist,
++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_pmaplist,
+ (caddr_t)&p)) && debugging) {
+ (void) fprintf(stderr, "svc_sendreply\n");
+ abort();
+@@ -481,7 +484,7 @@
+ struct encap_parms *epp;
+ {
+
+- return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE));
++ return (xdr_bytes(xdrs, &(epp->args), (u_int *)&(epp->arglen), ARGSIZE));
+ }
+
+ struct rmtcallargs {
+@@ -585,7 +588,7 @@
+ timeout.tv_sec = 5;
+ timeout.tv_usec = 0;
+ a.rmt_args.args = buf;
+- if (!svc_getargs(xprt, xdr_rmtcall_args, &a))
++ if (!svc_getargs(xprt, (xdrproc_t)xdr_rmtcall_args, (caddr_t)&a))
+ return;
+ /* host and service access control */
+ if (!check_callit(svc_getcaller(xprt),
+@@ -614,9 +617,9 @@
+ au->aup_uid, au->aup_gid, au->aup_len, au->aup_gids);
+ }
+ a.rmt_port = (u_long)port;
+- if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a,
+- xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) {
+- svc_sendreply(xprt, xdr_rmtcall_result, (caddr_t)&a);
++ if (clnt_call(client, a.rmt_proc, (xdrproc_t)xdr_opaque_parms, (caddr_t)&a,
++ (xdrproc_t)xdr_len_opaque_parms, (caddr_t)&a, timeout) == RPC_SUCCESS) {
++ svc_sendreply(xprt, (xdrproc_t)xdr_rmtcall_result, (caddr_t)&a);
+ }
+ AUTH_DESTROY(client->cl_auth);
+ clnt_destroy(client);
+
++--------------------------------------------------------------------+
+| Ste'phane ERANIAN | Email eranian@hpl.hp.com |
+| Hewlett-Packard Laboratories | |
+| 1501, Page Mill Road MS 1U-15 | |
+| Palo Alto, CA 94303-096 | |
+| USA | |
+| Tel : (650) 857-7174 | |
+| Fax : (650) 857-5548 | |
++--------------------------------------------------------------------+
+
+
diff --git a/net-nds/portmap/files/portmap-4.0-rpc_user.patch b/net-nds/portmap/files/portmap-4.0-rpc_user.patch
new file mode 100644
index 000000000000..6ef0736d085b
--- /dev/null
+++ b/net-nds/portmap/files/portmap-4.0-rpc_user.patch
@@ -0,0 +1,59 @@
+diff -urN portmap_4/daemon.c portmap_4.new/daemon.c
+--- portmap_4/daemon.c Thu Aug 3 18:07:22 2000
++++ portmap_4.new/daemon.c Fri Aug 4 08:45:25 2000
+@@ -35,6 +35,7 @@
+ static char sccsid[] = "@(#)daemon.c 5.3 (Berkeley) 12/28/90";
+ #endif /* LIBC_SCCS and not lint */
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+diff -urN portmap_4/pmap_check.c portmap_4.new/pmap_check.c
+--- portmap_4/pmap_check.c Thu Aug 3 18:07:22 2000
++++ portmap_4.new/pmap_check.c Thu Aug 3 18:29:51 2000
+@@ -40,6 +40,8 @@
+ #include <rpc/pmap_prot.h>
+ #include <syslog.h>
+ #include <netdb.h>
++#include <pwd.h>
++#include <sys/types.h>
+ #include <sys/signal.h>
+ #ifdef SYSV40
+ #include <netinet/in.h>
+@@ -149,11 +151,32 @@
+ /*
+ * Give up root privileges so that we can never allocate a privileged
+ * port when forwarding an rpc request.
++ *
++ * Fix 8/3/00 Philipp Knirsch: First lookup our rpc user. If we find it,
++ * switch to that uid, otherwise simply resue the old bin user and print
++ * out a warning in syslog.
+ */
+- if (setuid(1) == -1) {
+- syslog(LOG_ERR, "setuid(1) failed: %m");
+- exit(1);
++
++ struct passwd *pwent;
++
++ pwent = getpwnam("rpc");
++ if (pwent == NULL) {
++ syslog(LOG_WARNING, "user rpc not found, reverting to user bin");
++ if (setuid(1) == -1) {
++ syslog(LOG_ERR, "setuid(1) failed: %m");
++ exit(1);
++ }
+ }
++ else {
++ if (setuid(pwent->pw_uid) == -1) {
++ syslog(LOG_WARNING, "setuid() to rpc user failed: %m");
++ if (setuid(1) == -1) {
++ syslog(LOG_ERR, "setuid(1) failed: %m");
++ exit(1);
++ }
++ }
++ }
++
+ (void) signal(SIGINT, toggle_verboselog);
+ }
+
diff --git a/net-nds/portmap/files/portmap-4.0-sigpipe.patch b/net-nds/portmap/files/portmap-4.0-sigpipe.patch
new file mode 100644
index 000000000000..dba7cf4bb15c
--- /dev/null
+++ b/net-nds/portmap/files/portmap-4.0-sigpipe.patch
@@ -0,0 +1,12 @@
+--- portmap_4/portmap.c.sigpipe Sun Feb 11 17:45:11 2001
++++ portmap_4/portmap.c Sun Feb 11 17:45:51 2001
+@@ -228,6 +228,9 @@
+ #else
+ (void)signal(SIGCHLD, reap);
+ #endif
++ /* Dying on SIGPIPE doesn't help anyone */
++ (void)signal(SIGPIPE, SIG_IGN);
++
+ svc_run();
+ syslog(LOG_ERR, "run_svc returned unexpectedly");
+ abort();
diff --git a/net-nds/portmap/portmap-5b-r8.ebuild b/net-nds/portmap/portmap-5b-r8.ebuild
new file mode 100644
index 000000000000..99e448c1952e
--- /dev/null
+++ b/net-nds/portmap/portmap-5b-r8.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nds/portmap/portmap-5b-r8.ebuild,v 1.1 2003/12/26 23:50:58 azarah Exp $
+
+inherit eutils
+
+MY_P="${PN}_${PV}eta"
+S="${WORKDIR}/${MY_P}"
+DESCRIPTION="Netkit - portmapper"
+SRC_URI="ftp://ftp.porcupine.org/pub/security/${MY_P}.tar.gz"
+HOMEPAGE="ftp://ftp.porcupine.org/pub/security/index.html"
+
+SLOT="0"
+LICENSE="as-is"
+KEYWORDS="~x86 ~ppc ~sparc ~mips ~alpha ~arm ~hppa ~amd64 ~ia64 ~ppc64"
+
+DEPEND="virtual/glibc
+ >=sys-apps/tcp-wrappers-7.6-r7"
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ epatch ${FILESDIR}/${PN}_5beta.dif
+
+ # Redhat patches
+ epatch ${FILESDIR}/${PN}-4.0-malloc.patch
+ epatch ${FILESDIR}/${PN}-4.0-cleanup.patch
+ epatch ${FILESDIR}/${PN}-4.0-rpc_user.patch
+ epatch ${FILESDIR}/${PN}-4.0-sigpipe.patch
+
+ # Should include errno.h, and not define as external. Fix
+ # relocation error and build problem with glibc-2.3.2 cvs ...
+ # <azarah@gentoo.org> (31 Dec 2002).
+ epatch ${FILESDIR}/${P}-include-errno_h.patch
+
+ # Get portmap to use our CFLAGS ...
+ sed -e "s:-O2:${CFLAGS}:" -i Makefile || die
+}
+
+src_compile() {
+ make FACILITY=LOG_AUTH \
+ ZOMBIES='-DIGNORE_SIGCHLD' \
+ WRAP_DIR="${ROOT}/lib" \
+ LIBS="-Wl,-Bstatic -lwrap -lutil -Wl,-Bdynamic -lnsl" \
+ AUX= || die
+}
+
+src_install() {
+ into / ; dosbin portmap
+ into /usr ; dosbin pmap_dump pmap_set
+ doman portmap.8 pmap_dump.8 pmap_set.8
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/portmap.rc6 portmap
+
+ # Is this really the sort of thing we wanna be doing? :)
+ # ln -s ../../init.d/portmap ${D}/etc/runlevels/default/portmap
+
+ dodoc BLURB CHANGES README
+}
+