File: rules

package info (click to toggle)
python-aiosmtpd 1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 464 kB
  • sloc: python: 3,254; makefile: 35
file content (46 lines) | stat: -rwxr-xr-x 1,613 bytes parent folder | download
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
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
export DH_VERBOSE = 1

export PYBUILD_NAME=aiosmtpd
export PYBUILD_AFTER_INSTALL=mv '{destdir}/{install_dir}/examples' \
	'{destdir}/usr/share/doc/python3-aiosmtpd/examples_{version}'
export PYBUILD_BEFORE_TEST=cp -a '{build_dir}/aiosmtpd/tests/certs/server.key' \
	'{build_dir}/aiosmtpd/tests/certs/server.crt' '/tmp/old' && \
	cp -f /tmp/new/server.key /tmp/new/server.crt \
	'{build_dir}/aiosmtpd/tests/certs'
export PYBUILD_AFTER_TEST=cp -fa '/tmp/old/server.key' '/tmp/old/server.crt' \
	'{build_dir}/aiosmtpd/tests/certs'

# main packaging script based on dh7 syntax
%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_install:
	dh_auto_install
	find debian/python3-aiosmtpd/usr/share/doc/python3-aiosmtpd -maxdepth 2 -type d -name "__pycache__" -exec rm -rf {} \;

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	mkdir -p /tmp/new
	mkdir -p /tmp/old
	openssl req -x509 -newkey rsa:4096 \
	-keyout '/tmp/new/server.key' \
	-out '/tmp/new/server.crt' \
	-days 365 -nodes -subj '/CN=localhost'
	dh_auto_test
endif

override_dh_installdocs:
	PYTHONPATH=. python3 -m sphinx -N -q -E -c ./ -b html . debian/compiled_doc/temp
	mv debian/compiled_doc/temp/aiosmtpd/docs debian/compiled_doc/html
	dh_installdocs

override_dh_installman:
	mkdir -p debian/compiled_doc/manpage
	rst2man aiosmtpd/docs/manpage.rst > debian/compiled_doc/manpage/aiosmtpd.man
	dh_installman

override_dh_installchangelogs:
	dh_installchangelogs aiosmtpd/docs/NEWS.rst