summaryrefslogtreecommitdiff
path: root/main/portmap
diff options
context:
space:
mode:
Diffstat (limited to 'main/portmap')
-rw-r--r--main/portmap/APKBUILD39
-rw-r--r--main/portmap/portmap-6.0-tcpd.patch18
-rw-r--r--main/portmap/portmap.confd5
-rw-r--r--main/portmap/portmap.initd46
-rw-r--r--main/portmap/portmap.pre-install3
5 files changed, 111 insertions, 0 deletions
diff --git a/main/portmap/APKBUILD b/main/portmap/APKBUILD
new file mode 100644
index 00000000000..7539f314aa7
--- /dev/null
+++ b/main/portmap/APKBUILD
@@ -0,0 +1,39 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=portmap
+pkgver=6.0
+pkgrel=2
+pkgdesc="RPC connection manager"
+url="http://neil.brown.name/portmap/"
+license="GPL"
+depends="uclibc"
+makedepends=""
+install="$pkgname.pre-install"
+subpackages="$pkgname-doc"
+source="http://neil.brown.name/$pkgname/$pkgname-$pkgver.tgz
+ $pkgname-6.0-tcpd.patch
+ $install
+ $pkgname.confd
+ $pkgname.initd"
+
+build ()
+{
+ cd "$srcdir"/portmap_$pkgver
+ for i in ../*.patch; do
+ msg "Applying $i"
+ patch -p1 < $i || return 1
+ done
+
+ make NO_TCP_WRAPPER=NO || return 1
+ mkdir -p "$pkgdir"/sbin
+ mkdir -p "$pkgdir"/usr/share/man/man8
+ make BASEDIR="$pkgdir" install
+ mkdir -p "$pkgdir"/etc/init.d "$pkgdir"/etc/conf.d
+ install -m 755 "$startdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname
+ install -m 644 "$startdir"/$pkgname.confd $pkgdir/etc/conf.d/$pkgname
+}
+
+md5sums="ac108ab68bf0f34477f8317791aaf1ff portmap-6.0.tgz
+bdcd217a0d459c75116d0b5aa90a372b portmap-6.0-tcpd.patch
+b726a64e91b47244a7539288338c6bbd portmap.pre-install
+56b0f47cda2003f3394ef7c37ec4cdff portmap.confd
+2944aa0387aba4ed6219d7856e5e8fb0 portmap.initd"
diff --git a/main/portmap/portmap-6.0-tcpd.patch b/main/portmap/portmap-6.0-tcpd.patch
new file mode 100644
index 00000000000..c6af8f8c80b
--- /dev/null
+++ b/main/portmap/portmap-6.0-tcpd.patch
@@ -0,0 +1,18 @@
+Enable compile without tcp-wrappers
+
+Patch by Timothy Redaelli <drizzt@gentoo.org>
+
+http://bugs.gentoo.org/178242
+
+--- portmap_6.0/pmap_check.c
++++ portmap_6.0/pmap_check.c
+@@ -44,7 +44,9 @@
+ #include <netinet/in.h>
+ #include <rpc/rpcent.h>
+ #endif
++#ifdef HOSTS_ACCESS
+ #include <tcpd.h>
++#endif
+ #include <arpa/inet.h>
+ #include <grp.h>
+
diff --git a/main/portmap/portmap.confd b/main/portmap/portmap.confd
new file mode 100644
index 00000000000..c2756c992b4
--- /dev/null
+++ b/main/portmap/portmap.confd
@@ -0,0 +1,5 @@
+# /etc/conf.d/portmap: config file for /etc/init.d/portmap
+
+# Options for `portmap`.
+# For a full list, just run `portmap -h`.
+#PORTMAP_OPTS="-l"
diff --git a/main/portmap/portmap.initd b/main/portmap/portmap.initd
new file mode 100644
index 00000000000..65d23d74849
--- /dev/null
+++ b/main/portmap/portmap.initd
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nds/portmap/files/portmap.rc6,v 1.12 2007/06/13 07:52:44 vapier Exp $
+
+depend() {
+ use net
+ before inetd
+ before xinetd
+}
+
+start() {
+ ebegin "Starting portmap"
+ start-stop-daemon --start --quiet --exec /sbin/portmap -- ${PORTMAP_OPTS}
+ local ret=$?
+ eend ${ret}
+ # without, if a service depending on portmap is started too fast,
+ # connecting to portmap will fail -- azarah
+ sleep 1
+ return ${ret}
+}
+
+stop() {
+ ebegin "Stopping portmap"
+ start-stop-daemon --stop --quiet --exec /sbin/portmap
+ eend $?
+}
+
+restart() {
+ # Dump the portmapper's table before stopping
+ ebegin "Saving portmap table"
+ local pmap=$(pmap_dump)
+ eend $?
+
+ # Stop and restart portmapper
+ svc_stop
+ sleep 1
+ svc_start
+
+ # Reload the portmapper's table
+ if [ -n "${pmap}" ] ; then
+ ebegin "Reloading portmap table"
+ echo "${pmap}" | pmap_set
+ eend $?
+ fi
+}
diff --git a/main/portmap/portmap.pre-install b/main/portmap/portmap.pre-install
new file mode 100644
index 00000000000..b0dcfb9c5c1
--- /dev/null
+++ b/main/portmap/portmap.pre-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+adduser -h /dev/null -s /bin/false -D rpc 2>/dev/null || true