summaryrefslogtreecommitdiffstats
path: root/abs/core/nfs-utils/PKGBUILD
blob: 2bcce5c9afd425a022807cebfb9b8a3a849aa47f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# $Id$
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>
# Contributor: dibblethewrecker <dibblethewrecker.at.jiwe.org>
# Contributor: abelstr <abel@pinklf.eu>
# Contributor: Marco Lima <cipparello gmail com>

pkgbase=nfs-utils
pkgname=('nfs-utils' 'nfsidmap')
pkgver=2.3.1
pkgrel=1
arch=('x86_64')
url='http://nfs.sourceforge.net'
makedepends=('libevent' 'sqlite')
# http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=summary
source=(https://www.kernel.org/pub/linux/utils/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.{xz,sign}
        id_resolver.conf
        exports)
# https://www.kernel.org/pub/linux/utils/nfs-utils/2.1.1/sha256sums.asc
sha256sums=('96d06b5a86b185815760d8f04c34fdface8fa8b9949ff256ac05c3ebc08335a5'
            'SKIP'
            'ed31ae843cf66d3c262b39ed54533a861876231c5f5bb3811c0c498ac2ffa102'
            '610715ed3daedc43b2536f541c7c57e138fb31eab5d837d9a6187a7403e30154')
validpgpkeys=('E1B71E339E20A10A676F7CB69AFB1D681A125177') # Steve Dickson

prepare() {
  cd ${pkgbase}-${pkgver}

  # fix hardcoded sbin path to our needs
  sed -i "s|sbindir = /sbin|sbindir = /usr/bin|g" utils/*/Makefile.am
  autoreconf -vfi
}

build() {
  cd ${pkgbase}-${pkgver}
  ./configure --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --enable-gss \
    --without-tcp-wrappers \
    --with-statedir=/var/lib/nfs \
    --enable-ipv6 \
    --enable-libmount-mount \
    --enable-mountconfig \
    --with-start-statd=/usr/bin/start-statd
  make 
}

check() {
  cd ${pkgbase}-${pkgver}
  make -k check || /bin/true
}

package_nfs-utils() {

  pkgdesc="Support programs for Network File Systems"
  license=('GPL2')

  backup=(etc/{exports,nfs.conf,nfsmount.conf})
  depends=('rpcbind' 'nfsidmap' 'gssproxy' 'libevent' 'device-mapper')
  optdepends=('sqlite: for nfsdcltrack usage'
              'python: for nfsiostat 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
  
  for i in systemd/{*.service,*.mount,*.target}; do
    install -D -m 644 $i "$pkgdir"/usr/lib/systemd/system/$(basename $i)
  done
  install -d -m 755 "$pkgdir"/usr/share/doc/$pkgname
  install -D -m 644 systemd/README "$pkgdir"/usr/share/doc/$pkgname/README.systemd
  
  # 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 ../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

  # 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 -rf $pkgdir/usr/share/man/man3
}

package_nfsidmap() {

  pkgdesc="Library to help mapping IDs, mainly for NFSv4"
  license=('GPL2')
  backup=(etc/idmapd.conf)
  depends=('libldap')

  cd ${pkgbase}-${pkgver}
  make -C support  DESTDIR="$pkgdir" install
  # 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
}