summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: cbf6dc7c9d69476f690d194d49682f90233b67b8 (plain)
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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

export PYBUILD_NAME=netaddr
export LC_ALL=C.UTF-8

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

# Replace EUI files with the appropriate symlinks
override_dh_link: dh_link/python3-netaddr
	dh_link
python_module_path=usr/lib/python*/dist-packages
dh_link/python3-netaddr:
	rm debian/$(@:dh_link/%=%)/$(python_module_path)/netaddr/eui/iab.*
	rm debian/$(@:dh_link/%=%)/$(python_module_path)/netaddr/eui/oui.*
	ln -s /var/lib/ieee-data/oui.txt debian/$(@:dh_link/%=%)/$(python_module_path)/netaddr/eui/
	ln -s /var/lib/ieee-data/iab.txt debian/$(@:dh_link/%=%)/$(python_module_path)/netaddr/eui/
	PYTHONPATH=$(CURDIR) python3 \
		debian/$(@:dh_link/%=%)/$(python_module_path)/netaddr/eui/ieee.py

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3

# Tests
override_dh_auto_test:
	localehelper LANG=en_US.UTF-8 dh_auto_test -- \
		--system=custom \
		--test-args='{interpreter} -m pytest netaddr/tests -v'