summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 02a0ddbf9a5bf7d9c16826eb07e16969f5ba31fb (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
# Maintainer: Dylan Cali <calid1984@gmail.com>

pkgname='google-authenticator-libpam-git'
pkgver=20120505
pkgrel=1
pkgdesc='PAM module for google authenticator app'
arch=('any')
url="https://code.google.com/p/google-authenticator/"
license=('APACHE')
depends=('pam')
makedepends=('git')
optdepends=('qrencode: scannable QR codes for google auth phone app')
provides=('google-authenticator-libpam')
conflicts=('google-authenticator-libpam')

_gitrepo='google-authenticator'
_gitbuild="${_gitrepo}-build"

build() {

    msg "Checking out latest source from $url"

    if [ -d "$_gitrepo" ]
    then
        cd "$_gitrepo" && git pull
        cd "$srcdir"
    else
        # google code doesn't support shallow clones (yet)
        git clone https://code.google.com/p/google-authenticator/
    fi

    rm -rf "$_gitbuild"
    mkdir  "$_gitbuild"

    cd "$_gitrepo"
    find -mindepth 1 -maxdepth 1 -not -name '.git*' -print0 \
        | xargs -0 cp -rt "../$_gitbuild"

    cd "../$_gitbuild/libpam"
    make
}

package() {
  cd "$srcdir/$_gitbuild/libpam"
  install -D -m755 pam_google_authenticator.so "$pkgdir/usr/lib/security/pam_google_authenticator.so"
  install -D -m755 google-authenticator "$pkgdir/usr/bin/google-authenticator"
}