summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f16632b72c96cfc16fe61a4f17598bb6fd6c9d47 (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
53
54
55
56
57
58
# Maintainer: banana-bred <j.forer@posteo.net>

pkgname='tptable-git'
pkgver=r41.ab1ecc1
pkgrel=1
pkgdesc="A TUI periodic table for GNU/Linux terminals coded in C"
arch=('any')
url='https://github.com/velorek1/terminalperiodictable'
license=('MIT')
groups=()
depends=()
makedepends=('git' 'make')
checkdepends=()
optdepends=()
provides=('tptable')
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
noextract=()
source=("${pkgname%-*}::git+${url}.git")
sha256sums=('SKIP')

prepare() {

  # -- replace hard-coded "/usr/share/ptable" directroy with "/usr/share/${pkgname%-*}" in main.c so that the element info
  #    can actually be read
  sed -i "s/\/usr\/share\/ptable\/elements.dat/\/usr\/share\/${pkgname%-*}\/elements.dat/" "${srcdir}/${pkgname%-*}"/main.c

}

pkgver() {

  cd "${srcdir}/${pkgname%-*}"

	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"

}

build() {

  cd "${srcdir}/${pkgname%-*}"

  make all

}

package() {

	install -Dm 755 "${srcdir}/${pkgname%-*}/${pkgname%-*}" "${pkgdir}"/usr/bin/${pkgname%-*}

	install -Dm 644 ${srcdir}/${pkgname%-*}/elements.dat "${pkgdir}/usr/share/${pkgname%-*}"/elements.dat

}

# vim: ts=2 sw=2 et :