summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a9df08c1d0065d930cbc3747d83588e98dc65820 (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
# Maintainer: "Amhairghin" Oscar Garcia Amor (https://ogarcia.me)

_pkgname=timeline
pkgname=${_pkgname}-git
pkgver=r103.ccd3fc3
pkgrel=1
pkgdesc="A plain-text based distributed social network build on top of git configuration manager"
arch=('any')
url="https://ajdiaz.me/timeline/"
license=('GPL3')
depends=('bash' 'git')
makedepends=('pandoc')
conflicts=('timeline')
source=("${_pkgname}"::"git+https://github.com/ajdiaz/${_pkgname}.git"
        "${_pkgname}.service")
b2sums=('SKIP'
        '1ea9905ee31a8f722111e7aad4197326f5cbeffa7953c1678432172af1fbd72c8363ea00a94d2c1f3b332a3e85f6eeadd551a05b62ac00c3d42562b333e475f9')

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

build() {
  cd "${_pkgname}"
  make clean && make tl && make doc
  cd man
  gzip -fk *.[0-9]
}

package() {
  cd "${_pkgname}"

  # user service file
  install -D -m644 "${srcdir}/${_pkgname}.service" \
    "${pkgdir}/usr/lib/systemd/user/${_pkgname}.service"

  # binary
  install -D -m755 "tl" "${pkgdir}/usr/bin/tl"

  # man
  for manpage in man/*.[0-9]; do
    section=${manpage##*.}
    install -Dm644 ${manpage}.gz \
      "${pkgdir}"/usr/share/man/man${section}/${manpage##*/}.gz
  done

  # docs
  install -D -m644 README "${pkgdir}/usr/share/doc/${_pkgname}/README"
}