#!/bin/mkpkg # description: NFS userspace server and client tools # url: https://www.kernel.org/pub/linux/utils/nfs-utils/ name=nfs-utils version=3.1.1 release=2 depends=(libtirpc keyutils libevent libcap2 util-linux sqlite libxml2) makedeps=(rpcsvc-proto bsd-headers libnl) source=(https://www.kernel.org/pub/linux/utils/nfs-utils/$version/$name-$version.tar.xz musl-rpc-compat.c musl-getservbyport.patch musl-includes.patch) sha256sums=( "7dbc05eb8b32828b322872b759a62cb3979cb4118f344dd8616813d1390e84e0" "82e80caa07bb84e2928f55e47bcb256a794218f19866d493e8002e4b3d539d19" "c163225b01417ac8e70ec21bf6c5fb8ceeaecb0e0938f01883d1410f5f776f6b" "d8477a6b7f67167dd36176ee2665640eca7f24ae743581ed7098e0e8051f1ac3" ) patch() { cd $name-$version patch -p1 < $SRC/musl-getservbyport.patch patch -p1 < $SRC/musl-includes.patch sed -i '1i #include ' support/nfs/fh_key_file.c sed -i '/#include /a #include ' support/nfs/getport.c cp $SRC/musl-rpc-compat.c support/nsm/ } build() { cd $name-$version # Build compat stubs so configure finds getrpcbynumber cc $CFLAGS -c support/nsm/musl-rpc-compat.c -o musl-rpc-compat.o ar rcs libmusl-rpc-compat.a musl-rpc-compat.o # lld strictness export LDFLAGS="$LDFLAGS -Wl,--undefined-version" export LIBS="-L$PWD -lmusl-rpc-compat -lsqlite3 -levent_core" ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --sbindir=/usr/sbin \ --disable-gss \ --disable-junction \ --without-systemd \ --without-tcp-wrappers # clang treats K&R empty parens as errors with -Werror=strict-prototypes find . -name Makefile -exec sed -i 's/-Werror[^ ]*//g' {} + make make DESTDIR=$PKG install # Guard: only shuffle if something actually landed in /sbin if [ -d "$PKG/sbin" ] && [ "$(ls -A $PKG/sbin 2>/dev/null)" ]; then mv $PKG/sbin/* $PKG/usr/sbin/ rmdir $PKG/sbin elif [ -d "$PKG/sbin" ]; then rmdir $PKG/sbin fi install -dm755 $PKG/etc/exports.d install -dm755 $PKG/var/lib/nfs/rpc_pipefs install -dm755 $PKG/var/lib/nfs/v4recovery # Default empty exports file install -m644 /dev/null $PKG/etc/exports # Remove man pages for disabled features rm -f $PKG/usr/share/man/man8/rpc.gssd.8 rm -f $PKG/usr/share/man/man8/rpc.svcgssd.8 rm -f $PKG/usr/share/man/man8/blkmapd.8 find $PKG \( -name '*.la' -o -name '*.a' \) -delete } signify() { untrusted comment: public key RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 } # vim: filetype=sh