wok-next diff python-django/receipt @ rev 20948

Provide the technique to build Python packages for both Python2 and Python3
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Aug 31 17:13:06 2018 +0300 (2018-08-31)
parents 9b3461bf373c
children c9a7a7b42a86
line diff
     1.1 --- a/python-django/receipt	Fri Jul 13 13:52:56 2018 +0300
     1.2 +++ b/python-django/receipt	Fri Aug 31 17:13:06 2018 +0300
     1.3 @@ -1,39 +1,35 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="python-django"
     1.8 -VERSION="1.5.1"
     1.9 +VERSION="latest"
    1.10  CATEGORY="development"
    1.11 -SHORT_DESC="Django is a high-level Python Web framework."
    1.12 -MAINTAINER="claudinei@slitaz.org"
    1.13 +SHORT_DESC="High-level Python Web framework"
    1.14 +MAINTAINER="al.bobylev@gmail.com"
    1.15  LICENSE="BSD"
    1.16 -WEB_SITE="https://www.djangoproject.com/"
    1.17 +WEB_SITE="https://pypi.org/project/Django/"
    1.18  REPOLOGY="python:django"
    1.19  
    1.20 -SOURCE="Django"
    1.21 -TARBALL="$SOURCE-$VERSION.tar.gz"
    1.22 -WGET_URL="https://www.djangoproject.com/m/releases/${VERSION%.*}/$TARBALL"
    1.23 -SUGGESTED="python-mysql"
    1.24 +BUILD_DEPENDS="python python-pytz python3 python3-pytz"
    1.25 +SPLIT="python3-django:py3"
    1.26  
    1.27 -DEPENDS="python python-pysqlite"
    1.28 -BUILD_DEPENDS="python"
    1.29 +compile_rules() {
    1.30 +	case $SET in
    1.31 +		'')  pip='pip';;
    1.32 +		py3) pip='pip3';;
    1.33 +	esac
    1.34  
    1.35 -# Rules to configure and make the package.
    1.36 -compile_rules()
    1.37 -{
    1.38 -	python setup.py install --root=$DESTDIR
    1.39 +	$pip install --no-compile --root=$DESTDIR Django &&
    1.40 +
    1.41 +	sed -i 's|fill="ABABA7"|fill="#ABABA7"|' \
    1.42 +		$install/usr/lib/python*/site-packages/django/contrib/gis/static/gis/img/draw_polygon_off.svg
    1.43  }
    1.44  
    1.45 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.46 -genpkg_rules()
    1.47 -{
    1.48 -	mkdir -p $fs/usr
    1.49 -	cp -a $install/usr $fs
    1.50 +genpkg_rules() {
    1.51 +	VERSION=$(find $install -type d -name 'Django-*.dist-info' -exec basename '{}' \; \
    1.52 +	| sed 's|Django-\(.*\)\.dist-info|\1|')
    1.53 +	copy @std
    1.54 +	case $PACKAGE in
    1.55 +		python-django)  DEPENDS="python python-pytz";;
    1.56 +		python3-django) DEPENDS="python3 python3-pytz";;
    1.57 +	esac
    1.58  }
    1.59 -
    1.60 -# Remove old package.
    1.61 -post_install()
    1.62 -{
    1.63 -	[ ! -d "$1/var/lib/tazpkg/installed/django" ] ||
    1.64 -	rm -rf "$1/var/lib/tazpkg/installed/django"
    1.65 -}
    1.66 -