wok-next 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 5fac1a2da249
children 8e1b2a143eb3
files midori/receipt openbox-theme-blinder/receipt python-caldav/receipt python-coverage/.icon.png python-coverage/receipt python-distribute/receipt python-django/receipt python-gdata/receipt python-pytz/receipt
line diff
     1.1 --- a/midori/receipt	Fri Aug 31 11:58:18 2018 +0300
     1.2 +++ b/midori/receipt	Fri Aug 31 17:13:06 2018 +0300
     1.3 @@ -6,10 +6,10 @@
     1.4  SHORT_DESC="Lightweight web browser based on GTK+/WebKit"
     1.5  MAINTAINER="pankso@slitaz.org"
     1.6  LICENSE="LGPL2.1"
     1.7 -WEB_SITE="http://www.midori-browser.org/"
     1.8 +WEB_SITE="https://www.midori-browser.org/"
     1.9  
    1.10  TARBALL="${PACKAGE}_${VERSION}_all_.tar.bz2"
    1.11 -WGET_URL="http://midori-browser.org/downloads/$TARBALL"
    1.12 +WGET_URL="https://midori-browser.org/downloads/$TARBALL"
    1.13  TARBALL_SHA1="64c86935028feb5f89d799c2acacaad67764da6f"
    1.14  
    1.15  BUILD_DEPENDS_arm="glib-dev libnotify-dev gtk+-dev xorg-libXScrnSaver-dev \
     2.1 --- a/openbox-theme-blinder/receipt	Fri Aug 31 11:58:18 2018 +0300
     2.2 +++ b/openbox-theme-blinder/receipt	Fri Aug 31 17:13:06 2018 +0300
     2.3 @@ -1,4 +1,4 @@
     2.4 -# SliTaz package receipt.
     2.5 +# SliTaz package receipt v2.
     2.6  
     2.7  PACKAGE="openbox-theme-blinder"
     2.8  VERSION="20150606"
     2.9 @@ -6,30 +6,24 @@
    2.10  SHORT_DESC="Blinder - theme for Openbox 3"
    2.11  MAINTAINER="al.bobylev@gmail.com"
    2.12  LICENSE="PublicDomain"
    2.13 -WEB_SITE="http://desktopstylish.tumblr.com/post/120897023300/blinder-the-openbox-3-theme-download"
    2.14 +WEB_SITE="https://web.archive.org/web/20151101012710/http://desktopstylish.tumblr.com/post/120897023300/blinder-the-openbox-3-theme-download"
    2.15 +
    2.16  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    2.17  WGET_URL="https://drive.google.com/uc?export=download&id=0B4Re2DvqOMqlQURSR3V5dzB4aXc"
    2.18 -TAGS="hackdorte openbox"
    2.19  
    2.20 -DEPENDS="openbox"
    2.21 -BUILD_DEPENDS=""
    2.22 -
    2.23 -# Rules to configure and make the package.
    2.24 -compile_rules()
    2.25 -{
    2.26 +compile_rules() {
    2.27  	mkdir -p $install/usr/share/themes/Blinder
    2.28  	cp -a $src/* $install/usr/share/themes/Blinder
    2.29  	chown -R root:root $install
    2.30  }
    2.31  
    2.32 -# Rules to gen a SliTaz package suitable for Tazpkg.
    2.33 -genpkg_rules()
    2.34 -{
    2.35 +genpkg_rules() {
    2.36  	cp -a $install/* $fs
    2.37 +	DEPENDS="openbox"
    2.38 +	TAGS="hackdorte openbox"
    2.39  }
    2.40  
    2.41 -post_install()
    2.42 -{
    2.43 +post_install() {
    2.44  	# Set Openbox theme
    2.45  	for i in $1/etc/xdg/openbox/rc.xml $1/home/*/.config/openbox/rc.xml; do
    2.46  		[ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>Blinder<|' $i
    2.47 @@ -37,8 +31,7 @@
    2.48  	[ -z "$1" ] && pgrep openbox >/dev/null && openbox --reconfigure
    2.49  }
    2.50  
    2.51 -pre_remove()
    2.52 -{
    2.53 +pre_remove() {
    2.54  	# Restore Openbox theme (SliTaz)
    2.55  	for i in $1/etc/xdg/openbox/rc.xml $1/home/*/.config/openbox/rc.xml; do
    2.56  		[ -f $i ] && sed -i '/<theme>/,/<name>/ s|>[^<]*<|>SliTaz<|' $i
     3.1 --- a/python-caldav/receipt	Fri Aug 31 11:58:18 2018 +0300
     3.2 +++ b/python-caldav/receipt	Fri Aug 31 17:13:06 2018 +0300
     3.3 @@ -1,30 +1,23 @@
     3.4 -# SliTaz package receipt.
     3.5 +# SliTaz package receipt v2.
     3.6  
     3.7  PACKAGE="python-caldav"
     3.8 -VERSION="0.1.12"
     3.9 -CATEGORY="development"
    3.10 +VERSION="latest"
    3.11 +CATEGORY="python"
    3.12  SHORT_DESC="CalDAV (RFC4791) client library for Python"
    3.13  MAINTAINER="pascal.bellard@slitaz.org"
    3.14  LICENSE="GPL"
    3.15 -WEB_SITE="http://pypi.python.org/pypi/caldav"
    3.16 +WEB_SITE="https://pypi.org/project/caldav/"
    3.17  REPOLOGY="python:caldav"
    3.18  
    3.19 -SOURCE="caldav"
    3.20 -TARBALL="$SOURCE-$VERSION.tar.gz"
    3.21 -WGET_URL="http://pypi.python.org/packages/source/c/$SOURCE/$TARBALL"
    3.22 +BUILD_DEPENDS="python python-vobject python-lxml python-nose python-coverage \
    3.23 +python-requests python-six "
    3.24  
    3.25 -DEPENDS="python"
    3.26 -BUILD_DEPENDS="python python-dev"
    3.27 -
    3.28 -# Rules to configure and make the package.
    3.29 -compile_rules()
    3.30 -{
    3.31 -	python setup.py install --root=$DESTDIR
    3.32 +compile_rules() {
    3.33 +	pip install --no-compile --root=$DESTDIR caldav
    3.34  }
    3.35  
    3.36 -# Rules to gen a SliTaz package suitable for Tazpkg.
    3.37 -genpkg_rules()
    3.38 -{
    3.39 -	mkdir -p $fs/usr
    3.40 -	cp -a $install/usr $fs
    3.41 +genpkg_rules() {
    3.42 +	VERSION=$(sed -n '/^Successfully installed/ s|.*caldav-||p' $LOGS/$PACKAGE.log)
    3.43 +	copy @std
    3.44 +	DEPENDS="python"
    3.45  }
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/python-coverage/.icon.png	Fri Aug 31 17:13:06 2018 +0300
     4.3 @@ -0,0 +1,1 @@
     4.4 +../python/.icon.png
     4.5 \ No newline at end of file
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/python-coverage/receipt	Fri Aug 31 17:13:06 2018 +0300
     5.3 @@ -0,0 +1,22 @@
     5.4 +# SliTaz package receipt v2.
     5.5 +
     5.6 +PACKAGE="python-coverage"
     5.7 +VERSION="latest"
     5.8 +CATEGORY="python"
     5.9 +SHORT_DESC="Code coverage measurement for Python"
    5.10 +MAINTAINER="al.bobylev@gmail.com"
    5.11 +LICENSE="Apache2"
    5.12 +WEB_SITE="https://pypi.org/project/coverage/"
    5.13 +REPOLOGY="python:coverage"
    5.14 +
    5.15 +BUILD_DEPENDS="python"
    5.16 +
    5.17 +compile_rules() {
    5.18 +	pip install --no-compile --root=$DESTDIR coverage
    5.19 +}
    5.20 +
    5.21 +genpkg_rules() {
    5.22 +	VERSION=$(sed -n '/^Successfully installed/ s|.*coverage-||p' $LOGS/$PACKAGE.log)
    5.23 +	copy @std
    5.24 +	DEPENDS="python"
    5.25 +}
     6.1 --- a/python-distribute/receipt	Fri Aug 31 11:58:18 2018 +0300
     6.2 +++ b/python-distribute/receipt	Fri Aug 31 17:13:06 2018 +0300
     6.3 @@ -1,30 +1,22 @@
     6.4 -# SliTaz package receipt.
     6.5 +# SliTaz package receipt v2.
     6.6  
     6.7  PACKAGE="python-distribute"
     6.8 -VERSION="0.7.3"
     6.9 +VERSION="latest"
    6.10  CATEGORY="development"
    6.11 -SHORT_DESC="Easily build and distribute Python packages"
    6.12 +SHORT_DESC="Distribute legacy wrapper"
    6.13  MAINTAINER="slaxemulator@gmail.com"
    6.14  LICENSE="PSL"
    6.15  WEB_SITE="http://pypi.python.org/pypi/distribute"
    6.16  REPOLOGY="python:distribute"
    6.17  
    6.18 -SOURCE="distribute"
    6.19 -TARBALL="$SOURCE-$VERSION.zip"
    6.20 -WGET_URL="https://pypi.python.org/packages/source/d/distribute/$TARBALL"
    6.21 +BUILD_DEPENDS="python"
    6.22  
    6.23 -DEPENDS="python"
    6.24 -BUILD_DEPENDS="python-dev wget"
    6.25 -
    6.26 -# Rules to configure and make the package.
    6.27 -compile_rules()
    6.28 -{
    6.29 -	cd $src
    6.30 -	python setup.py install --prefix=/usr --root=$DESTDIR
    6.31 +compile_rules() {
    6.32 +	pip install --no-compile --root=$DESTDIR distribute
    6.33  }
    6.34  
    6.35 -# Rules to gen a SliTaz package suitable for Tazpkg.
    6.36 -genpkg_rules()
    6.37 -{
    6.38 -	cp -a $install/* $fs
    6.39 +genpkg_rules() {
    6.40 +	VERSION=$(sed -n '/^Successfully installed/ s|.*distribute-||p' $LOGS/$PACKAGE.log)
    6.41 +	copy @std
    6.42 +	DEPENDS="python"
    6.43  }
     7.1 --- a/python-django/receipt	Fri Aug 31 11:58:18 2018 +0300
     7.2 +++ b/python-django/receipt	Fri Aug 31 17:13:06 2018 +0300
     7.3 @@ -1,39 +1,35 @@
     7.4 -# SliTaz package receipt.
     7.5 +# SliTaz package receipt v2.
     7.6  
     7.7  PACKAGE="python-django"
     7.8 -VERSION="1.5.1"
     7.9 +VERSION="latest"
    7.10  CATEGORY="development"
    7.11 -SHORT_DESC="Django is a high-level Python Web framework."
    7.12 -MAINTAINER="claudinei@slitaz.org"
    7.13 +SHORT_DESC="High-level Python Web framework"
    7.14 +MAINTAINER="al.bobylev@gmail.com"
    7.15  LICENSE="BSD"
    7.16 -WEB_SITE="https://www.djangoproject.com/"
    7.17 +WEB_SITE="https://pypi.org/project/Django/"
    7.18  REPOLOGY="python:django"
    7.19  
    7.20 -SOURCE="Django"
    7.21 -TARBALL="$SOURCE-$VERSION.tar.gz"
    7.22 -WGET_URL="https://www.djangoproject.com/m/releases/${VERSION%.*}/$TARBALL"
    7.23 -SUGGESTED="python-mysql"
    7.24 +BUILD_DEPENDS="python python-pytz python3 python3-pytz"
    7.25 +SPLIT="python3-django:py3"
    7.26  
    7.27 -DEPENDS="python python-pysqlite"
    7.28 -BUILD_DEPENDS="python"
    7.29 +compile_rules() {
    7.30 +	case $SET in
    7.31 +		'')  pip='pip';;
    7.32 +		py3) pip='pip3';;
    7.33 +	esac
    7.34  
    7.35 -# Rules to configure and make the package.
    7.36 -compile_rules()
    7.37 -{
    7.38 -	python setup.py install --root=$DESTDIR
    7.39 +	$pip install --no-compile --root=$DESTDIR Django &&
    7.40 +
    7.41 +	sed -i 's|fill="ABABA7"|fill="#ABABA7"|' \
    7.42 +		$install/usr/lib/python*/site-packages/django/contrib/gis/static/gis/img/draw_polygon_off.svg
    7.43  }
    7.44  
    7.45 -# Rules to gen a SliTaz package suitable for Tazpkg.
    7.46 -genpkg_rules()
    7.47 -{
    7.48 -	mkdir -p $fs/usr
    7.49 -	cp -a $install/usr $fs
    7.50 +genpkg_rules() {
    7.51 +	VERSION=$(find $install -type d -name 'Django-*.dist-info' -exec basename '{}' \; \
    7.52 +	| sed 's|Django-\(.*\)\.dist-info|\1|')
    7.53 +	copy @std
    7.54 +	case $PACKAGE in
    7.55 +		python-django)  DEPENDS="python python-pytz";;
    7.56 +		python3-django) DEPENDS="python3 python3-pytz";;
    7.57 +	esac
    7.58  }
    7.59 -
    7.60 -# Remove old package.
    7.61 -post_install()
    7.62 -{
    7.63 -	[ ! -d "$1/var/lib/tazpkg/installed/django" ] ||
    7.64 -	rm -rf "$1/var/lib/tazpkg/installed/django"
    7.65 -}
    7.66 -
     8.1 --- a/python-gdata/receipt	Fri Aug 31 11:58:18 2018 +0300
     8.2 +++ b/python-gdata/receipt	Fri Aug 31 17:13:06 2018 +0300
     8.3 @@ -1,31 +1,22 @@
     8.4 -# SliTaz package receipt.
     8.5 +# SliTaz package receipt v2.
     8.6  
     8.7  PACKAGE="python-gdata"
     8.8 -VERSION="2.0.16"
     8.9 -CATEGORY="development"
    8.10 -SHORT_DESC="The Google Data APIs for Python."
    8.11 +VERSION="latest"
    8.12 +CATEGORY="python"
    8.13 +SHORT_DESC="Python client library for Google data APIs"
    8.14  MAINTAINER="pascal.bellard@slitaz.org"
    8.15  LICENSE="Apache"
    8.16 -WEB_SITE="http://http://code.google.com/p/gdata-python-client/"
    8.17 +WEB_SITE="https://pypi.org/project/gdata/"
    8.18  REPOLOGY="python:gdata"
    8.19  
    8.20 -SOURCE="gdata"
    8.21 -TARBALL="$SOURCE-$VERSION.tar.gz"
    8.22 -WGET_URL="http://gdata-python-client.googlecode.com/files/$TARBALL"
    8.23 +BUILD_DEPENDS="python"
    8.24  
    8.25 -DEPENDS="python"
    8.26 -BUILD_DEPENDS="python-dev python"
    8.27 -
    8.28 -# Rules to configure and make the package.
    8.29 -compile_rules()
    8.30 -{
    8.31 -	python setup.py build &&
    8.32 -	python setup.py install --root=$DESTDIR
    8.33 +compile_rules() {
    8.34 +	pip install --no-compile --root=$DESTDIR gdata
    8.35  }
    8.36  
    8.37 -# Rules to gen a SliTaz package suitable for Tazpkg.
    8.38 -genpkg_rules()
    8.39 -{
    8.40 -	mkdir -p $fs
    8.41 -	cp -a $install/usr $fs
    8.42 +genpkg_rules() {
    8.43 +	VERSION=$(sed -n '/^Successfully installed/ s|.*gdata-||p' $LOGS/$PACKAGE.log)
    8.44 +	copy @std
    8.45 +	DEPENDS="python"
    8.46  }
     9.1 --- a/python-pytz/receipt	Fri Aug 31 11:58:18 2018 +0300
     9.2 +++ b/python-pytz/receipt	Fri Aug 31 17:13:06 2018 +0300
     9.3 @@ -1,22 +1,31 @@
     9.4 -# SliTaz package receipt.
     9.5 +# SliTaz package receipt v2.
     9.6  
     9.7  PACKAGE="python-pytz"
     9.8  VERSION="latest"
     9.9  CATEGORY="development"
    9.10  SHORT_DESC="World Timezone Definitions for Python"
    9.11 -MAINTAINER="pascal.bellard@slitaz.org"
    9.12 +MAINTAINER="al.bobylev@gmail.com"
    9.13  LICENSE="MIT"
    9.14 -WEB_SITE="https://pypi.python.org/pypi/pytz"
    9.15 +WEB_SITE="https://pypi.org/project/pytz/"
    9.16  REPOLOGY="python:pytz"
    9.17  
    9.18 -BUILD_DEPENDS="python"
    9.19 +BUILD_DEPENDS="python python3"
    9.20 +SPLIT="python3-pytz:py3"
    9.21  
    9.22  compile_rules() {
    9.23 -	pip install --no-compile --root=$DESTDIR pytz
    9.24 +	case $SET in
    9.25 +		'')  pip='pip';;
    9.26 +		py3) pip='pip3';;
    9.27 +	esac
    9.28 +	$pip install --no-compile --root=$DESTDIR pytz
    9.29  }
    9.30  
    9.31  genpkg_rules() {
    9.32 -	VERSION=$(sed -n '/^Successfully installed/ s|.*pytz-||p' $LOGS/$PACKAGE.log)
    9.33 +	VERSION=$(find $install -type d -name 'pytz-*.dist-info' -exec basename '{}' \; \
    9.34 +	| sed 's|pytz-\(.*\)\.dist-info|\1|')
    9.35  	copy @std
    9.36 -	DEPENDS="python"
    9.37 +	case $PACKAGE in
    9.38 +		python-pytz)  DEPENDS="python";;
    9.39 +		python3-pytz) DEPENDS="python3";;
    9.40 +	esac
    9.41  }