#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # # adapted by Logilab for automatic generation by debianize # (part of the devtools project, http://www.logilab.org/projects/devtools) # # Copyright (c) 2003-2010 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/python3/python.mk PACKAGE:=$(shell grep Package debian/control | cut -d ' ' -f2) #PACKAGE:=$(call py_pkgname,$(shell grep Package debian/control | cut -d ' ' -f2), python3.) %: dh --with python3 --without python2 $@ override_dh_auto_build: ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) # build doc $(MAKE) -C doc endif override_dh_install: NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ --root=$(CURDIR)/debian/$(PACKAGE)/ \ ${py_setup_install_args} # remove test directory rm -rf debian/$(PACKAGE)/usr/lib/python*/*-packages/logilab/common/test # rename pytest for python3k mv debian/$(PACKAGE)/usr/bin/pytest debian/$(PACKAGE)/usr/bin/pytest3 sed -i 's/python -u/python3 -u/' debian/$(PACKAGE)/usr/bin/pytest3 # don't install python2.X sources in this package rm -rf debian/$(PACKAGE)/usr/lib/python2.? override_dh_pysupport: dh_python3 --suggests=python3 override_dh_installdocs: dh_installdocs -i README* doc/apidoc/ dh_installchangelogs -i ChangeLog override_dh_auto_test: ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) # IMPORTANT: Install command was overriden by Logilab to install data test files. NO_SETUPTOOLS=1 python3 setup.py -q install --no-compile \ --root=$(CURDIR)/testing/ ${py_setup_install_args} # since "logilab.common" is a namespace package, we need to "simulate" it touch $(CURDIR)/testing/usr/lib/python3/dist-packages/logilab/__init__.py # use the default python version to select the script dir to run the tests PYTHONPATH=$(CURDIR)/testing/usr/lib/python3/dist-packages/ python3 $(CURDIR)/testing/usr/bin/pytest -t $(CURDIR)/testing/usr/lib/python3/dist-packages/logilab/common/test rm -f $(CURDIR)/testing/usr/lib/python3/dist-packages/logilab/__init__.py endif override_dh_compress: dh_compress -i -X.py -X.ini -X.xml -Xtest/ -Xapidoc/