summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bfc9c0ba281fd7bd637722e44d4f8cba78fb8754 (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
# Maintainer: Christian Muehlhaeuser <muesli at gmail dot com>

pkgname=pam_beacon-git
pkgver=r20.4a0bd5a
pkgrel=1
pkgdesc="PAM module for multi-factor authentication with Bluetooth Devices & Beacons"
arch=('x86_64')
url="https://github.com/muesli/pam-beacon"
license=('MIT')
makedepends=('go' 'git' 'pam')
depends=('pam')
provides=('pam_beacon')
source=('git+https://github.com/muesli/pam-beacon.git')
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/pam-beacon"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$srcdir/pam-beacon"
    GOPATH=`pwd` go get -d -v
}

build() {
    cd "$srcdir/pam-beacon"
    GOPATH=`pwd` make
}

package() {
    cd "$srcdir/pam-beacon"

    # Install binary
    install -Dm755 "pam_beacon.so" "$pkgdir/usr/lib/security/pam_beacon.so"
    # Install PAM config
    install -Dm644 config/pam.d/system-auth-beacon "$pkgdir/etc/pam.d/system-auth-beacon"
    # Copy License
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}