summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 545e20373d3a83c4c242274a389cd809982455f5 (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
# Maintainer: William Turner <willtur.will@gmail.com>
pkgbase=python-ufonormalizer-git
pkgname=(python-ufonormalizer-git python2-ufonormalizer-git)
_pkgname=ufoNormalizer
pkgver=0.1.r178.1ed0111
pkgrel=2
pkgdesc='A tool that will normalize the XML and other data inside of a UFO.'
arch=('any')
url='https://github.com/unified-font-object/ufoNormalizer'
license=('unknown')
makedepends=('git' 'python-setuptools' 'python2-setuptools')
options=(!emptydirs)
source=("git+https://github.com/unified-font-object/${_pkgname}.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"

  # generate version using the one in setup.py, the commit count and the commit hash
  printf "%s.r%s.%s" \
    "$(grep -oP '(?<=version=")[^"]+' setup.py)" \
    "$(git rev-list --count HEAD)" \
    "$(git rev-parse --short HEAD)"
}

package_python-ufonormalizer-git() {
  depends=('python')
  provides=('python-ufonormalizer-git')
  conflicts=('python-ufonormalizer')

  cd "${srcdir}/${_pkgname}"

  # build and install the package
  python setup.py install --root="${pkgdir}/" --prefix=/usr --optimize=1

  # remove the installed scripts to prevent conflicts between both packages
  rm -r "${pkgdir}/usr/bin"
}

package_python2-ufonormalizer-git() {
  depends=('python2')
  provides=('python2-ufonormalizer-git')
  conflicts=('python2-ufonormalizer')

  cd "${srcdir}/${_pkgname}"

  # build and install the package
  python2 setup.py install --root="$pkgdir/" --prefix=/usr --optimize=1

  # remove the installed scripts to prevent conflicts between both packages
  rm -r "${pkgdir}/usr/bin"
}