HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/python-apt/debian/rules
#!/usr/bin/make -f
# Should be include-links, but that somehow fails.
export DEBVER=$(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
export DATETIME:=$(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')
export DATE_CMD:=env TZ=UTC LC_ALL=C.UTF-8 date
export DATE:=$(shell $(DATE_CMD) --date="$(DATETIME)" "+%b %_d %Y")
export TIME:=$(shell $(DATE_CMD) --date="$(DATETIME)" "+%H:%M:%S")
export DEB_CFLAGS_MAINT_APPEND=-Wno-write-strings \
                               -DDATE=\""$(DATE)"\" \
                               -DTIME=\""$(TIME)"\"
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export PYBUILD_NAME=apt

BUILDDIR3 := $(shell pybuild --print build_dir --interpreter python3)

%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=$(BUILDDIR3) sphinx-build doc/source build/sphinx/html

# this is nasty. instead of installing the files to one dir, overriding
# common ones, and then us picking out the files we want, we have to move some
# files from python3-apt to python-apt-common and then delete it from other
# packages.
override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/python-apt-common/usr/share/
	mv debian/python3-apt/usr/share/locale debian/python-apt-common/usr/share/
	mv debian/python3-apt/usr/share/python-apt debian/python-apt-common/usr/share/
	rmdir debian/python3-apt/usr/share

override_dh_installdocs:
	dh_installdocs -p python3-apt --link-doc=python3-apt
	dh_installdocs --remaining-packages

override_dh_strip:
	dh_strip -p python3-apt
	
override_dh_compress:
	dh_compress -X.js -X_static/* -X _sources/* -X_sources/*/* -X.inv

# We ignore failures on hurd, since its locking is broken
override_dh_auto_test: export PYBUILD_SYSTEM=custom
override_dh_auto_test: export PYBUILD_TEST_ARGS=env PYTHONPATH={build_dir} {interpreter} tests/test_all.py
override_dh_auto_test:
	dh_auto_test || [ "$(DEB_BUILD_ARCH_OS)" = "hurd" ];