mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
150 lines
6.3 KiB
Bash
150 lines
6.3 KiB
Bash
# Maintainer: David Runge <dvzrv@archlinux.org>
|
|
# Contributor: Dave Reisner <dreisner@archlinux.org>
|
|
# Contributor: Aaron Griffin <aaron@archlinux.org>
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
# - build with libbsd until toolchain is updated
|
|
|
|
pkgname=shadow
|
|
pkgver=4.14.5
|
|
pkgrel=1
|
|
pkgdesc="Password and account management tool suite with support for shadow files and PAM"
|
|
arch=(x86_64)
|
|
url="https://github.com/shadow-maint/shadow"
|
|
license=(BSD-3-Clause)
|
|
depends=(
|
|
glibc
|
|
libbsd
|
|
)
|
|
makedepends=(
|
|
acl
|
|
attr
|
|
audit
|
|
docbook-xsl
|
|
itstool
|
|
libcap
|
|
libxcrypt
|
|
libxslt
|
|
pam
|
|
)
|
|
backup=(
|
|
etc/default/useradd
|
|
etc/login.defs
|
|
etc/pam.d/chpasswd
|
|
etc/pam.d/groupmems
|
|
etc/pam.d/newusers
|
|
etc/pam.d/passwd
|
|
)
|
|
options=(!emptydirs)
|
|
# NOTE: distribution patches are taken from https://gitlab.archlinux.org/archlinux/packaging/upstream/shadow/-/commits/4.14.5.arch1
|
|
source=(
|
|
$url/releases/download/$pkgver/$pkgname-$pkgver.tar.xz{,.asc}
|
|
0001-Disable-replaced-tools-their-man-pages-and-PAM-integ.patch
|
|
0002-Adapt-login.defs-for-PAM-and-util-linux.patch
|
|
0003-Add-Arch-Linux-defaults-for-login.defs.patch
|
|
shadow.{timer,service}
|
|
shadow.{sysusers,tmpfiles}
|
|
useradd.defaults
|
|
)
|
|
sha512sums=('30de7837874b3ad41d579ffe337a6defa22fbe151fdbf8a32c54f267af1f565c7e06b92d953571482e3b622f98291f08f3155179a23266a3e54df1546b87b156'
|
|
'SKIP'
|
|
'316f5138ae0a78a04c55a9b31929468001d34642f9b03c2085cc7de9899aa949041dcf5a19d891f3bb0c34db02372845fa554b0505cadeff5293de153e2e4083'
|
|
'6586228e329ebdc08645d1989a35cef92899c404d02023c8080378de228ea1bcbe225e1eaf0dbb9564753eb9ab3d257cd643632647cfc98d69a883108a994cb0'
|
|
'bc6bde47387a5d817b94781f5bae2b87b7937b4e2d55a5998f195f184f442e7808efe53519632662dfd9942d206168ae3f44c940bb8d25d17755a7b01a297bb8'
|
|
'e4edf705dd04e088c6b561713eaa1afeb92f42ac13722bff037aede6ac5ad7d4d00828cfb677f7b1ff048db8b6788238c1ab6a71dfcfd3e02ef6cb78ae09a621'
|
|
'2c8689b52029f6aa27d75b8b05b0b36e2fc322cab40fdfbb50cdbe331f61bc84e8db20f012cf9af3de8c4e7fdb10c2d5a4925ca1ba3b70eb5627772b94da84b3'
|
|
'5afac4a96b599b0b8ed7be751e7160037c3beb191629928c6520bfd3f2adcd1c55c31029c92c2ff8543e6cd9e37e2cd515ba4e1789c6d66f9c93b4e7f209ee7a'
|
|
'97a6a57c07502e02669dc1a91bffc447dba7d98d208b798d80e07de0d2fdf9d23264453978d2d3d1ba6652ca1f2e22cdadc4309c7b311e83fa71b00ad144f877'
|
|
'706ba6e7fa8298475f2605a28daffef421c9fa8d269cbd5cbcf7f7cb795b40a24d52c20e8d0b73e29e6cd35cd7226b3e9738dc513703e87dde04c1d24087a69c')
|
|
b2sums=('885d2b23ed670cf26452eb208d561478b7410ffbb04a054feb65efb7da6f1d51eb992da61b72409f8991ee35efd7e7cf7a9bc770edec5f855ace32f82aaa7b55'
|
|
'SKIP'
|
|
'01f5acfd50840ce67a13435400b8d759462fba171d1963bad4e4291005db95b451c18e15dcf8fba4f7d26c764a7a4bdabff8204f6009c51f8ba74093b7daf78b'
|
|
'984f17bffbaa2a973b8dc6cffbe67258272a52df27287dc70e5b5a534b434c796a72fba6985dedec13eeb3ea8d2e213759e0f72170488dc272cd7ac12ba11cc6'
|
|
'ee9b8ce37ea0838f6228f9f709804cda9c2b8adb110601b3e0f9d4bba8aa16c9c14c1feb9003a4f20432c963c247a2e65575acafb1ada0155ee2def01ddd2bf3'
|
|
'5cfc936555aa2b2e15f8830ff83764dad6e11a80e2a102c5f2bd3b7c83db22a5457a3afdd182e3648c9d7d5bca90fa550f59576d0ac47a11a31dfb636cb18f2b'
|
|
'a69191ab966f146c35e7e911e7e57c29fffd54436ea014aa8ffe0dd46aaf57c635d0a652b35916745c75d82b3fca7234366ea5f810b622e94730b45ec86f122c'
|
|
'511c4ad9f3be530dc17dd68f2a3387d748dcdb84192d35f296b88f82442224477e2a74b1841ec3f107b39a5c41c2d961480e396a48d0578f8fd5f65dbe8d9f04'
|
|
'd727923dc6ed02e90ef31f10b3427df50afbfe416bd03c6de0c341857d1bb33ab6168312bd4ba18d19d0653020fb332cbcfeeb24e668ae3916add9d01b89ccb4'
|
|
'f743922062494fe342036b3acb8b747429eb33b1a13aa150daa4bb71a84e9c570cfcc8527a5f846e3ea7020e6f23c0b10d78cf2ba8363eea0224e4c34ea10161')
|
|
validpgpkeys=(
|
|
66D0387DB85D320F8408166DB175CFA98F192AF2 # Serge Hallyn <sergeh@kernel.org>
|
|
A9348594CE31283A826FBDD8D57633D441E25BB5 # Alejandro Colomar <alx@kernel.org>
|
|
)
|
|
|
|
prepare() {
|
|
local filename
|
|
|
|
cd $pkgname-$pkgver
|
|
for filename in "${source[@]}"; do
|
|
if [[ "$filename" =~ \.patch$ ]]; then
|
|
printf "Applying patch %s\n" "${filename##*/}"
|
|
patch -Np1 -i "$srcdir/${filename##*/}"
|
|
fi
|
|
done
|
|
|
|
autoreconf -fiv
|
|
}
|
|
|
|
build() {
|
|
local configure_options=(
|
|
--bindir=/usr/bin
|
|
--disable-account-tools-setuid # no setuid for chgpasswd, chpasswd, groupadd, groupdel, groupmod, newusers, useradd, userdel, usermod
|
|
--enable-man
|
|
--libdir=/usr/lib
|
|
--mandir=/usr/share/man
|
|
--prefix=/usr
|
|
--sbindir=/usr/bin
|
|
--sysconfdir=/etc
|
|
--with-audit
|
|
--with-fcaps # use capabilities instead of setuid for setuidmap and setgidmap
|
|
--without-nscd # we do not ship nscd anymore
|
|
--with-group-name-max-length=32
|
|
--with-yescrypt
|
|
--with-libpam # PAM integration for chpasswd, groupmems, newusers, passwd
|
|
#--without-libbsd # shadow can use internal implementation for getting passphrase
|
|
--without-selinux
|
|
--without-su # su is provided by util-linux
|
|
)
|
|
|
|
cd $pkgname-$pkgver
|
|
# add extra check, preventing accidental deletion of other user's home dirs when using `userdel -r <user with home in />`
|
|
export CFLAGS="$CFLAGS -DEXTRA_CHECK_HOME_DIR"
|
|
./configure "${configure_options[@]}"
|
|
|
|
# prevent excessive overlinking due to libtool
|
|
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
|
|
make
|
|
}
|
|
|
|
package() {
|
|
depends+=(
|
|
acl libacl.so
|
|
attr libattr.so
|
|
audit libaudit.so
|
|
libxcrypt libcrypt.so
|
|
pam libpam.so libpam_misc.so
|
|
)
|
|
|
|
cd $pkgname-$pkgver
|
|
|
|
make DESTDIR="$pkgdir" install
|
|
make DESTDIR="$pkgdir" -C man install
|
|
|
|
# license
|
|
install -vDm 644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname/"
|
|
|
|
# custom useradd(8) defaults (not provided by upstream)
|
|
install -vDm 600 ../useradd.defaults "$pkgdir/etc/default/useradd"
|
|
|
|
# systemd units
|
|
install -vDm 644 ../shadow.timer -t "$pkgdir/usr/lib/systemd/system/"
|
|
install -vDm 644 ../shadow.service -t "$pkgdir/usr/lib/systemd/system/"
|
|
install -vdm 755 "$pkgdir/usr/lib/systemd/system/timers.target.wants"
|
|
ln -s ../shadow.timer "$pkgdir/usr/lib/systemd/system/timers.target.wants/shadow.timer"
|
|
|
|
install -vDm 644 ../$pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
|
|
install -vDm 644 ../$pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
|
|
|
|
# adapt executables to match the modes used by tmpfiles.d, so that pacman does not complain:
|
|
chmod 750 "$pkgdir/usr/bin/groupmems"
|
|
}
|