diff options
Diffstat (limited to 'opt/rpcbind/MAKEPKG')
| -rw-r--r-- | opt/rpcbind/MAKEPKG | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/opt/rpcbind/MAKEPKG b/opt/rpcbind/MAKEPKG new file mode 100644 index 0000000..3af1794 --- /dev/null +++ b/opt/rpcbind/MAKEPKG @@ -0,0 +1,81 @@ +#!/bin/mkpkg +# description: RPC program number to address mapper +# url: https://sourceforge.net/projects/rpcbind/ +name=rpcbind +version=1.3.1 +release=1 +depends=(libtirpc) +makedeps=(bsd-headers) +services=(rpcbind) +source=(https://downloads.sourceforge.net/$name/$name-$version.tar.bz2 + musl-sunrpc.patch + rpcbind-sunrpc.patch + musl-rpc-compat.c) +sha256sums=( + "8e551b445f5172f8ef218845af342fb2a2d741b57ce8c777c781a01ea92f92a5" + "8852c055fa257113d3df3525a5600e6f02f4eacba29cf98a8c0c714e4551cfc9" + "d0fdffce3e55d1d2170647e1a0949df579d20ff5dbbdcab0df353d7d71a87370" + "82e80caa07bb84e2928f55e47bcb256a794218f19866d493e8002e4b3d539d19" +) + +patch() { + cd $name-$version + + # musl getaddrinfo does not support service name aliases; + # use "sunrpc" (canonical /etc/services entry) instead of + # "rpcbind" and "portmapper" + patch -p1 < $SRC/rpcbind-sunrpc.patch + patch -p1 < $SRC/musl-sunrpc.patch + + # musl lacks getrpcbynumber/getrpcbyname (glibc NSS functions) + # Stub in security.c directly (only used for logging) + sed -i '1i struct rpcent *getrpcbynumber(int __number) { return 0; }' src/security.c +} + +build() { + cd $name-$version + + # Build compat stubs as static lib and inject + cc $CFLAGS -c $SRC/musl-rpc-compat.c -o musl-rpc-compat.o + ar rcs libmusl-rpc-compat.a musl-rpc-compat.o + + ./configure \ + --prefix=/usr \ + --bindir=/usr/sbin \ + --with-rpcuser=root \ + --enable-warmstarts \ + --without-systemdsystemunitdir + + sed -i "s|^LIBS = |LIBS = -L$PWD -lmusl-rpc-compat |" Makefile + + make + make DESTDIR=$PKG install + + install -dm755 $PKG/var/lib/rpcbind +} + +post_build() { + # runit service + install -d $PKG/etc/sv/rpcbind/log + + printf '%s\n' \ + '#!/bin/sh' \ + 'exec 2>&1' \ + 'exec rpcbind -f -w 2>&1' \ + > $PKG/etc/sv/rpcbind/run + + printf '%s\n' \ + '#!/bin/sh' \ + 'mkdir -p /var/log/rpcbind' \ + 'exec svlogd -tt /var/log/rpcbind' \ + > $PKG/etc/sv/rpcbind/log/run + + chmod 755 $PKG/etc/sv/rpcbind/run + chmod 755 $PKG/etc/sv/rpcbind/log/run +} + +signify() { + untrusted comment: public key + RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 +} +# vim: filetype=sh |
