jobcore/nfs-utils/PKGBUILD

149 lines
5.0 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgbase=nfs-utils
pkgdesc="Support programs for Network File Systems - w/o ipv6 gssproxy & systemd "
pkgname=('nfs-utils' 'nfsidmap')
pkgver=2.6.4
pkgrel=01
url='http://nfs.sourceforge.net'
makedepends=('libevent' 'sqlite' 'rpcsvc-proto' 'device-mapper')
# http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=summary
#options=('debug') ### uncomment this to have the debug pkg produced
source=(https://www.kernel.org/pub/linux/utils/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.{xz,sign}
exports
sysusers.d
sha256sums::https://mirrors.edge.kernel.org/pub/linux/utils/nfs-utils/$pkgver/sha256sums.asc)
##
## Note from Joborun: gssproxy since 0.9.0 has become next to impossible to build without systemd-aemon
## So since this is the only pkg dependent on it we opted in rebuilding nfs-utils without gssproxy
##
prepare() {
cd "${pkgbase}"-${pkgver}
# fix hardcoded sbin/libexec path to our needs
sed -i "s|sbindir = /sbin|sbindir = /usr/bin|g" utils/*/Makefile.am
sed -i "s|sbin|bin|" utils/nfsidmap/id_resolver.conf
sed -i "s|libexec|bin|" tools/nfsrahead/99-nfs.rules
autoreconf -vfi
}
build() {
cd "${pkgbase}"-${pkgver}
./configure --prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc \
--libexecdir=/usr/bin \
--with-statedir=/var/lib/nfs \
--with-statdpath=/var/lib/nfs/statd \
--with-start-statd=/usr/bin/start-statd \
--enable-nfsv4server \
--disable-gss \
--without-tcp-wrappers \
--disable-ipv6 \
--enable-libmount-mount \
--enable-mountconfig \
--without-systemd
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
}
check() {
cd "${pkgbase}"-${pkgver}
# make -k check || /bin/true
make check
}
package_nfs-utils() {
pkgdesc="Support programs for Network File Systems - w/o ipv6 & systemd"
license=('GPL2')
backup=(etc/{exports,nfs.conf,nfsmount.conf}
var/lib/nfs/{etab,rmtab})
depends=('rpcbind' 'nfsidmap' 'libevent' 'device-mapper')
optdepends=('sqlite: for nfsdcltrack and fsidd usage'
'python: for rpcctl, nfsiostat, nfsdclnts and mountstats usage')
cd "${pkgbase}"-${pkgver}
make DESTDIR="$pkgdir" install
install -D -m 644 utils/mount/nfsmount.conf "$pkgdir"/etc/nfsmount.conf
install -D -m 644 nfs.conf "$pkgdir"/etc/nfs.conf
install -d -m 755 "$pkgdir"/usr/share/doc/$pkgname
# docs
install -m 644 {NEWS,README} "$pkgdir"/usr/share/doc/$pkgname/
# empty exports file
install -D -m 644 ../exports "$pkgdir"/etc/exports
# config file for idmappers in newer kernels
install -D -m 644 utils/nfsidmap/id_resolver.conf "$pkgdir"/etc/request-key.d/id_resolver.conf
mkdir "$pkgdir"/etc/exports.d
mkdir -m 555 "$pkgdir"/var/lib/nfs/rpc_pipefs
mkdir "$pkgdir"/var/lib/nfs/v4recovery
# systemd sysusers - FS#75536
install -D -m 644 ../sysusers.d "${pkgdir}"/usr/lib/sysusers.d/rpcuser.conf
chown -Rv 34:34 "${pkgdir}"/var/lib/nfs/statd
chmod -R 700 "${pkgdir}"/var/lib/nfs/statd
chmod 644 "${pkgdir}"/var/lib/nfs/statd/state
# nfsidmap cleanup
rm -vrf "$pkgdir"/usr/include #/nfsid*
rm -vrf "$pkgdir"/usr/lib/libnfsidmap*
rm -vrf "$pkgdir"/usr/lib/pkgconfig #/libnfsidmap.pc
rm -v "$pkgdir"/usr/share/man/{man3/nfs4_uid_to_name*,man5/idmapd.conf*}
rm -vrf "$pkgdir"/usr/share/man/man3
}
package_nfsidmap() {
pkgdesc="Library to help mapping IDs, mainly for NFSv4 - w/o ipv6 & systemd"
license=('GPL2')
backup=(etc/idmapd.conf)
depends=('libldap' 'krb5')
cd "${pkgbase}"-${pkgver}
make -C support DESTDIR="$pkgdir" install
# part of -utils pkg
rm -v "$pkgdir"/usr/bin/fsidd
rmdir -v "$pkgdir"/usr/bin
# config file
install -D -m 644 support/nfsidmap/idmapd.conf "$pkgdir"/etc/idmapd.conf
# license
install -Dm644 support/nfsidmap/COPYING $pkgdir/usr/share/licenses/nfsidmap/LICENSE
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=('GPL2')
validpgpkeys=('E1B71E339E20A10A676F7CB69AFB1D681A125177') # Steve Dickson <steved@redhat.com>
## 38d89e853a71d3c560ff026af3d969d75e24f782ff68324e76261fe0344459e1 nfs-utils-2.6.3.tar.xz
# https://mirrors.edge.kernel.org/pub/linux/utils/nfs-utils/2.6.4/sha256sums.asc
sha256sums=(01b3b0fb9c7d0bbabf5114c736542030748c788ec2fd9734744201e9b0a1119d # nfs-utils-2.6.4.tar.xz
f879706266e8463972e36437d729a332db11932d0f05f9a5cce9d15e7aa1c21e # nfs-utils-2.6.4.tar.sign
b8238b74179f7e1626db2b637671ddc17288a1c5b7692954ae6d2fbb1be3788d # exports
8e1b6aa59cf5539b9da13cfec217b3ca7b6c32e08df3b0a204901ed2891b2ded # sysusers.d
0c5e4a749886bc1141e2c38ef6658f855a6162a4eb9ed90d887a2f093a8cd170) # sha256sums
## d1adeafc105c7fc3018d3a9d2f8032ff6b4377267a0c604e67abaa0f89f97f99 nfsidmap-2.6.4-01-x86_64.pkg.tar.lz
## d7b2aea85bf3bab890fba6b8163df27aff72652a91aec659d01cf69651226f7c nfs-utils-2.6.4-01-x86_64.pkg.tar.lz