summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3adfdca63b30fa6659325b02918e6041fd1ac6e3 (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
# Maintainer: Morgenstern <charles [at] charlesbwise [dot] com>
# Contributor: Philip Abernethy <chais.z3r0@gmail.com>

pkgname=roundcubemail-plugin-twofactor-git
pkgver=r210.19552fc
pkgrel=1
pkgdesc="Adds two-step verification (TOTP) to the Roundcube login process"
url="https://github.com/alexandregz/twofactor_gauthenticator"
arch=('any')
license=('MIT')
depends=('roundcubemail>=0.9.5')
makedepends=('git')
replaces=('roundcube-twofactor-git')
install="${pkgname}.install"
source=("${pkgname}::git+https://github.com/alexandregz/twofactor_gauthenticator.git")
sha512sums=('SKIP')

pkgver() {
  cd "${pkgname}"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

package() {
  _instdir="${pkgdir}"/usr/share/webapps/roundcubemail/plugins/twofactor_gauthenticator
  install -d "${_instdir}"/{localization,PHPGangsta}
  cd "${pkgname}"
  find . -type f -name '*php*' -exec install -m644 {} "${_instdir}"/{} \;
  find . -type f -name '*js*' -exec install -m644 {} "${_instdir}"/{} \;
  find . -type f -name '*inc' -exec install -m644 {} "${_instdir}"/{} \;
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
}