#!/usr/bin/make -f # -*- makefile -*- #export DH_VERBOSE=1 export PYBUILD_NAME=s3ql DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) %: dh $@ --with python3,sphinxdoc --buildsystem=pybuild override_dh_auto_build: build_cython build_sphinx build_python build_cython: dh_testdir python3 setup.py build_cython touch $@ build_sphinx: build_inplace dh_testdir ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) python3 setup.py build_sphinx endif touch $@ build_inplace: build_cython python3 setup.py build_ext --inplace touch $@ build_python: build_cython dh_testdir python3-dbg setup.py build -g python3 setup.py build -g touch $@ override_dh_auto_install: dh_testdir dh_testroot dh_prep dh_installdirs # Note: Install non -dbg last, so that scripts don't get a -dbg interpreter python3-dbg setup.py install --force --root=debian/tmp \ --install-lib=/usr/lib/s3ql \ --install-scripts=/usr/lib/s3ql \ --no-compile -O0 --install-layout=deb python3 setup.py install --force --root=debian/tmp \ --install-lib=/usr/lib/s3ql \ --install-scripts=/usr/lib/s3ql \ --no-compile -O0 --install-layout=deb override_dh_auto_test: # pytest-trio is required, still not available in Debian #ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) # python3 setup.py build_ext --inplace # # Some tests will try to create log files in $HOME # mkdir -p debian/tmphome # HOME=$(CURDIR)/debian/tmphome py.test-3 --logdebug=s3ql.verify tests/ #endif override_dh_install: dh_install # Rename to avoid conflict with pcp package (cd debian/s3ql/usr/share/man/man1/; mv pcp.1 parallel-cp.1) # Install debugging extension and remove from regular package (cd debian/s3ql; \ find . -regextype posix-egrep -regex ".+\\.[a-z]+-[0-9]{2,}[a-z]*d[a-z]*-$(DEB_HOST_MULTIARCH)\\.so" \ -printf "%P\0" -delete) \ | xargs -0 dh_install --autodest -ps3ql-dbg # Link all executable files not ending in .py into /usr/bin mkdir -p debian/s3ql/usr/bin/ for entry in debian/s3ql/usr/lib/s3ql/*; do \ if [ -d "$$entry" ] || [ ! -x "$$entry" ] \ || [ "$${entry%.py}" != "$$entry" ]; then \ continue; \ fi; \ ln -s ../lib/s3ql/`basename "$$entry"` \ "debian/s3ql/usr/bin/`basename \"$$entry\"`"; \ done override_dh_link: rm -rf debian/s3ql-dbg/usr/share/doc/s3ql-dbg dh_link # We don't want to call setup.py clean, because this # requires a number of (potentially uninstalled) build-dependencies. override_dh_auto_clean: rm -rf build doc tests/test.log src/s3ql/deltadump.c contrib/*.1 find \( \( -name '*.egg-info' -type d \) \ -o \( -name __pycache__ -type d \) \ -o \( -name '*.so' -type f \) \ \) -prune -exec rm -rf '{}' + rm -rf build-python build_cython build_sphinx build-stamp rm -rf debian/tmphome override_dh_strip: ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) dh_strip -ps3ql --dbg-package=s3ql-dbg endif