File: rules

package info (click to toggle)
cheetah 2.4.4-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,208 kB
  • sloc: python: 9,751; ansic: 445; makefile: 16
file content (36 lines) | stat: -rwxr-xr-x 1,280 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

# Prepare support for python 3.x (need to add Build-Depends against
# python3-all-dev in debian/control), pending upstream release with
# python3 support
# cdbs_python_supported_versions += $(shell py3versions -vr)

# Install egg-info directories
DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed \
	--install-layout=deb

DEB_PYTHON_BUILDDIR := $(CURDIR)/$(DEB_BUILDDIR)/build

binary-post-install/python-cheetah::
	sed -i 's#\#!/usr/bin/python[0-9].[0-9]#\#!/usr/bin/python#' \
		$(cdbs_python_destdir)usr/bin/*

	# Run the tests with all the versions of Python, but do not
	# fail if the tests fail, just display an error message
	#
	# Any better way to run the tests as this is very ugly?
	for buildver in $(cdbs_python_flavors:python%=%); do \
		echo "Running tests with python$$buildver..." && \
		cd $(DEB_SRCDIR) && \
		PATH=$(DEB_PYTHON_BUILDDIR)/scripts-$${buildver}:$$PATH \
		PYTHONPATH=$$(echo $(DEB_PYTHON_BUILDDIR)/lib.linux-*-$$buildver) \
		python$$buildver $(DEB_SRCDIR)/cheetah/Tests/Test.py || \
		echo "FAILED with python$$buildver"; \
	done