summaryrefslogtreecommitdiff
path: root/pcr/python-uritools-git/PKGBUILD
blob: fba15a27811c5824b2a5dddbedf79c568925ce4f (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
# Maintainer (Arch): Frederik "Freso" S. Olesen <freso.dk@gmail.com>

_pkgname=uritools
pkgname=("python-${_pkgname}-git" "python2-${_pkgname}-git")
pkgver=2.0.0.r3.gc871941
pkgrel=1
pkgdesc='RFC 3986 compliant, Unicode-aware, scheme-agnostic replacement for urlparse'
arch=('any')
url="https://github.com/tkem/${_pkgname}"
license=('MIT')
depends=('python')
makedepends=('git' 'python-pip' 'python2-pip')
provides=("python-${_pkgname}")
conflicts=("$provides")
source=("git+${url}.git")
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  git describe --long --tags | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

check() {
  cd "$srcdir/$_pkgname"
  python setup.py test
}

package_python-uritools-git() {
  cd "$srcdir/$_pkgname"
  python setup.py install --root="$pkgdir/" --optimize=1
  install -d "$pkgdir/usr/share/doc/python-${_pkgname}/"
  install -pm644 CHANGES.rst README.rst "$pkgdir/usr/share/doc/python-${_pkgname}/"
  install -Dpm644 LICENSE "$pkgdir/usr/share/licenses/python-${_pkgname}/LICENSE"
}

package_python2-uritools-git() {
  depends=('python2' 'python2-ipaddress')
  provides=("python2-${_pkgname}")
  conflicts=("$provides")

  cd "$srcdir/$_pkgname"
  python2 setup.py install --root="$pkgdir/" --optimize=1
  install -d "$pkgdir/usr/share/doc/python2-${_pkgname}/"
  install -pm644 CHANGES.rst README.rst "$pkgdir/usr/share/doc/python2-${_pkgname}/"
  install -Dpm644 LICENSE "$pkgdir/usr/share/licenses/python2-${_pkgname}/LICENSE"
}

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