summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10712f1f2971fa379918670f80fb8c87305531f7 (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
# Maintainer: dszryan
pkgname=pacmanity-git
pkgver=3.0.1
pkgrel=5
epoch=1
pkgdesc="Keeps a list of installed packages in a Gist at your GitHub account"
arch=('x86_64' 'i686')
url="https://github.com/DerekTBrown/${pkgname/-git/}"
license=('GPL')
#groups=('ALPM' 'Backup' 'gist' 'pacman')
depends=('pacman>=5.0' 'gist>=4.5.0')
makedepends=('git')
conflicts=('pacmanity')
source=("${pkgname/-git/}::git+https://github.com/DerekTBrown/${pkgname/-git/}.git#branch=master")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgname/-git/}"
  git describe --all --exact-match `git rev-parse HEAD` | sed "s|tags/||g"
}

package() {
  # install
  mkdir -p "$pkgdir/etc" "$pkgdir/usr/lib/pacmanity" "$pkgdir/usr/share/libalpm/hooks"
  install -m774 "$srcdir/${pkgname/-git/}/src/pacmanity.sh"   "$pkgdir/usr/lib/pacmanity/pacmanity.sh"
  install -m664 "$srcdir/${pkgname/-git/}/src/pacmanity.hook" "$pkgdir/usr/share/libalpm/hooks/zzz-pacmanity.hook"

  # run
  . $pkgdir/usr/lib/pacmanity/pacmanity.sh
  if [[ -f "/etc/pacmanity" ]]; then # if file is present, assume it is maanged externally (via a build system)
    GIST_ID=$(sed "s|GIST_ID=||g" /etc/pacmanity) pacmanity_update
  else
    pacmanity_install
  fi
}