Commit 4421abba authored by Julien Cristau's avatar Julien Cristau
Browse files

[debian] unify packaging

Build a python3 package if we have at least 3.3.
parent ac183e73c79e
Source: logilab-mtconverter
Section: python
Priority: optional
Maintainer: Logilab S.A. <contact@logilab.fr>
Uploaders: Sylvain Thenault <sylvain.thenault@logilab.fr>,
Aurélien Campéas <aurelien.campeas@logilab.fr>
Build-Depends: debhelper (>= 9), python-all, python3-all
#, python-logilab-common, python-lxml, python-imaging, poppler-utils
Standards-Version: 3.9.6
Homepage: http://www.logilab.org/project/logilab-mtconverter
Vcs-Hg: http://hg.logilab.org/logilab/mtconverter
Vcs-Browser: http://hg.logilab.org/logilab/mtconverter
Package: python-logilab-mtconverter
Architecture: all
Depends: ${python:Depends}, ${misc:Depends}, python-logilab-common
Suggests: python-imaging, python-pygments, poppler-utils, lynx, python-chardet, python-lxml
Description: library to convert from a MIME type to another
This package originally a backport of Zope's PortalTransforms tool with
all Zope's internal removed (e.g. most of the code).
Package: python3-logilab-mtconverter
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}, python3-logilab-common
Suggests: python3-imaging, python3-pygments, poppler-utils, lynx, python3-chardet
Description: library to convert from a MIME type to another
This package originally a backport of Zope's PortalTransforms tool with
all Zope's internal removed (e.g. most of the code).
#!/usr/bin/make -f
# -*- makefile -*-
#
# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/python/python.mk
PYLIB:=$(call py_libdir,$(shell pyversions -d))
PACKAGE:=$(call py_pkgname,python-logilab-mtconverter,python)
PYLIB3:=$(call py_libdir,python3.)
PACKAGE3:=$(call py_pkgname,python-logilab-mtconverter,python3.)
%:
dh $@ --with python2,python3
override_dh_auto_install:
NO_SETUPTOOLS=1 python setup.py -q install --no-compile \
--root=$(CURDIR)/debian/$(PACKAGE)/ \
${py_setup_install_args}
NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \
--root=$(CURDIR)/debian/$(PACKAGE3)/ \
${py_setup_install_args}
# remove sub-package __init__ file
rm $(CURDIR)/debian/$(PACKAGE)/$(PYLIB)/logilab/__init__.py
rm $(CURDIR)/debian/$(PACKAGE3)/$(PYLIB3)/logilab/__init__.py
# remove test directory
rm -r $(CURDIR)/debian/$(PACKAGE)/$(PYLIB)/logilab/mtconverter/test
rm -r $(CURDIR)/debian/$(PACKAGE3)/$(PYLIB3)/logilab/mtconverter/test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# PYTHON 2.X + PYTHON 3.2
endif
override_dh_installdocs:
dh_installchangelogs -A -i ChangeLog
dh_installdocs -A -i README*
Source: logilab-mtconverter
Section: python
Priority: optional
Maintainer: Sylvain Thenault <sylvain.thenault@logilab.fr>
Maintainer: Logilab S.A. <contact@logilab.fr>
Uploaders: Sylvain Thenault <sylvain.thenault@logilab.fr>
Build-Depends:
debhelper (>= 9),
python (>= 2.6.5),
python3-all,
X-Python-Version: >= 2.6
X-Python3-Version: >= 3.3
Standards-Version: 3.9.6
Homepage: https://www.logilab.org/project/logilab-mtconverter
Vcs-Hg: http://hg.logilab.org/master/logilab/mtconverter
Vcs-Browser: http://hg.logilab.org/master/logilab/mtconverter
Package: python-logilab-mtconverter
Architecture: all
Depends:
${python:Depends},
${misc:Depends},
python-logilab-common,
python-six,
python-logilab-common,
Suggests: python-imaging, python-pygments, pdftotext, lynx, python-chardet
Homepage: http://www.logilab.org/project/mtconverter
Description: a library to convert from a MIME type to another
This package originally a backport of Zope's PortalTransforms tool with
all Zope's internal removed (e.g. most of the code).
Description: library to convert from a MIME type to another
This package was originally a backport of Zope's PortalTransforms tool with
all Zope's internal removed (i.e. most of the code).
Package: python3-logilab-mtconverter
Architecture: all
Depends:
python3-six,
python3-logilab-common,
${python3:Depends},
${misc:Depends},
Suggests: python3-pil, python3-pygments, poppler-utils, lynx, python3-chardet
Description: library to convert from a MIME type to another
This package was originally a backport of Zope's PortalTransforms tool with
all Zope's internal removed (i.e. most of the code).
.
This package contains the Python3 version of the library.
......@@ -11,56 +11,24 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
build: build-stamp
build-stamp:
dh_testdir
NO_SETUPTOOLS=1 python setup.py -q build
touch build-stamp
export NO_SETUPTOOLS=1
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
rm -rf build
find . -name "*.pyc" | xargs rm -f
rm -f changelog.gz
dh_clean
include /usr/share/python/python.mk
# don't build the python3 package if python3 is < 3.3
py3k = $(subst python3.,,$(shell py3versions -d))
build_py3k = $(shell test "$(py3k)" -gt 2 && echo 1)
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
NO_SETUPTOOLS=1 python setup.py -q install --no-compile --prefix=debian/python-logilab-mtconverter/usr/
# remove sub-package __init__ file (created in postinst)
rm debian/python-logilab-mtconverter/usr/lib/python*/site-packages/logilab/__init__.py
# remove test directory (installed in in the doc directory)
rm -rf debian/python-logilab-mtconverter/usr/lib/python*/site-packages/logilab/mtconverter/test
# install tests
(cd test && find . -type f -not \( -path '*/CVS/*' -or -name '*.pyc' \) -exec install -D --mode=644 {} ../debian/python-logilab-mtconverter/usr/share/doc/python-logilab-mtconverter/test/{} \;)
ifeq (,$(build_py3k))
DH_OPTIONS += -Npython3-logilab-mtconverter
export DH_OPTIONS
endif
install-python%:
python$* setup.py install --prefix=$(CURDIR)/debian/tmp
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_install -i
dh_python2 -i
gzip -9 -c ChangeLog > changelog.gz
dh_installchangelogs -i
dh_installexamples -i
dh_installdocs -i changelog.gz
dh_installman -i
dh_link -i
dh_compress -i -X.py -X.ini -X.xml -Xtest
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch:
binary: binary-indep
.PHONY: build clean binary binary-indep binary-arch
override_dh_auto_install: $(foreach python, $(shell py3versions -r), install-$(python))
dh_auto_install
rm -f debian/tmp/usr/lib/python*/*/logilab/__init__.py
%:
dh $@ --with python2,python3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment