python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / shadow / template
bloba1d17ce561f280d0a9b8bb50f2e83c6f6f6b4cde
1 # Template file for 'shadow'
2 pkgname=shadow
3 version=4.6
4 revision=1
5 build_style=gnu-configure
6 configure_args="--bindir=/usr/bin --sbindir=/usr/bin
7  --libdir=/usr/lib --enable-shared --disable-static
8  --with-libpam --without-selinux --with-acl --with-attr
9  --disable-nls --enable-subordinate-ids"
10 hostmakedepends="automake gettext-devel libtool"
11 makedepends="acl-devel pam-devel"
12 depends="pam"
13 short_desc="Shadow password file utilities"
14 maintainer="Juan RP <xtraeme@voidlinux.eu>"
15 license="BSD-3-Clause"
16 homepage="https://github.com/shadow-maint/shadow"
17 distfiles="${homepage}/releases/download/${version}/shadow-${version}.tar.xz"
18 checksum=0998c8d84242a231ab0acb7f8613927ff5bcff095f8aa6b79478893a03f05583
19 conf_files="/etc/pam.d/* /etc/default/* /etc/login.defs"
21 pre_configure() {
22         autoreconf -fi
24         case "$XBPS_TARGET_MACHINE" in
25                 # Completely disable unportable ruserok().
26                 *-musl) sed '/RUSEROK/d' -i configure;;
27         esac
30 do_build() {
31         # Don't install groups(1), we use the one from coreutils.
32         sed -i 's/groups$(EXEEXT) //' src/Makefile
33         for f in $(find man -name Makefile); do
34                 sed -i 's/groups\.1 / /' $f
35         done
36         make ${makejobs}
39 post_install() {
40         mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
42         # Install our pam files not the ones supplied with shadow.
43         rm -f ${DESTDIR}/etc/pam.d/*
44         for f in chage passwd; do
45                 install -m644 ${FILESDIR}/${f}.pam ${DESTDIR}/etc/pam.d/${f}
46         done
47         for f in chpasswd chgpasswd groupadd groupdel groupmems \
48                  groupmod newusers useradd userdel usermod; do
49                 install -m644 $DESTDIR/etc/pam.d/chage $DESTDIR/etc/pam.d/${f}
50         done
51         install -m644 ${FILESDIR}/login.defs ${DESTDIR}/etc
53         # Disable creating mailbox files by default.
54         sed -i -e 's/yes/no/' $DESTDIR/etc/default/useradd
55         # Change default group to the users gid (100).
56         sed -i -e 's/^\(GROUP\)=\(.*\)$/\1=100/' ${DESTDIR}/etc/default/useradd
58         chmod 644 ${DESTDIR}/etc/default/useradd
60         # Install the cron daily job.
61         install -Dm744 ${FILESDIR}/shadow.cron-daily \
62                 ${DESTDIR}/etc/cron.daily/shadow
64         # Remove groups.1 manpage provided by coreutils.
65         rm -f ${DESTDIR}/usr/share/man/man1/groups.1
67         # Remove utilities provided by util-linux and logoutd.
68         mv ${DESTDIR}/usr/bin/{newgrp,sg}
70         rm \
71                 $DESTDIR/usr/bin/{login,su,chsh,chfn} \
72                 $DESTDIR/usr/bin/{nologin,logoutd,vipw,vigr}
74         # ...and their many man pages
75         find $DESTDIR/usr/share/man \
76                 '(' -name 'chsh.1'  -o \
77                 -name 'chfn.1'  -o \
78                 -name 'su.1'    -o \
79                 -name 'login.1' -o \
80                 -name 'vipw.8'  -o \
81                 -name 'vigr.8'  -o \
82                 -name 'logoutd.8' -o \
83                 -name 'nologin.8' -o \
84                 -name 'newgrp.1' ')' \
85                 -delete
87         vlicense $FILESDIR/LICENSE