summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6f675c9f4182ade1db1a57a9ce15729c6b63386f (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
# Maintainer: eolianoe <eolianoe At GoogleMAIL DoT com>

_pkgname=vdirsyncer
pkgname=${_pkgname}-git
pkgver=0.16.2.r0.g1da0bd1
pkgrel=1
pkgdesc="Synchronize CalDAV and CardDAV."
arch=('i686' 'x86_64')
url="https://github.com/pimutils/${_pkgname}"
license=('BSD')
depends=("python-click>=5.0" "python-click-log>=0.2.0" "python-click-threading>=0.2"
         "python-requests>2.9.0" "python-requests-toolbelt>=0.4.0"
         "python-atomicwrites>=0.1.7"
         "python-requests-oauthlib"
         "python-keyring")
makedepends=("git" "python-setuptools-scm"
             "python-sphinx" 'python-sphinx_rtd_theme')
checkdepends=("python-hypothesis>=3.1"
              "python-pytest" "python-pytest-localserver" "python-pytest-subtesthack")
source=("git://github.com/pimutils/${_pkgname}.git")
sha256sums=('SKIP')
conflicts=('vdirsyncer')
provides=("vdirsyncer=${pkgver}")

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

build() {
  # Build vdirsyncer
  cd "${srcdir}/${_pkgname}"
  python setup.py build

  # "Install" development stuff needed to build the man page
  rm -rf "${srcdir}/develop"
  mkdir "${srcdir}/develop"
  export PYTHONPATH="${srcdir}/develop":${PYTHONPATH}
  python setup.py develop --install-dir="${srcdir}/develop/"

  # Build man page
  cd "${srcdir}/${_pkgname}/docs"
  make man SPHINXBUILD=sphinx-build
}

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

  # When using a clean chroot,
  # one has to choose a proper locale to run the tests
  if [ "${LANG}" == "C" ]
  then
    export LANG=$(locale -a | grep utf8 | head -n1)
  fi

  make test
}

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

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

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 docs/_build/man/${_pkgname}.1 \
    "${pkgdir}/usr/share/man/man1/${_pkgname}.1"
}