summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d3fb0fe103f338c3aa3add75229c044f0c8b3167 (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
# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=hare-specification
pkgver=r393.dba688e
pkgrel=1
pkgdesc='Specification for the Hare programming language'
arch=('any')
url='https://git.sr.ht/~sircmpwn/hare-specification'
license=('custom:CC-BY-ND')
makedepends=(
  'git'
  'texlive-core'
  'texlive-latexextra'
  'texlive-fontsextra'
)
_commit='dba688e94c603cc451e77b90f658650f41aa26a4'
source=("$pkgname::git+$url#commit=$_commit")
md5sums=('SKIP')

pkgver() {
  cd "$pkgname"

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

prepare() {
  cd "$pkgname"

  # generate license file
  sed \
    -n '/^\\section.*/,//p' \
    introduction.tex | \
  sed \
    -e 's/\\section{\(.*\)}/\1/' \
    -e 's/\\textcopyright //' \
    -e 's/\\informative{//' \
    -e 's/}//' \
  > LICENSE

}

build() {
  cd "$pkgname"

  make
  make # for the ToC
}

package() {
  cd "$pkgname"

  # spec
  install -vDm644 -t "$pkgdir/usr/share/doc/hare" specification.pdf

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}