jobcore/shadow/PKGBUILD

142 lines
4.8 KiB
Text
Raw Normal View History

2022-03-20 13:19:37 +01:00
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
2022-07-16 20:42:37 +02:00
# Maintainer : Joe Bo Run <joborun@disroot.org>
2022-03-20 13:19:37 +01:00
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
2022-07-16 20:42:37 +02:00
# Website : https://pozol.eu
2022-03-20 13:19:37 +01:00
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=shadow
2023-10-30 11:42:15 +01:00
pkgver=4.14.2
2023-10-27 00:33:29 +02:00
pkgrel=01
2022-03-20 13:19:37 +01:00
pkgdesc="Password and account management tool suite with support for shadow files and PAM w/o systemd"
url='https://github.com/shadow-maint/shadow'
2022-11-15 16:49:16 +01:00
depends=(
acl libacl.so
attr libattr.so
audit libaudit.so
glibc
libxcrypt libcrypt.so
pam libpam.so libpam_misc.so
)
makedepends=(docbook-xsl itstool libcap libxslt)
backup=(
etc/default/useradd
etc/login.defs
2023-09-18 18:23:32 +02:00
etc/pam.d/chpasswd
etc/pam.d/groupmems
etc/pam.d/newusers
etc/pam.d/passwd
# {chage,{,ch,chg}passwd,group{add,del,mems,mod},newusers,shadow,user{add,del,mod}}
2022-11-15 16:49:16 +01:00
)
#options=(debug !emptydirs)
2022-10-19 21:26:20 +02:00
options=('!emptydirs')
2023-10-30 11:42:15 +01:00
# NOTE: distribution patches are taken from https://gitlab.archlinux.org/archlinux/packaging/upstream/shadow/-/commits/v4.14.2.arch1
2022-11-15 16:49:16 +01:00
source=(
https://github.com/shadow-maint/shadow/releases/download/$pkgver/shadow-$pkgver.tar.xz{,.asc}
2023-10-27 00:33:29 +02:00
0001-Disable-replaced-tools-their-man-pages-and-PAM-integ.patch
2022-11-15 16:49:16 +01:00
0002-Adapt-login.defs-for-PAM-and-util-linux.patch
0003-Add-Arch-Linux-defaults-for-login.defs.patch
2023-09-18 18:23:32 +02:00
# 0004-Add-Arch-Linux-defaults-for-etc-pam.d.patch
2022-11-15 16:49:16 +01:00
# chgpasswd
# chpasswd
# defaults.pam
# login.defs
# newusers
# passwd
2023-09-18 18:23:32 +02:00
shadow.{sysusers,tmpfiles}
2022-11-15 16:49:16 +01:00
useradd.defaults
)
# install=shadow.install
2022-03-20 13:19:37 +01:00
2022-10-19 21:26:20 +02:00
prepare() {
2022-11-15 16:49:16 +01:00
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
2022-10-19 21:26:20 +02:00
}
2022-03-20 13:19:37 +01:00
build() {
2022-11-15 16:49:16 +01:00
local configure_options=(
--prefix=/usr
--bindir=/usr/bin
--sbindir=/usr/bin
2023-09-18 18:23:32 +02:00
--disable-account-tools-setuid # no setuid for chgpasswd, chpasswd, groupadd, groupdel, groupmod, newusers, useradd, userdel, usermod
--enable-man
2022-11-15 16:49:16 +01:00
--libdir=/usr/lib
--mandir=/usr/share/man
--sysconfdir=/etc
--with-audit
2023-09-18 18:23:32 +02:00
--with-fcaps # use capabilities instead of setuid for setuidmap and setgidmap
--with-group-name-max-length=32
2023-10-27 00:33:29 +02:00
--with-yescrypt
2023-09-18 18:23:32 +02:00
--with-libpam # PAM integration for chpasswd, groupmems, newusers, passwd
--without-libbsd # shadow can use internal implementation for getting passphrase
2023-09-24 23:22:18 +02:00
--without-nscd # we do not ship nscd anymore
2022-11-15 16:49:16 +01:00
--without-selinux
2022-03-20 13:19:37 +01:00
--without-su
2023-09-18 18:23:32 +02:00
--without-systemd
)
2023-09-24 23:22:18 +02:00
2022-11-15 16:49:16 +01:00
cd $pkgname-$pkgver
2023-09-18 18:23:32 +02:00
# 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"
2022-11-15 16:49:16 +01:00
./configure "${configure_options[@]}"
2022-03-20 13:19:37 +01:00
2022-10-19 21:26:20 +02:00
# prevent excessive overlinking due to libtool
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
2022-03-20 13:19:37 +01:00
make
}
package() {
2022-11-15 16:49:16 +01:00
cd $pkgname-$pkgver
2022-03-20 13:19:37 +01:00
make DESTDIR="$pkgdir" install
make DESTDIR="$pkgdir" -C man install
# license
2022-11-15 16:49:16 +01:00
install -vDm 644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname/"
2022-03-20 13:19:37 +01:00
2022-10-19 21:26:20 +02:00
# custom useradd(8) defaults (not provided by upstream)
2022-11-15 16:49:16 +01:00
install -vDm 600 ../useradd.defaults "$pkgdir/etc/default/useradd"
2022-03-20 13:19:37 +01:00
2023-09-18 18:23:32 +02:00
install -vDm 644 ../$pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
install -vDm 644 ../$pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
2023-09-24 23:22:18 +02:00
# adapt executables to match the modes used by tmpfiles.d, so that pacman does not complain:
chmod 750 "$pkgdir/usr/bin/groupmems"
2023-09-18 18:23:32 +02:00
# manually add PAM config for chpasswd and newusers: https://github.com/shadow-maint/shadow/issues/810
install -vDm 644 etc/pam.d/{chpasswd,newusers} -t "$pkgdir/etc/pam.d/"
2022-03-20 13:19:37 +01:00
}
2023-09-03 02:54:51 +02:00
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
2022-07-16 20:42:37 +02:00
2023-09-18 18:23:32 +02:00
license=(BSD-3-Clause)
2022-03-20 13:19:37 +01:00
2023-10-27 00:33:29 +02:00
validpgpkeys=(66D0387DB85D320F8408166DB175CFA98F192AF2 # Serge Hallyn <sergeh@kernel.org>
A9348594CE31283A826FBDD8D57633D441E25BB5) # Alejandro Colomar <alx@kernel.org>
2022-11-15 16:49:16 +01:00
2023-10-30 11:42:15 +01:00
sha256sums=(25df30589d2e31aaff14576d03f980bb578e6d446891da6d24de1e5a09a38949 # shadow-4.14.2.tar.xz
133f8582c7412786a2f2cec49e3467927521180078f5fce74050b4f003e7865a # shadow-4.14.2.tar.xz.asc
aa550468fa977633fbe5ccf11c7a942dfc6d84b4a6a9b2a5ce62795e3a094629 # 0001-Disable-replaced-tools-their-man-pages-and-PAM-integ.patch
71bb78cb8f4ce2a1c73594936a3e540427b5b1f496d2dc459a086c8f64509c49 # 0002-Adapt-login.defs-for-PAM-and-util-linux.patch
9e3630d535faf1576dab4d5e534dd59fcc7988aa34062553b5f41da4709ca356 # 0003-Add-Arch-Linux-defaults-for-login.defs.patch
2023-09-18 18:23:32 +02:00
29448220f2ecfeab0a1a7aae296f07ca522d0a75a5b20df30f83950f9d54531f # shadow.sysusers
2023-09-24 23:22:18 +02:00
c2faa81b894de452e6cd23660ad7e30a4e03d6a4eacb94ff209c6e578df05e61 # shadow.tmpfiles
2023-09-19 01:33:08 +02:00
2d4b7b85ea1d5cddf93c2d636a11b0e76c1f484474449bdb018e3af0fcbd93c3) # useradd.defaults
2023-10-30 11:42:15 +01:00
## e2ba753000b243bd940bf07de8c309463ec52314897920eda5fde1769d3eaa67 shadow-4.14.2-01-x86_64.pkg.tar.lz
2023-10-27 00:33:29 +02:00