summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aefdbefe59511ddcb03c758692cbc3c1779add22 (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
# Maintainer: Pavel Dvorak <dvorapa~seznam~cz>
# Maintainer: Yardena Cohen <yardenack at gmail dot com>
# Contributor: Baptiste Jonglez <baptiste--aur at jonglez dot org>

pkgname=(python-pywikibot-git python2-pywikibot-git)
pkgbase=python2-pywikibot-git
pkgver=3.0.20190430.r326.g32b5f40e6d
pkgrel=1
epoch=1
pkgdesc="Python library that interfaces with the MediaWiki API"
arch=(any)
url=https://www.mediawiki.org/wiki/Manual:Pywikibot
license=(MIT)
makedepends=(python python-requests python-setuptools python2 python2-enum34 python2-ipaddr python2-pathlib2 python2-requests python2-setuptools git)
source=(pywikibot-$pkgver::git+https://gerrit.wikimedia.org/r/pywikibot/core.git)
sha256sums=(SKIP)

prepare() {
  cd "$srcdir"
  cp -a pywikibot-$pkgver{,-py2}
}

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

build() {
  cd "$srcdir/pywikibot-$pkgver"
  python setup.py build

  cd "$srcdir/pywikibot-$pkgver-py2"
  python2 setup.py build
}

package_python-pywikibot-git() {
  depends=(python python-requests)
  optdepends=("python-mwparserfromhell-git: improved parser")
  provides=(python-pywikibot)
  conflicts=(python-pywikibot)

  cd "$srcdir/pywikibot-$pkgver"
  python setup.py install --optimize=1 --root="$pkgdir/" --skip-build
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}

package_python2-pywikibot-git() {
  depends=(python2 python2-requests python2-ipaddr python2-pathlib2 python2-enum34)
  optdepends=("python2-mwparserfromhell: improved parser")
  provides=(python2-pywikibot)
  conflicts=(python2-pywikibot)

  cd "$srcdir/pywikibot-$pkgver-py2"
  python2 setup.py install --optimize=1 --root="$pkgdir/" --skip-build
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}