Commit 82b6642e authored by Francesco Colista's avatar Francesco Colista
Browse files

main/py-markupsafe: added support for python3, added py2 and py3 subpackages

parent 3746f619
......@@ -6,24 +6,47 @@ pkgver=0.23
pkgrel=0
pkgdesc="Implements a XML/HTML/XHTML Markup safe string"
url="https://github.com/mitsuhiko/markupsafe"
arch="all"
arch="noarch"
license="BSD"
depends="python"
depends=""
depends_dev=""
makedepends="python-dev py-setuptools"
makedepends="python-dev python3-dev py-setuptools"
install=""
subpackages="$pkgname-dev"
subpackages="$pkgname-dev py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
_builddir="$srcdir"/$_pkgname-$pkgver
builddir="$srcdir"/$_pkgname-$pkgver
build() {
cd "$_builddir"
cd "$builddir"
python setup.py build || return 1
python3 setup.py build || return 1
}
package() {
cd "$_builddir"
python setup.py install --prefix=/usr --root="$pkgdir" || return 1
cd "$builddir"
python setup.py install --root=$pkgdir/ --optimize=1 || return 1
python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1
}
_py() {
local python=$1
pkgdesc="$pkgdesc - $python"
arch="all"
install_if="$pkgname=$pkgver-r$pkgrel $python"
local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')
mkdir -p "$subpkgdir"${dir}
mv "$pkgdir"${dir}/* "$subpkgdir"${dir}
}
_py2() {
_py python2
replaces="$pkgname"
}
_py3() {
_py python3
}
md5sums="f5ab3deee4c37cd6a922fb81e730da6e MarkupSafe-0.23.tar.gz"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment