summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 61a4707eae3fe48eadcbf33bf9e9ddf52af0b9a6 (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
pkgname=pacaur-git
pkgver=4.7.8
pkgrel=1
pkgdesc="An AUR helper that minimizes user interaction"
arch=('any')
url="https://github.com/rmarquis/pacaur"
license=('ISC')
depends=('cower' 'expac' 'sudo' 'git')
makedepends=('perl')
provides=('pacaur')
conflicts=('pacaur')
backup=('etc/xdg/pacaur/config')
source=("git://github.com/rmarquis/pacaur.git")
md5sums=('SKIP')
_gitname="pacaur"

pkgver() {
  cd "$srcdir/$_gitname"
  echo $(git describe --always | sed 's/-/./g')
}

prepare() {
  cd "$srcdir/$_gitname"
  _pkgver=$(git describe --always | sed 's/-/./g')
  sed -i "s/version=\"[0-9].[0-9].[0-9]*\"/version=\"$_pkgver\"/g" ./pacaur
}

build() {
  cd "$srcdir/$_gitname"
  pod2man --utf8 --section=8 --center="Pacaur Manual" --name="PACAUR" --release="$pkgname $pkgver" ./README.pod > pacaur.8
}

package() {
  cd "$srcdir/$_gitname"

  mkdir -p "$pkgdir/etc/xdg/pacaur"
  install -D -m644 ./config "$pkgdir/etc/xdg/pacaur/config"
  mkdir -p "$pkgdir/usr/bin"
  install -D -m755 ./pacaur "$pkgdir/usr/bin/pacaur"
  mkdir -p "$pkgdir/usr/share/bash-completion/completions"
  install -D -m644 ./bash.completion "$pkgdir/usr/share/bash-completion/completions/pacaur"
  mkdir -p "$pkgdir/usr/share/zsh/site-functions"
  install -D -m644 ./zsh.completion "$pkgdir/usr/share/zsh/site-functions/_pacaur"
  mkdir -p "$pkgdir/usr/share/man/man8"
  install -D -m644 ./pacaur.8 "$pkgdir/usr/share/man/man8/pacaur.8"
  mkdir -p "$pkgdir/usr/share/licenses/pacaur"
  install -D -m644 ./LICENSE "$pkgdir/usr/share/licenses/pacaur/LICENSE"
  for i in {ca,da,de,es,fi,fr,hu,it,ja,nb,nl,pl,pt,ru,sk,sl,sr,sr@latin,tr,zh_CN}; do
    mkdir -p "$pkgdir/usr/share/locale/$i/LC_MESSAGES/"
    msgfmt ./po/$i.po -o "$pkgdir/usr/share/locale/$i/LC_MESSAGES/pacaur.mo"
  done
}