aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-django
diff options
context:
space:
mode:
authorAleksey Mikhaylov <almikhail@list.ru>2017-05-31 12:32:50 +0300
committerNatanael Copa <ncopa@alpinelinux.org>2017-07-14 18:38:22 +0000
commit787ab5d018ebef6741cdb3c9d4f1bdf105edfa62 (patch)
tree2c14bb7f5ac5c770394f6bd9b453a722e1fcb14a /main/py-django
parente933b671cff7f8c49aa262abd679770c239f243a (diff)
downloadaports-787ab5d018ebef6741cdb3c9d4f1bdf105edfa62.tar.bz2
aports-787ab5d018ebef6741cdb3c9d4f1bdf105edfa62.tar.xz
main/py-django: add py3 subpackage
Diffstat (limited to 'main/py-django')
-rw-r--r--main/py-django/APKBUILD42
1 files changed, 36 insertions, 6 deletions
diff --git a/main/py-django/APKBUILD b/main/py-django/APKBUILD
index 91b94eb5c6..9b1e2b0ae1 100644
--- a/main/py-django/APKBUILD
+++ b/main/py-django/APKBUILD
@@ -3,16 +3,16 @@
pkgname=py-django
_pkgname=Django
pkgver=1.11
-pkgrel=0
+pkgrel=1
pkgdesc="A high-level Python Web framework"
url="http://djangoproject.com/"
arch="noarch"
license="BSD"
-depends="python2"
+depends=""
depends_dev=""
-makedepends="python2-dev py-setuptools"
+makedepends="python2-dev python3-dev py-setuptools"
install=""
-subpackages=""
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver
@@ -27,12 +27,42 @@ builddir="$srcdir"/$_pkgname-$pkgver
build() {
cd "$builddir"
- python2 setup.py build || return 1
+ python2 setup.py --quiet build
+ python3 setup.py --quiet build
}
package() {
+ mkdir -p "$pkgdir"/usr/bin
+
+ # Create unsuffixed symlinks for executables from py3 subpackage.
+ local name; for name in django-admin; do
+ ln -s $name-3 "$pkgdir"/usr/bin/$name
+ done
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_py3() {
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ local pyver="${1:6:1}"
+ pkgdesc="$pkgdesc (for $python)"
+ depends="$depends $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
cd "$builddir"
- python2 setup.py install --root "$pkgdir" --skip-build || return 1
+ $python setup.py --quiet install --prefix=/usr --root="$subpkgdir"
+ # Add version suffix to executable files.
+ local path; for path in "$subpkgdir"/usr/bin/*.py; do
+ mv -f "$path" "${path%%.py}"
+ mv -f "${path%%.py}" "${path%%.py}-$pyver"
+ done
}
sha512sums="31e14ec186d1b0dade0b7c0132c38177c4d5a3f5e8f755b81b556b6884912674bd1a3f8488194f4d7647804426a06663f0a19e2d56502a84c75553a459a64c55 Django-1.11.tar.gz"