summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-tzlocal/PKGBUILD
blob: 15019073f8746bd60d1cb7f016ad54fc03466351 (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
# Maintainer: David Runge <dave@sleepmap.de>
# Contributor: eolianoe <eolianoe At GoogleMAIL DoT com>
# Contributor: Étienne Deparis <etienne [at] depar.is>
# Contributor: Patrice Peterson <runiq at archlinux dot us>
# Contributor: Patrick Burroughs <celticmadman at gmail dot com>

_name=tzlocal
pkgbase=python-tzlocal
pkgname=("python-tzlocal" "python2-tzlocal")
pkgver=1.5.1
pkgrel=3
pkgdesc="Tzinfo object for the local timezone"
arch=('any')
url="https://pypi.python.org/pypi/tzlocal"
license=('MIT')
makedepends=('python-setuptools' 'python2-setuptools')
checkdepends=('python-mock' 'python2-mock')
source=("${_name}-${pkgver}.tar.gz::https://github.com/regebro/${_name}/archive/${pkgver}.tar.gz")
sha512sums=('30dd1e3973c6fa0e0bde5a0365223506032177e96f997116edfe1fbdcff25cd735c90f205f0b95359a095749f1d1ac077903201533d460a72277891174cc1975')

prepare() {
  mv -v "${_name}-${pkgver}" "${pkgname[0]}-${pkgver}"
  cp -a "${pkgname}-${pkgver}" "${pkgname[1]}-${pkgver}"
}

build() {
  cd "${pkgname[0]}-${pkgver}"
  python setup.py build
  cd ../"${pkgname[1]}-${pkgver}"
  python2 setup.py build
}

check() {
  cd "${pkgname[0]}-${pkgver}"
  python setup.py test
  cd ../"${pkgname[1]}-${pkgver}"
  python2 setup.py test
}

package_python-tzlocal() {
  depends=('python-pytz')
  cd "${pkgname[0]}-${pkgver}"
  python setup.py install --skip-build \
    --optimize=1 \
    --prefix=/usr \
    --root="${pkgdir}"
  # license
  install -vDm644 LICENSE.txt \
    "${pkgdir}/usr/share/licenses/${pkgname[0]}/LICENSE"
  # docs
  install -t "${pkgdir}/usr/share/doc/${pkgname[0]}" \
    -vDm644 {CHANGES.txt,README.rst}
}

package_python2-tzlocal() {
  depends=('python2-pytz')
  cd "${pkgname[1]}-${pkgver}"
  python2 setup.py install --skip-build \
    --optimize=1 \
    --prefix=/usr \
    --root="${pkgdir}"
  # license
  install -vDm644 LICENSE.txt \
    "${pkgdir}/usr/share/licenses/${pkgname[1]}/LICENSE"
  # docs
  install -t "${pkgdir}/usr/share/doc/${pkgname[1]}" \
    -vDm644 {CHANGES.txt,README.rst}
}

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