#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 export PYBUILD_NAME=translate p = translate-toolkit d = $(CURDIR)/debian/$(p) d3 = $(CURDIR)/debian/python3-translate export PYTHONNOUSERSITE=false %: dh $@ --with python3,sphinxdoc --buildsystem pybuild execute_after_dh_clean: rm -rf man docs/_build run-tests .cache make -C docs clean execute_after_dh_auto_build: +$(MAKE) -C docs html execute_after_dh_auto_install: # delete unwanted cruft from /usr/lib for i in COPYING README.rst docs; do \ rm -rfv debian/*/usr/lib/python*/*-packages/translate/$$i \ debian/*/usr/lib/pyshared/translate/$$i; \ done # provide a link to the langmodels shipped in libexttextcat-data for i in debian/*/usr/lib/python*/*-packages/translate/; do \ rm -rfv $$i/share/langmodels; \ ln -s /usr/share/libexttextcat $$i/share/langmodels; \ done prename 's/\.sh$$//' debian/*/usr/bin/build_firefox.sh prename 's/\.py$$//' debian/*/usr/bin/*.py # move the command line tools to the translate-toolkit package mkdir -p $(d)/usr/bin mv $(d3)/usr/bin/* $(d)/usr/bin/ rm -rf $(d3)/usr/bin mkdir -p man for script in $(d)/usr/bin/*; do \ case $$(basename $$script) in \ buildxpi*|build_tmdb|build_firefox*|get_moz_enUS*|junitmsgfmt|mozfunny2prop|po2web2py|pocompendium|pomigrate2|popuretext|poreencode|posplit|pocount|poglossary|pocommentclean|prop2mozfunny|pydiff|tmserver) \ ;; \ *) \ LC_ALL=C PYTHONPATH=. $$script --manpage \ > man/$$(basename $$script).1 \ || rm -f man/$(basename $$script).1; \ ;; \ esac; \ done execute_after_dh_install: # The entry_points are created now, so run the test suite PYBUILD_BEFORE_TEST="cp -a translate/convert/test.* {build_dir}/translate/convert/" \ PYBUILD_TEST_ARGS="." \ PATH=$(d)/usr/bin:$$PATH \ dh_auto_test --buildsystem=pybuild # clean up left over pyc files find debian -type f -name '*.pyc' -delete override_dh_auto_test: # Tests must be run after install so that the entry_points scripts # have been created; override this and run tests as part of the install # step instead.