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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
# Python versions
PY3DEF=$(shell py3versions -dv)
PY3VERS=$(shell py3versions -vr)
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
RUNTESTSOPTS=--shard_count=$(NUMJOBS)
endif
# In case matplotlib or anything else inquires
export HOME=$(CURDIR)/build
export MPLCONFIGDIR=$(CURDIR)/build
export PYBUILD_DESTDIR=debian/cython3
%:
dh $@ --buildsystem pybuild
override_dh_installman-arch: build/cython.1 build/cythonize.1 build/cygdb.1
dh_installman -a
build/cython.1:
: # Generate a manpage using help2man
echo ".so cython.1" >> build/cython3.1
PYTHONPATH=`/bin/ls -d $(CURDIR)/build/lib.*-$(PY3DEF)` \
help2man --no-info --no-discard-stderr \
-n "compile Cython code (.pyx) into C to build a Python extension" \
bin/cython >| build/cython.1
: # Verify that manpage generated nicely -- no Errors reported
grep -q 'ImportError:' build/cython.1 && exit 1 || :
build/cygdb.1:
: # Generate a manpage using help2man
echo ".so cygdb.1" >> build/cygdb3.1
PYTHONPATH=`/bin/ls -d $(CURDIR)/build/lib.*-$(PY3DEF)` \
help2man --no-info --no-discard-stderr \
-n "Run compiled Cython code under the GNU debugger" \
bin/cygdb >| build/cygdb.1
: # Verify that manpage generated nicely -- no Errors reported
grep -q 'ImportError:' build/cygdb.1 && exit 1 || :
build/cythonize.1:
: # Generate a manpage using help2man
echo ".so cythonize.1" >> build/cythonize3.1
PYTHONPATH=`/bin/ls -d $(CURDIR)/build/lib.*-$(PY3DEF)` \
help2man --no-info --no-discard-stderr \
-n "Compile Cython code (.pyx) into C to build a Python extension" \
bin/cythonize >| build/cythonize.1
: # Verify that manpage generated nicely -- no Errors reported
grep -q 'ImportError:' build/cythonize.1 && exit 1 || :
execute_after_dh_install-arch:
# add debian version to watermark of generated files
sed -i -e "s/ on / (Debian $(DEB_VERSION)) on /" \
debian/cython3/usr/lib/python3*/dist-packages/Cython/Compiler/Version.py
execute_after_dh_auto_build-indep:
: # Build Documentation
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
$(MAKE) -C docs html
endif
override_dh_installdocs:
dh_installdocs -pcython-doc --doc-main-package=cython3
dh_installdocs --remaining-packages
override_dh_installchangelogs:
dh_installchangelogs --all CHANGES.rst
override_dh_auto_test-arch:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))$(filter sparc64,$(DEB_HOST_ARCH)))
set -e; for P in $(PY3VERS); do \
echo =============== $$P start ===============; \
if PYTHONPATH=`/bin/ls -d $(CURDIR)/build/lib.*-$$P` \
/usr/bin/python$$P runtests.py $(RUNTESTSOPTS) \
--no-refnanny -v -v \
--exclude="(parallel|Debugger|annotate_html|numpy_test)" \
--work-dir=build/work-dir 2>&1; \
then \
echo =============== $$P done ===============; \
else \
echo "=============== $$P done (FAILURES IGNORED) ==============="; \
fi; \
done
endif
override_dh_auto_test-indep:
# no tests
override_dh_strip:
dh_strip --dbgsym-migration='cython3-dbg (<< 0.29.36-1~)'
execute_after_dh_python3:
# fix shebang lines
sed -i -e '1 s,#!.*python.*,#!/usr/bin/python3,' debian/cython3/usr/bin/*
execute_after_dh_auto_clean:
rm -rf docs/build
|