# # Chakra Packages for Chakra, part of chakraos.org # # maintainer almack[at]chakraos[dog]org> # contributor abveritas[at]chakra-project[dog]org> # contributor Manuel Tortosa pkgname=shadow pkgver=4.1.5.1 pkgrel=3 pkgdesc="Password and account management tool suite with support for shadow files and PAM" arch=('x86_64') url='http://pkg-shadow.alioth.debian.org/' license=('BSD') groups=('base') depends=('bash' 'pam' 'acl') backup=(etc/login.defs etc/pam.d/{chage,passwd,shadow,useradd,usermod,userdel} etc/pam.d/{chpasswd,newusers,groupadd,groupdel,groupmod} etc/pam.d/{chgpasswd,groupmems} etc/default/useradd) options=(strip debug) install='shadow.install' source=("http://fossies.org/linux/misc/shadow_4.1.5.1.orig.tar.gz" #"http://cdn.debian.net/debian/pool/main/s/shadow//shadow_4.1.5.1.orig.tar.gz" #"http://cdn.debian.net/debian/pool/main/s/$pkgname//$pkgname_$pkgver.orig.tar.gz" LICENSE chgpasswd chpasswd defaults.pam login.defs newusers passwd shadow.{timer,service} useradd.defaults xstrdup.patch shadow-strncpy-usage.patch) sha1sums=('6e4de75de58405d21b0377b926ae770afccd95bc' '7ab316761036787c0cfcb53b7a6e82da7c373123' '4ad0e059406a305c8640ed30d93c2a1f62c2f4ad' '87186f6e5e00d195cafba5e38400418481dce3af' '0e56fed7fc93572c6bf0d8f3b099166558bb46f1' 'e5cab2118ecb1e61874cde842d7d04d1003f35cb' '12427b1ca92a9b85ca8202239f0d9f50198b818f' '9f9bfe1168c234d5f7a6131a4f76c3fc6360fd8a' 'a154a94b47a3d0c6c287253b98c0d10b861226d0' '4fb696c722ed59e74a98a682a4f780bf9f1cf031' '80e3d2ee8c990c2f7fbd0dcf406a9e41cbe66fe2' '6010fffeed1fc6673ad9875492e1193b1a847b53' '3bc0e0968ddec0e58b1e2de88d9d0065c93d60c9') build() { cd "$pkgname-$pkgver" # avoid transitive linking issues with binutils 2.22 sed -i '/^user\(mod\|add\)_LDADD/s|$| -lattr|' src/Makefile.am # link to glibc's crypt(3) export LIBS="-lcrypt" # need to offer these upstream patch -p1 <"$srcdir/xstrdup.patch" patch -p1 <"$srcdir/shadow-strncpy-usage.patch" # supress etc/pam.d/*, we provide our own sed -i '/^SUBDIRS/s/pam.d//' etc/Makefile.in ./configure \ --prefix=/usr \ --libdir=/lib \ --mandir=/usr/share/man \ --sysconfdir=/etc \ --with-libpam \ --without-selinux \ --with-group-name-max-length=32 make } package() { cd "$pkgname-$pkgver" make DESTDIR="$pkgdir" install # license install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/shadow/LICENSE" # useradd defaults install -Dm644 "$srcdir/useradd.defaults" "$pkgdir/etc/default/useradd" # systemd timer install -D -m644 ${srcdir}/shadow.timer ${pkgdir}/usr/lib/systemd/system/shadow.timer install -D -m644 ${srcdir}/shadow.service ${pkgdir}/usr/lib/systemd/system/shadow.service install -d -m755 ${pkgdir}/usr/lib/systemd/system/multi-user.target.wants ln -s ../shadow.timer ${pkgdir}/usr/lib/systemd/system/multi-user.target.wants/shadow.timer # login.defs install -Dm644 "$srcdir/login.defs" "$pkgdir/etc/login.defs" # PAM config - custom install -dm755 "$pkgdir/etc/pam.d" install -t "$pkgdir/etc/pam.d" -m644 "$srcdir"/{passwd,chgpasswd,chpasswd,newusers} # PAM config - from tarball install -Dm644 etc/pam.d/groupmems "$pkgdir/etc/pam.d/groupmems" # we use the 'useradd' PAM file for other similar utilities for file in chage groupadd groupdel groupmod shadow \ useradd usermod userdel; do install -Dm644 "$srcdir/defaults.pam" "$pkgdir/etc/pam.d/$file" done # Remove utilities provided by util-linux rm \ "$pkgdir"/usr/bin/{chsh,chfn,sg} \ "$pkgdir"/bin/{login,su} \ "$pkgdir"/usr/sbin/{vipw,vigr,logoutd} \ "$pkgdir"/sbin/nologin # but we keep newgrp, as sg is really an alias to it mv "$pkgdir"/usr/bin/{newgrp,sg} # ...and their many man pages find "$pkgdir"/usr/share/man \ '(' -name 'chsh.1' -o \ -name 'chfn.1' -o \ -name 'su.1' -o \ -name 'login.1' -o \ -name 'vipw.8' -o \ -name 'vigr.8' -o \ -name 'nologin.8' -o \ -name 'newgrp.1' ')' \ -delete rmdir \ "$pkgdir"/usr/share/man/{fi,id,zh_TW}/man1 \ "$pkgdir"/usr/share/man/{fi,ko/man8} }