OCaml 5.0.0 rebuild: Fix Pervasives deprecation
[arch-packages.git] / shadow / trunk / PKGBUILD
blob5f624763134192c36675f91afe376a1649f31b7f
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Contributor: Dave Reisner <dreisner@archlinux.org>
3 # Contributor: Aaron Griffin <aaron@archlinux.org>
5 pkgname=shadow
6 pkgver=4.13
7 pkgrel=2
8 pkgdesc="Password and account management tool suite with support for shadow files and PAM"
9 arch=(x86_64)
10 url="https://github.com/shadow-maint/shadow"
11 license=(BSD)
12 depends=(
13   acl libacl.so
14   attr libattr.so
15   audit libaudit.so
16   glibc
17   libxcrypt libcrypt.so
18   pam libpam.so libpam_misc.so
20 makedepends=(docbook-xsl itstool libcap libxslt)
21 backup=(
22   etc/default/useradd
23   etc/login.defs
24   etc/pam.d/{chage,{,ch,chg}passwd,group{add,del,mems,mod},newusers,shadow,user{add,del,mod}}
26 options=(!emptydirs)
27 # NOTE: distribution patches are taken from https://gitlab.archlinux.org/archlinux/packaging/upstream/shadow/-/commits/v4.13.0.arch1
28 source=(
29   https://github.com/shadow-maint/shadow/releases/download/$pkgver/shadow-$pkgver.tar.xz{,.asc}
30   0001-Disable-replaced-tools-and-man-pages.patch
31   0002-Adapt-login.defs-for-PAM-and-util-linux.patch
32   0003-Add-Arch-Linux-defaults-for-login.defs.patch
33   0004-Add-Arch-Linux-defaults-for-etc-pam.d.patch
34   shadow.{timer,service}
35   useradd.defaults
37 sha512sums=('2949a728c3312bef13d23138d6b79caf402781b1cb179e33b5be546c1790971ec20778d0e9cd3dbe09691d928ffcbe88e60da42fab58c69a90d5ebe5e3e2ab8e'
38             'SKIP'
39             '23215dbc4efa5cb321f32442be30b92f79f1e008c7418ee5daac27540785c1674e790a5e4ee755e9a5a086589be8437e25efbee4a4668918b14337b86309192b'
40             '26160ba1bc42619077dd826fc6e472196e47f4f2e29f9a70d68373a73df9d6187e3a2671369a223e230b05b42af113c38aacf24cd6cb99fbc00b8baca71ab6b7'
41             '3b8bec1dc5dfdc5a3b7b3a4579c05d7fc71ac80c87bdb35031820c2442efcae5dfcc97c763ca9430c1dc3f5d3827dc391999cb67e89d3758d31bdc694dff4601'
42             'fcedd59f0c1294ca03ff2553591058295073e9c795500f66e571e34635016898b999afa816c5994846e459bf743d2c7a358a5be1f561a86a75846df2112194e1'
43             'e4edf705dd04e088c6b561713eaa1afeb92f42ac13722bff037aede6ac5ad7d4d00828cfb677f7b1ff048db8b6788238c1ab6a71dfcfd3e02ef6cb78ae09a621'
44             '79afad34a698444e6971408d353ea7510aa2e3d0b93e096b2ce528748632a76084b4f69b64a97a1fd1d9942ce84165b0b82cfad828c5a5a9dca2e91f82839995'
45             'e9ffea021ee4031b9ad3a534bfb94dbf9d0dfd45a55ecac5dedb2453ea0c17fb80bbb9ad039686bc1f3349dc371977eb548e3a665c56531469c22f29fc4eced8')
46 b2sums=('315ab8a7e598aeefb50c11293e20cfa0982c3c3ae21c35ae243d09a4facf97a13c1d672990876e74ef94f5284402acf14997663743e2aaefa6cfc4369b7d24dc'
47         'SKIP'
48         'e109e09f7709270e6042389f74ee59f44d95c3bd02aa57fedbe27f1e111d36fdb2fc4bb9f837916bfd83ebfa7d1d0859a50d6fefe573da3fd6f849cfd61a0187'
49         '9d3490810bc94c8809442e9e3928fd4dfc62a22e7134ecc63098a1e2ab5db6c64867f6f067641bb7bccf712a7269b67c36434d2ae3ed3e0a206ac66eef299dc9'
50         '92474c0a9cd8bc4df08984a304c73122a9711f1e4c036361e1dcbc027b1e43e007d1e35cdd5db4295829603a097ab360adb66289c4b479a5d5ccee4947f72da7'
51         'aee9aaadae6d49872b4eb98334fbffee7a49b1625b81019927908ac79753364fdac4d87433fcd5d2d2327d7b65eddcfc2edabe7c6a2a67ad7b101ab0bf6deaad'
52         '5cfc936555aa2b2e15f8830ff83764dad6e11a80e2a102c5f2bd3b7c83db22a5457a3afdd182e3648c9d7d5bca90fa550f59576d0ac47a11a31dfb636cb18f2b'
53         '9b8946b14607cbe2f2abb8b616ed50d1ea737687b540f22c4ab451acec30aca86eea3400765dd78e0ab2577b5438a66d91507fc4afc6c0888ac4bc97381dd08d'
54         'd5bea0cfc2e6d3d1749c65440ca911533d41b6f8117fe09e9efec23524637cfa823d230303a7fbb45d3cd251bf8036d48b9b21049ced208f7ed191fcbd75e879')
55 validpgpkeys=(66D0387DB85D320F8408166DB175CFA98F192AF2)  # Serge Hallyn <sergeh@kernel.org>
57 prepare() {
58   local filename
60   cd $pkgname-$pkgver
61   for filename in "${source[@]}"; do
62     if [[ "$filename" =~ \.patch$ ]]; then
63       printf "Applying patch %s\n" "${filename##*/}"
64       patch -Np1 -i "$srcdir/${filename##*/}"
65     fi
66   done
68   autoreconf -fiv
71 build() {
72   local configure_options=(
73     --prefix=/usr
74     --bindir=/usr/bin
75     --sbindir=/usr/bin
76     --libdir=/usr/lib
77     --mandir=/usr/share/man
78     --sysconfdir=/etc
79     --disable-account-tools-setuid
80     --enable-man
81     --with-fcaps
82     --with-libpam
83     --with-group-name-max-length=32
84     --with-audit
85     --with-bcrypt
86     --with-yescrypt
87     --without-selinux
88     --without-su
89   )
91   cd $pkgname-$pkgver
92   ./configure "${configure_options[@]}"
94   # prevent excessive overlinking due to libtool
95   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
96   make
99 package() {
100   cd $pkgname-$pkgver
102   make DESTDIR="$pkgdir" install
103   make DESTDIR="$pkgdir" -C man install
105   # license
106   install -vDm 644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname/"
108   # custom useradd(8) defaults (not provided by upstream)
109   install -vDm 600 ../useradd.defaults "$pkgdir/etc/default/useradd"
111   # systemd units
112   install -vDm 644 ../shadow.timer -t "$pkgdir/usr/lib/systemd/system/"
113   install -vDm 644 ../shadow.service -t "$pkgdir/usr/lib/systemd/system/"
114   install -vdm 755 "$pkgdir/usr/lib/systemd/system/timers.target.wants"
115   ln -s ../shadow.timer "$pkgdir/usr/lib/systemd/system/timers.target.wants/shadow.timer"