summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 05ae1e2f50fc7a719591c885e4f3d1cbb1235055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Maintainer:  Marcin Wieczorek <marcin@marcin.co>
# Contributor: Mark Crichton <crichton at gmail dot com>
# Contributor: Josh <moc tod liamg ta suoecal>

pkgname=duo_unix
pkgver=1.9.20
pkgrel=1
pkgdesc='Login utility and PAM module for Duo Security two-factor authentication'
arch=('i686' 'x86_64')
url='https://www.duosecurity.com/docs/duounix'
license=('custom:GPL2')
depends=('pam')
install="${pkgname}.install"
backup=('etc/duo/login_duo.conf' 'etc/duo/pam_duo.conf')
source=("https://dl.duosecurity.com/duo_unix-${pkgver}.tar.gz")

# https://www.duosecurity.com/docs/checksums#duounix
sha1sums=('d3d9491b7270fe81d219f087e7cc4a39f9e44a04')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # By default, login_duo is installed setuid root with system-wide config files
  # Using nobody as the privsep user to match the default openssh package
  # More config options here: https://github.com/duosecurity/duo_unix
  ./configure \
      --prefix=/usr \
      --sbindir=/usr/bin \
      --with-pam=/usr/lib/security \
      --with-privsep-user=nobody

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}/" install

  # The license is GPL, but with a couple clarifications/exceptions (link the LICENSE file to /usr/share/licenses)
  # This link won't point to anything if the !docs option is specified
  install -d -m755 "${pkgdir}/usr/share/licenses/${pkgname}"
  ln -s "/usr/share/doc/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}