summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdebian/rules29
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..cbf6dc7
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,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'