1 # Maintainer: Dave Reisner <dreisner@archlinux.org>
2 # Maintainer: Aaron Griffin <aaron@archlinux.org>
7 pkgdesc="Password and account management tool suite with support for shadow files and PAM"
9 url='https://github.com/shadow-maint/shadow'
11 # libcap-ng needed by install scriptlet for 'filecap'
12 depends=('pam' 'acl' 'libacl.so' 'audit' 'libaudit.so' 'libcap-ng' 'libcap-ng.so'
13 'libxcrypt' 'libcrypt.so')
14 backup=(etc/login.defs
15 etc/pam.d/{chage,passwd,shadow,useradd,usermod,userdel}
16 etc/pam.d/{chpasswd,newusers,groupadd,groupdel,groupmod}
17 etc/pam.d/{chgpasswd,groupmems}
20 validpgpkeys=('D5C2F9BFCA128BBA22A77218872F702C4D6E25A8' # Christian Perrier
21 'F1D08DB778185BF784002DFFE9FEEA06A85E3F9D') # Serge Hallyn
22 source=("https://github.com/shadow-maint/shadow/releases/download/$pkgver/shadow-$pkgver.tar.xz"{,.asc}
30 shadow.{timer,service}
32 install=shadow.install
33 sha1sums=('63457a0ba58dc4e81b2663b839dc6c89d3343f12'
35 '33a6cf1e44a1410e5c9726c89e5de68b78f5f922'
36 '4ad0e059406a305c8640ed30d93c2a1f62c2f4ad'
37 '12427b1ca92a9b85ca8202239f0d9f50198b818f'
38 '0e56fed7fc93572c6bf0d8f3b099166558bb46f1'
39 '81a02eadb5f605fef5c75b6d8a03713a7041864b'
40 '12427b1ca92a9b85ca8202239f0d9f50198b818f'
41 '611be25d91c3f8f307c7fe2485d5f781e5dee75f'
42 'a154a94b47a3d0c6c287253b98c0d10b861226d0'
43 'b5540736f5acbc23b568973eb5645604762db3dd'
44 'c173208c5cf34528602f9931468a67b7f68abad3')
55 --mandir=/usr/share/man \
57 --disable-account-tools-setuid \
59 --with-group-name-max-length=32 \
69 make DESTDIR="$pkgdir" install
72 install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/shadow/LICENSE"
75 install -Dm600 "$srcdir/useradd.defaults" "$pkgdir/etc/default/useradd"
78 install -D -m644 "$srcdir/shadow.timer" "$pkgdir/usr/lib/systemd/system/shadow.timer"
79 install -D -m644 "$srcdir/shadow.service" "$pkgdir/usr/lib/systemd/system/shadow.service"
80 install -d -m755 "$pkgdir/usr/lib/systemd/system/timers.target.wants"
81 ln -s ../shadow.timer "$pkgdir/usr/lib/systemd/system/timers.target.wants/shadow.timer"
84 install -Dm644 "$srcdir/login.defs" "$pkgdir/etc/login.defs"
87 rm "$pkgdir/etc/pam.d"/*
88 install -t "$pkgdir/etc/pam.d" -m644 "$srcdir"/{passwd,chgpasswd,chpasswd,newusers}
90 # PAM config - from tarball
91 install -Dm644 etc/pam.d/groupmems "$pkgdir/etc/pam.d/groupmems"
93 # we use the 'useradd' PAM file for other similar utilities
94 for file in chage groupadd groupdel groupmod shadow \
95 useradd usermod userdel; do
96 install -Dm644 "$srcdir/defaults.pam" "$pkgdir/etc/pam.d/$file"
99 # Remove evil/broken tools
100 rm "$pkgdir"/usr/sbin/logoutd
102 # Remove utilities provided by util-linux
104 "$pkgdir"/usr/bin/{login,su,chsh,chfn,sg,nologin} \
105 "$pkgdir"/usr/sbin/{vipw,vigr}
107 # but we keep newgrp, as sg is really an alias to it
108 mv "$pkgdir"/usr/bin/{newgrp,sg}
110 # ...and their many man pages
111 find "$pkgdir"/usr/share/man \
112 '(' -name 'chsh.1' -o \
115 -name 'logoutd.8' -o \
117 -name 'nologin.8' -o \
120 -name 'newgrp.1' ')' \
123 "$pkgdir"/usr/share/man/{fi,id,zh_TW}/man1 \
124 "$pkgdir"/usr/share/man/{fi,ko/man8}
126 # move everything else to /usr/bin, because this isn't handled by ./configure
127 mv "$pkgdir"/usr/sbin/* "$pkgdir"/usr/bin
128 rmdir "$pkgdir/usr/sbin"