diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-04-24 19:02:11 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-04-24 19:02:11 +0200 |
| commit | 7ba5f4686ddea5076f086d54e68dd407bff32147 (patch) | |
| tree | 49ccb65645cfd7e0c0900b07710f65adc5bacf87 | |
| parent | 55eaca76738417f719c1e3b66da94c7307308d74 (diff) | |
| download | python-apt-7ba5f4686ddea5076f086d54e68dd407bff32147.tar.gz | |
* debian/rules: Support multiple PY3K versions.
Introduce PY3K_VERSIONS, a list of all py3k versions the package should
be built for. The default is to build for the currently installed versions.
Introduce 2TO3_VERSION to select a 2to3 version which will convert the
python code to python 3. Points to the latest version by default.
| -rwxr-xr-x | debian/rules | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/debian/rules b/debian/rules index 5fc6e13b..7a6ff690 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,9 @@ DEB_PYTHON_PACKAGES_EXCLUDE=python-apt-dbg include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/python-distutils.mk -PY3K = y +PY3K_VERSIONS := $(shell find /usr/bin/python3.? | sed s/.*python//) +2TO3_VERSION := $(lastword $(PY3K_VERSIONS)) + PKG=python-apt DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p') DEB_COMPRESS_EXCLUDE:=.html .js _static/* _sources/* _sources/*/* .inv @@ -21,17 +23,20 @@ DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us export CFLAGS+=-DCOMPAT_0_7 export DEBVER - -ifeq ($(PY3K),y) build/python-apt:: - python3.1 setup3.py build + set -e; for i in $(PY3K_VERSIONS); do \ + python$$i setup3.py build; \ + done install/python-apt:: - python3.1 ./setup3.py install --root $(CURDIR)/debian/python-apt \ - --install-layout=deb --no-compile + set -e; for i in $(PY3K_VERSIONS); do \ + python$$i ./setup3.py install --root $(CURDIR)/debian/python-apt \ + --install-layout=deb --no-compile; \ + done - find $(CURDIR)/debian/python-apt/usr/lib/python3.1/dist-packages/ -name '*.py' \ - | xargs 2to3-3.1 | patch -p0 +ifneq ($(PY3K_VERSIONS),) + find $(CURDIR)/debian/python-apt/usr/lib/python3*/dist-packages/ -name '*.py' \ + | xargs 2to3-$(2TO3_VERSION)| patch -p0 endif build/python-apt-dbg:: @@ -39,25 +44,29 @@ build/python-apt-dbg:: for i in $(cdbs_python_build_versions); do \ python$$i-dbg ./setup.py build; \ done -ifeq ($(PY3K),y) - python3.1-dbg ./setup3.py build -endif + set -e; for i in $(PY3K_VERSIONS); do \ + python$$i-dbg setup3.py build; \ + done + install/python-apt-dbg:: for i in $(cdbs_python_build_versions); do \ python$$i-dbg ./setup.py install --root $(CURDIR)/debian/python-apt-dbg \ --no-compile; \ done -ifeq ($(PY3K),y) - python3.1-dbg ./setup3.py install --root $(CURDIR)/debian/python-apt-dbg \ - --install-layout=deb --no-compile -endif + + set -e; for i in $(PY3K_VERSIONS); do \ + python$$i-dbg ./setup3.py install --root $(CURDIR)/debian/python-apt-dbg \ + --install-layout=deb --no-compile; \ + done + find debian/python-apt-dbg \ ! -type d ! -name '*_d.so' | xargs rm -f find debian/python-apt-dbg -depth -empty -exec rmdir {} \; binary-predeb/python-apt:: - ln -sf ../../../../javascript/jquery/jquery.js debian/python-apt/usr/share/doc/python-apt/html/_static/jquery.js + ln -sf ../../../../javascript/jquery/jquery.js \ + debian/python-apt/usr/share/doc/python-apt/html/_static/jquery.js binary-predeb/python-apt-dbg:: rm -rf debian/python-apt-dbg/usr/share/doc/python-apt-dbg |
