Python2 django (#4823)

* django fixes
django-admin now works in the bash shell.
added optional depends upon python-bcrypt and python-argon2_cffi for password support.  python-argon2_cffi  package was included in a previous PR.

* Remove duplicatee entry.
This commit is contained in:
J. Peter Mugaas
2019-01-09 02:32:32 -05:00
committed by Алексей
parent 7e3638d1a0
commit 8548e345e6
6 changed files with 74 additions and 7 deletions

View File

@@ -7,13 +7,15 @@ _realname=django
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=1.11.13
pkgrel=1
pkgrel=2
pkgdesc="A high-level Python Web framework that encourages rapid development and clean design (mingw-w64)"
arch=('any')
url='http://www.djangoproject.com/'
license=('BSD')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-pytz"
"${MINGW_PACKAGE_PREFIX}-python2-bcrypt"
"${MINGW_PACKAGE_PREFIX}-python2-argon2_cffi"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
options=('staticlibs' 'strip' '!debug')
source=("Django-$pkgver.tar.gz"::"https://www.djangoproject.com/download/$pkgver/tarball/")
@@ -66,7 +68,10 @@ package() {
depends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-pytz")
optdepends=("${MINGW_PACKAGE_PREFIX}-python2-mysql: for MySQL backend"
"${MINGW_PACKAGE_PREFIX}-python2-psycopg2: for PostgreSQL backend")
"${MINGW_PACKAGE_PREFIX}-python2-psycopg2: for PostgreSQL backend"
"${MINGW_PACKAGE_PREFIX}-python2-bcrypt: for bcrypt support"
"${MINGW_PACKAGE_PREFIX}-python2-argon2_cffi: for Argon2 support")
install=${_realname}2-${CARCH}.install
cd "${srcdir}/python2-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
@@ -80,7 +85,7 @@ package() {
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|${PREFIX_WIN}/bin/|/usr/bin/env |g" -i ${_f}
sed -e "s|${PREFIX_WIN}/bin/|${MINGW_PREFIX}/bin/|g" -i ${_f}
done
# for Python2 packages, you want to rename some stuff from the bin directory

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw32
local _prefix=$(pwd -W)
cd -
local _it
for _it in django-admin2; do
sed -e "s|/mingw32|${_prefix}|g" \
-i mingw32/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw64
local _prefix=$(pwd -W)
cd -
local _it
for _it in django-admin2; do
sed -e "s|/mingw64|${_prefix}|g" \
-i mingw64/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@@ -6,13 +6,16 @@ _realname=django
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=2.1.4
pkgrel=1
pkgrel=2
pkgdesc="A high-level Python Web framework that encourages rapid development and clean design (mingw-w64)"
arch=('any')
url='http://www.djangoproject.com/'
license=('BSD')
makedepends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
"${MINGW_PACKAGE_PREFIX}-python3-bcrypt"
"${MINGW_PACKAGE_PREFIX}-python3-argon2_cffi"
"${MINGW_PACKAGE_PREFIX}-python3-pytz"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools")
options=('staticlibs' 'strip' '!debug')
source=("Django-${pkgver}.tar.gz"::"https://www.djangoproject.com/download/${pkgver}/tarball/")
sha512sums=('a2dc6fb7514f8d79aff98aeb0bd0edb1ede36ed2368e553fded8b58765092d6a2efcf2e9429bb9c7d2c16d466e46a9ff18aaf5911a7dd868f42569c1e82831aa')
@@ -57,7 +60,10 @@ build() {
package() {
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-pytz")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-psycopg2: for PostgreSQL backend")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-psycopg2: for PostgreSQL backend"
"${MINGW_PACKAGE_PREFIX}-python3-bcrypt: for bcrypt support"
"${MINGW_PACKAGE_PREFIX}-python3-argon2_cffi: for Argon2 support")
install=${_realname}3-${CARCH}.install
cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
@@ -72,7 +78,7 @@ package() {
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|${PREFIX_WIN}/bin/|/usr/bin/env |g" -i ${_f}
sed -e "s|${PREFIX_WIN}/bin/|${MINGW_PREFIX}/bin/|g" -i ${_f}
done
#### end section ####

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw32
local _prefix=$(pwd -W)
cd -
local _it
for _it in django-admin django-admin3; do
sed -e "s|/mingw32|${_prefix}|g" \
-i mingw32/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@@ -0,0 +1,14 @@
post_install() {
cd mingw64
local _prefix=$(pwd -W)
cd -
local _it
for _it in django-admin django-admin3; do
sed -e "s|/mingw64|${_prefix}|g" \
-i mingw64/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}