#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = "hardening=+all,-pie" export DEB_CFLAGS_MAINT_APPEND = -Wall export DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk DEB_COPYRIGHT_CHECK_IGNORE_REGEX := ^debian/(changelog|copyright(|_hints|_newhints))$$|.*[.](pyc)$$ DEB_PYTHON_DISTUTILS_INSTALLDIR_SKEL = /usr/lib/sequitur-g2p/@PYTHONBINARY@/dist-packages DEB_PYTHON2_MODULE_PACKAGES=sequitur-g2p BACKUP=setup.py clean:: # Backup files expected to be modified. set -e ; for i in $(BACKUP); do \ if [ ! -f "$$i".backup ]; then cp -a "$$i" "$$i".backup; fi ; \ done PYTHON_PATH=debian/$(cdbs_curpkg)/usr/lib/sequitur-g2p/$(shell pyversions -d)/dist-packages binary-post-install/sequitur-g2p:: sed -e 's-^#!/usr/bin/python2[.][[:digit:]]\+-#!/usr/bin/python-g' \ debian/$(cdbs_curpkg)/usr/bin/g2p.py \ | sed ':a;$$!{N;ba};s#\nimport#import sys\nsys.path.insert(0,"/usr/lib/sequitur-g2p/python"+str(sys.version_info[0])+"."+str(sys.version_info[1])+"/dist-packages")&#' \ > debian/$(cdbs_curpkg)/usr/bin/sequitur-g2p $(RM) debian/$(cdbs_curpkg)/usr/bin/g2p.py chmod 755 debian/$(cdbs_curpkg)/usr/bin/sequitur-g2p PYTHONPATH=$(PYTHON_PATH) help2man debian/$(cdbs_curpkg)/usr/bin/sequitur-g2p --no-info --name="grapheme-to-phoneme conversion tool" --version-string=0+r1668 > sequitur-g2p.1 [ -x /usr/bin/dh_numpy ] && dh_numpy || : include /usr/share/cdbs/1/rules/upstream-tarball.mk include /usr/share/cdbs/1/rules/utils.mk include /usr/share/cdbs/1/class/python-distutils.mk include /usr/share/cdbs/1/rules/debhelper.mk cdbs_python_supported_versions := $(cdbs_python_current_version) cdbs_python_builddeps = DEB_TAR_SRCDIR := . ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) binary-post-install/sequitur-g2p:: PYTHONPATH=$(PYTHON_PATH) python test_mGramCounts.py PYTHONPATH=$(PYTHON_PATH) python test_Minimization.py PYTHONPATH=$(PYTHON_PATH) python test_SequenceModel.py PYTHONPATH=$(PYTHON_PATH) python test_sequitur.py endif pre-build:: # Backup files expected to be modified. set -e ; for i in $(BACKUP); do \ if [ ! -f "$$i".backup ]; then cp -a "$$i" "$$i".backup; fi ; \ done sed -e 's/perpetually-alpha/$(DEB_UPSTREAM_VERSION)/' setup.py.backup > setup.py clean:: set -e ; for i in $(BACKUP); do \ if [ -f "$$i".backup ]; then mv -f "$$i".backup "$$i"; fi ; \ done $(RM) sequitur_.py sequitur_wrap.cpp sequitur-g2p.1 # Needed by upstream build process CDBS_BUILD_DEPENDS += , dpkg-dev (>= 1.16.1~), python-dev, python-numpy, swig, help2man, dh-python