2016-02-06 20:11:06 +08:00
|
|
|
pkgbase=django
|
|
|
|
pkgname=('python3-django' 'python2-django')
|
2018-02-07 14:47:42 +08:00
|
|
|
pkgver=1.11.10
|
2012-08-06 16:22:51 +08:00
|
|
|
pkgrel=1
|
2016-02-06 20:11:06 +08:00
|
|
|
pkgdesc="A high-level Python Web framework that encourages rapid development and clean design"
|
|
|
|
arch=('any')
|
2012-08-06 16:22:51 +08:00
|
|
|
license=('BSD')
|
2017-06-30 16:45:52 +08:00
|
|
|
url="https://www.djangoproject.com/"
|
2016-02-06 20:11:06 +08:00
|
|
|
makedepends=('python2' 'python2-setuptools' 'python3' 'python3-setuptools')
|
2016-08-08 18:56:11 +08:00
|
|
|
source=("https://www.djangoproject.com/m/releases/${pkgver:0:4}/Django-$pkgver.tar.gz")
|
2018-02-07 14:47:42 +08:00
|
|
|
sha256sums=('22383567385a9c406d8a5ce080a2694c82c6b733e157922197e8b393bb3aacd9')
|
2016-02-06 20:11:06 +08:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cp -a "$srcdir/Django-$pkgver" "$srcdir/Django-$pkgver-python2"
|
|
|
|
|
|
|
|
find "$srcdir/Django-$pkgver-python2" -name '*.py' | \
|
|
|
|
xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
|
|
|
|
}
|
2012-08-06 16:22:51 +08:00
|
|
|
|
|
|
|
build() {
|
2016-02-06 20:11:06 +08:00
|
|
|
cd "$srcdir/Django-$pkgver"
|
|
|
|
python3 setup.py build
|
|
|
|
|
|
|
|
cd "$srcdir/Django-$pkgver-python2"
|
2012-08-06 16:22:51 +08:00
|
|
|
python2 setup.py build
|
|
|
|
}
|
|
|
|
|
2016-02-06 20:11:06 +08:00
|
|
|
package_python3-django() {
|
|
|
|
depends=('python3' 'python3-setuptools')
|
|
|
|
optdepends=('python3-psycopg2: for PostgreSQL backend')
|
|
|
|
cd "$srcdir/Django-$pkgver"
|
|
|
|
python3 setup.py install --root="$pkgdir" --optimize=1
|
2012-08-06 16:22:51 +08:00
|
|
|
|
2016-02-06 20:11:06 +08:00
|
|
|
ln -s django-admin.py "$pkgdir"/usr/bin/django-admin3.py
|
|
|
|
ln -s django-admin "$pkgdir"/usr/bin/django-admin3
|
2012-08-06 16:22:51 +08:00
|
|
|
install -Dm644 extras/django_bash_completion \
|
|
|
|
"$pkgdir"/usr/share/bash-completion/completions/django-admin.py
|
2016-02-06 20:11:06 +08:00
|
|
|
ln -s django-admin.py \
|
|
|
|
"$pkgdir"/usr/share/bash-completion/completions/django-admin
|
2012-08-06 16:22:51 +08:00
|
|
|
ln -s django-admin.py \
|
|
|
|
"$pkgdir"/usr/share/bash-completion/completions/manage.py
|
|
|
|
|
|
|
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
|
|
}
|
2016-02-06 20:11:06 +08:00
|
|
|
|
|
|
|
package_python2-django() {
|
|
|
|
depends=('python2' 'python2-setuptools')
|
|
|
|
optdepends=('mysql-python: for MySQL backend'
|
|
|
|
'python2-psycopg2: for PostgreSQL backend')
|
|
|
|
replaces=('django')
|
|
|
|
conflicts=('django')
|
|
|
|
cd "$srcdir/Django-$pkgver-python2"
|
|
|
|
python2 setup.py install --root="$pkgdir" --optimize=1
|
|
|
|
|
|
|
|
mv "$pkgdir"/usr/bin/django-admin.py "$pkgdir"/usr/bin/django-admin2.py
|
|
|
|
mv "$pkgdir"/usr/bin/django-admin "$pkgdir"/usr/bin/django-admin2
|
|
|
|
# TODO: this probably won't work due to the `complete` command within not
|
|
|
|
# knowing about modified our exectuable names
|
|
|
|
install -Dm644 extras/django_bash_completion \
|
|
|
|
"$pkgdir"/usr/share/bash-completion/completions/django-admin2.py
|
|
|
|
ln -s django-admin2.py \
|
|
|
|
"$pkgdir"/usr/share/bash-completion/completions/django-admin2
|
|
|
|
|
|
|
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
2016-03-02 06:19:44 +08:00
|
|
|
}
|