summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fa1c27e27ccd34b6ff15bae1cb76c8174978906e (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
59
60
# Maintainer: dreieck

_pkgname='wikidoc'
pkgname="${_pkgname}-git"
epoch=1
pkgver=r34.20180311.7fb66a4
pkgrel=3
pkgdesc='Python script allows to create nice looking PDF files from a github wiki. Requires mardown-formatted wiki.'
arch=('any')
url='https://github.com/jobisoft/wikidoc'
license=('GPL2')
depends=(
  'pandoc'
  'python2'
  'wkhtmltopdf'
)
makedepends=(
  'git'
)
provides=(
  "${_pkgname}=${pkgver}"
)
conflicts=(
  "${_pkgname}"
)

source=(
  "${_pkgname}::git+https://github.com/jobisoft/wikidoc.git"
)
sha256sums=(
  'SKIP'
)


prepare() {
  cd "${srcdir}/${_pkgname}"
  msg2 "Patching for python2 ..."
  sed -e '1s|#![[:space:]]*/usr/bin/python[[:space:]]*$|#!/usr/bin/python2|' -i wikidoc.py
}

pkgver () {
  cd "${srcdir}/${_pkgname}"
  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_rev}" ]; then
    error "Revision could not be determined."
    return 1
  else
    printf '%s' "r${_rev}.${_date}.${_hash}"
  fi
}

package() {
  cd "${srcdir}/${_pkgname}"
  install -D -v -m755 wikidoc.py "${pkgdir}/usr/bin/wikidoc"
  install -D -v -m644 README.md "${pkgdir}/usr/share/doc/${_pkgname}/README.md"
  install -D -v -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.GPL3.txt"
}