summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2795884f030f1e5402fa67cba7394740ddb083df (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.11.1
pkgrel=1
pkgdesc='Login utility and PAM module for Duo Security two-factor authentication'
arch=('i686' 'x86_64' 'armv7h')
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=('cb883a975bf0ed668729cc0425fadbc57f0937fe')

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"
}