summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e3b08140cc0db7d6b42ac6535b2b0de229f7fa12 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=sudo-hg
pkgver=r11370.d568dc923c7d
pkgrel=1
pkgdesc="Run commands as root or another user"
arch=('i686' 'x86_64')
url="https://www.sudo.ws/sudo.html"
license=('custom')
depends=('glibc' 'libgcrypt' 'libldap' 'pam')
makedepends=('mercurial')
provides=('sudo')
conflicts=('sudo')
backup=('etc/sudoers' 'etc/pam.d/sudo')
source=("hg+https://www.sudo.ws/repos/sudo/"
        "sudo.pam::https://git.archlinux.org/svntogit/packages.git/plain/trunk/sudo.pam?h=packages/sudo")
sha256sums=('SKIP'
            'SKIP')


pkgver() {
  cd "sudo"

  printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
}

build() {
  cd "sudo"

  ./autogen.sh
  ./configure \
    --prefix="/usr" \
    --sbindir="/usr/bin" \
    --libexecdir="/usr/lib" \
    --with-rundir="/run/sudo" \
    --with-vardir="/var/db/sudo" \
    --enable-gcrypt \
    --with-pam \
    --enable-tmpfiles.d \
    --with-sssd \
    --with-ldap \
    --with-ldap-conf-file="/etc/openldap/ldap.conf" \
    --with-env-editor \
    --with-passprompt="[sudo] password for %p: " \
    --with-all-insults
  make
}

check() {
  cd "sudo"

  make check
}

package() {
  cd "sudo"

  make DESTDIR="$pkgdir" install
  install -Dm644 "doc/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  install -Dm644 "$srcdir/sudo.pam" "$pkgdir/etc/pam.d/sudo"

  # Remove sudoers.dist; not needed since pacman manages updates to sudoers
  rm "$pkgdir/etc/sudoers.dist"

  # Remove /run/sudo directory; we create it using systemd-tmpfiles
  rm -r "$pkgdir/run"
}