summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba2f2632776d8bdfe1755201477f7c47aeade94e (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
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: dreieck

_pkgbase=python-prompt_toolkit
_pkgname="${_pkgbase}-doc"
pkgname="${_pkgname}-git"
_pkgver="latest"
pkgver=3.0.48_6+ge02b1712
pkgrel=1
pkgdesc="Documentation for python package 'prompt_toolkit'."
makedepends=(
  'git'
  'python-sphinx'
)
provides=(
  "${_pkgname}=${pkgver}"
)
replaces=(
  "${_pkgname}<=${pkgver}"
)
conflicts=(
  "${_pkgname}"
)
arch=('any')
url='http://github.com/jonathanslenders/python-prompt-toolkit'
license=('BSD')
options=('emptydirs')
source=(
  'python-prompt-toolkit::git+http://github.com/jonathanslenders/python-prompt-toolkit.git'
)
sha256sums=(
  'SKIP'
)

pkgver() {
  cd "${srcdir}/python-prompt-toolkit"
  _descr="$(git describe --tags --long)"
  _ver="$(echo "${_descr}" | awk -F '-' '{print $1}')"
  _rel="$(echo "${_descr}" | awk -F '-' '{print $2}')"
  _rev="$(echo "${_descr}" | awk -F '-' '{print $3}')"
  echo "${_ver}_${_rel}+${_rev}"  
}

build() {
  cd "${srcdir}/python-prompt-toolkit/docs"
  
  msg "Building info page ..."
  make info
  gzip -9 _build/texinfo/prompt_toolkit.info
  
  msg "Building manpage ..."
  make man
  
  msg "Building HTML documentation ..."
  make singlehtml
  
  msg "Building plaintext documentation ..."
  make text
}

package() {
  cd "${srcdir}/python-prompt-toolkit"
  
  _docdir="/usr/share/doc/${_pkgbase}/"
  _docpkgdir="${pkgdir}/${_docdir}"
  
  install -v -D -m644 "${srcdir}/python-prompt-toolkit/docs/_build/texinfo/prompt_toolkit.info.gz" "${pkgdir}/usr/share/info/prompt_toolkit.info.gz"
  
  install -v -D -m644 "${srcdir}/python-prompt-toolkit/docs/_build/man/prompt_toolkit.1" "${pkgdir}/usr/share/man/man1/prompt_toolkit.1"
  
  mkdir -p "${_docpkgdir}/docs"
  cp -rv "${srcdir}/python-prompt-toolkit/docs/_build"/{singlehtml,text} "${_docpkgdir}/docs/"
  cp -rv "${srcdir}/python-prompt-toolkit"/{examples,AUTHORS.rst,CHANGELOG,LICENSE,README.rst} "${_docpkgdir}/"
}