summaryrefslogtreecommitdiff
path: root/pcr/python-wsgiref/PKGBUILD
blob: 4a164c0419aeeab2ea3c8e0b3f23d8109e3b93f8 (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
# Maintainer : Parabola GNU / Linux-libre Aurélien DESBRIÈRES <aurelien@hackers.camp>

_pkgname=wsgiref
pkgname=(python{,2}-$_pkgname)
pkgver=0.1.2
pkgrel=3
pkgdesc="WSGI (PEP 333) Reference Library"
arch=(any)
url=http://cheeseshop.python.org/pypi/wsgiref
license=(PSF ZPL)

makedepends=(python{,2}-setuptools)
source=("https://files.pythonhosted.org/packages/source/w/wsgiref/wsgiref-${pkgver}.zip")
md5sums=('29b146e6ebd0f9fb119fe321f7bcf6cb')

prepare() {
  cd "$srcdir"

  cp -r $_pkgname-$pkgver $_pkgname-$pkgver-python2
  mv    $_pkgname-$pkgver $_pkgname-$pkgver-python

  cd "$srcdir"/$_pkgname-$pkgver-python2
  find -iname '*.py' -type f -exec sed -ri 's:^#!/usr/bin/(env )?python$:&2:' '{}' \;

  cd "$srcdir"/$_pkgname-$pkgver-python
  2to3 -w .
}

build() {
  cd "$srcdir"/$_pkgname-$pkgver-python2
  python2 setup.py build

  cd "$srcdir"/$_pkgname-$pkgver-python
  python setup.py build
}

_package() {
  depends=($1)
  cd "$srcdir"/$_pkgname-$pkgver-$1
  $1 setup.py install --root="$pkgdir"
}

for _pkg in "${pkgname[@]}"; do
  eval "package_$_pkg () { _package ${_pkg%%-*}; }"
done