aboutsummaryrefslogtreecommitdiffstats
path: root/build/gen_pkgbuild.sh
blob: d1e2d268ccf889f0264612c172e163f7d2da0c0a (plain) (blame)
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
#!/bin/bash -

(
cat << 'EOF'
# Maintainer: Benawi Adha <benawiadha@gmail.com>
# Contributor: Spencer Muise <smuise@spencermuise.ca>

pkgname=epy-git
_name=epy
provides=('epy')
pkgver=EPY_PKGVER
pkgrel=1
pkgdesc="CLI Ebook Reader"
arch=('any')
url='https://github.com/wustho/epy'
license=("GPL3")
conflicts=("epy")
depends=(
  'python'
)
makedepends=(
  'git'
  'python-setuptools'
)
source=("git+https://github.com/wustho/$_name.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_name"
  printf "%s.r%s.%s" "$(grep -F '__version__ =' epy.py | awk -F\" '{print $2}')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd $_name
    python setup.py build
}

package() {
    install -D "$srcdir/$_name/LICENSE" "$pkgdir/usr/share/licenses/$pkgname"
    cd $_name
    python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}
EOF
) | sed 's/pkgver=EPY_PKGVER/pkgver='`printf "%s.r%s.%s" "$(grep -F '__version__ =' epy.py | awk -F\" '{print $2}')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"`'/'