PKGBUILD 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # Maintainer: Dave Reisner <dreisner@archlinux.org>
  2. # Maintainer: Aaron Griffin <aaron@archlinux.org>
  3. pkgname=shadow
  4. pkgver=4.6
  5. pkgrel=1
  6. pkgdesc="Password and account management tool suite with support for shadow files and PAM"
  7. arch=('x86_64' 'ppc64le')
  8. url='https://github.com/shadow-maint/shadow'
  9. license=('BSD')
  10. groups=('base')
  11. depends=('bash' 'pam' 'acl')
  12. makedepends=('git' 'libxslt' 'docbook-xsl' 'gnome-doc-utils')
  13. backup=(etc/login.defs
  14. etc/pam.d/{chage,passwd,shadow,useradd,usermod,userdel}
  15. etc/pam.d/{chpasswd,newusers,groupadd,groupdel,groupmod}
  16. etc/pam.d/{chgpasswd,groupmems}
  17. etc/default/useradd)
  18. options=(strip debug)
  19. install='shadow.install'
  20. validpgpkeys=('D5C2F9BFCA128BBA22A77218872F702C4D6E25A8') # Christian Perrier
  21. source=("git+https://github.com/shadow-maint/shadow.git#tag=$pkgver"
  22. LICENSE
  23. chgpasswd
  24. chpasswd
  25. defaults.pam
  26. login.defs
  27. newusers
  28. passwd
  29. shadow.{timer,service}
  30. useradd.defaults
  31. xstrdup.patch
  32. shadow-strncpy-usage.patch)
  33. sha1sums=('SKIP'
  34. '33a6cf1e44a1410e5c9726c89e5de68b78f5f922'
  35. '4ad0e059406a305c8640ed30d93c2a1f62c2f4ad'
  36. '12427b1ca92a9b85ca8202239f0d9f50198b818f'
  37. '0e56fed7fc93572c6bf0d8f3b099166558bb46f1'
  38. '81a02eadb5f605fef5c75b6d8a03713a7041864b'
  39. '12427b1ca92a9b85ca8202239f0d9f50198b818f'
  40. '611be25d91c3f8f307c7fe2485d5f781e5dee75f'
  41. 'a154a94b47a3d0c6c287253b98c0d10b861226d0'
  42. 'b5540736f5acbc23b568973eb5645604762db3dd'
  43. 'c173208c5cf34528602f9931468a67b7f68abad3'
  44. '6010fffeed1fc6673ad9875492e1193b1a847b53'
  45. '21e12966a6befb25ec123b403cd9b5c492fe5b16')
  46. pkgver() {
  47. cd "$pkgname"
  48. git describe
  49. }
  50. prepare() {
  51. cd "$pkgname"
  52. # need to offer these upstream
  53. patch -Np1 <"$srcdir/xstrdup.patch"
  54. patch -Np1 <"$srcdir/shadow-strncpy-usage.patch"
  55. autoreconf -v -f --install
  56. # supress etc/pam.d/*, we provide our own
  57. sed -i '/^SUBDIRS/s/pam\.d//' etc/Makefile.in
  58. }
  59. build() {
  60. cd "$pkgname"
  61. ./configure \
  62. LIBS="-lcrypt" \
  63. --prefix=/usr \
  64. --bindir=/usr/bin \
  65. --sbindir=/usr/bin \
  66. --libdir=/usr/lib \
  67. --mandir=/usr/share/man \
  68. --enable-man \
  69. --sysconfdir=/etc \
  70. --with-libpam \
  71. --with-group-name-max-length=32 \
  72. --without-selinux
  73. make
  74. }
  75. package() {
  76. cd "$pkgname"
  77. make DESTDIR="$pkgdir" install
  78. # license
  79. install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/shadow/LICENSE"
  80. # useradd defaults
  81. install -Dm644 "$srcdir/useradd.defaults" "$pkgdir/etc/default/useradd"
  82. # systemd timer
  83. install -D -m644 "$srcdir/shadow.timer" "$pkgdir/usr/lib/systemd/system/shadow.timer"
  84. install -D -m644 "$srcdir/shadow.service" $pkgdir/usr/lib/systemd/system/shadow.service
  85. install -d -m755 "$pkgdir/usr/lib/systemd/system/timers.target.wants"
  86. ln -s ../shadow.timer "$pkgdir/usr/lib/systemd/system/timers.target.wants/shadow.timer"
  87. # login.defs
  88. install -Dm644 "$srcdir/login.defs" "$pkgdir/etc/login.defs"
  89. # PAM config - custom
  90. install -dm755 "$pkgdir/etc/pam.d"
  91. install -t "$pkgdir/etc/pam.d" -m644 "$srcdir"/{passwd,chgpasswd,chpasswd,newusers}
  92. # PAM config - from tarball
  93. install -Dm644 etc/pam.d/groupmems "$pkgdir/etc/pam.d/groupmems"
  94. # we use the 'useradd' PAM file for other similar utilities
  95. for file in chage groupadd groupdel groupmod shadow \
  96. useradd usermod userdel; do
  97. install -Dm644 "$srcdir/defaults.pam" "$pkgdir/etc/pam.d/$file"
  98. done
  99. # Remove evil/broken tools
  100. rm "$pkgdir"/usr/sbin/logoutd
  101. # Remove utilities provided by util-linux
  102. rm \
  103. "$pkgdir"/usr/bin/{login,su,chsh,chfn,sg,nologin} \
  104. "$pkgdir"/usr/sbin/{vipw,vigr}
  105. # but we keep newgrp, as sg is really an alias to it
  106. mv "$pkgdir"/usr/bin/{newgrp,sg}
  107. # ...and their many man pages
  108. find "$pkgdir"/usr/share/man \
  109. '(' -name 'chsh.1' -o \
  110. -name 'chfn.1' -o \
  111. -name 'su.1' -o \
  112. -name 'logoutd.8' -o \
  113. -name 'login.1' -o \
  114. -name 'nologin.8' -o \
  115. -name 'vipw.8' -o \
  116. -name 'vigr.8' -o \
  117. -name 'newgrp.1' ')' \
  118. -delete
  119. rmdir \
  120. "$pkgdir"/usr/share/man/{fi,id,zh_TW}/man1 \
  121. "$pkgdir"/usr/share/man/{fi,ko/man8}
  122. # move everything else to /usr/bin, because this isn't handled by ./configure
  123. mv "$pkgdir"/usr/sbin/* "$pkgdir"/usr/bin
  124. rmdir "$pkgdir/usr/sbin"
  125. }