summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 24397f90057c42c1978b672f72d5116275ab47a9 (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
# Maintainer:  jyantis <yantis@yantis.net>

# There is some confusion between this and the community python-markdown
# That is a different immlementation. From the readme:

# "There is another Python markdown.py. However, at least at the time this
# project was started, markdown2.py was faster (see the Performance Notes)
# and, to my knowledge, more correct (see Testing Notes). That was a while ago
# though, so you shouldn't discount Python-markdown from your consideration."

pkgname=python-markdown2-git
pkgver=2.3.1.r12.g9b97e84
pkgrel=1
pkgdesc='A fast and complete implementation of Markdown in Python 3'
arch=('any')
url='https://github.com/trentm/python-markdown2'
license=('MIT')
depends=('python' 'python-setuptools')
source=('git+https://github.com/trentm/python-markdown2.git')
sha256sums=('SKIP')
makedepends=('git')
optdepends=('python-pygments: testing')
provides=('python-markdown2')
conflicts=('python-markdown2')

pkgver() {
  cd python-markdown2
  set -o pipefail
  git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' ||
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd python-markdown2
  python setup.py build
}

# Tests fail under python 3 as it has some python 3 code
# check() {
#  cd python-markdown2
#  cd test
#  python testall.py
#}

package() {
  cd python-markdown2

  # We don't need anything related to git in the package
  rm -rf .git*

  python setup.py install --root="${pkgdir}" --optimize=1

  # Install License
  install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

  # Install Documentation
  install -D -m644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"

  # Conflicts happen because of the /usr/bin/markdown2 file if someone installs both the python2 and 3 packages
  # Since there are multiple versions of python2 and no other python3 versions
  # lets rename the python3 version to markdown3
  mv "${pkgdir}/usr/bin/markdown2" "${pkgdir}/usr/bin/markdown3"
}

# vim:set ts=2 sw=2 et: