summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3b5ee32b2182d5014e614f9321f66428bca44228 (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
# Maintainer: Andre Schröder <andre.schroedr at gmail dot com>

# All my PKGBUILDs are managed at https://github.com/schra/pkgbuilds

_name=python-sphinx-math-dollar
pkgname=$_name-git
pkgver=1.1.1.r2.ga3fe652
_mainfolder=sphinx-math-dollar
pkgrel=1
pkgdesc='Sphinx extension to let you write LaTeX math using $$'
arch=(any)
url=https://github.com/sympy/sphinx-math-dollar
license=(MIT)
depends=(python)
makedepends=(python-setuptools git)
source=(git+$url)
sha256sums=('SKIP')
conflicts=($_name)
provides=($_name)

pkgver() {
  cd "$srcdir/$_mainfolder"

  # from https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "$srcdir/$_mainfolder"
  python setup.py build
}

package() {
  cd "$srcdir/$_mainfolder"
  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build

  # the setup.py also installs tests, thus remove them
  rm -R "$pkgdir"/usr/lib/python3.*/site-packages/sphinx_math_dollar/tests/
}