summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules50
1 files changed, 50 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..216359b
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,50 @@
+#!/usr/bin/make -f
+
+SHELL := sh -e
+
+VERSION := $(shell dpkg-parsechangelog -SVersion | sed -e 's|~dev|.dev|' -e 's|+.*||')
+
+%:
+ dh ${@} --buildsystem=pybuild --with=python3
+
+execute_after_dh_auto_clean:
+ rm -f RELEASE-VERSION
+
+ # help pybuild
+ for ITEM in $$(find . -type d -name "*.egg-info" -or -type f -name "*.egg"); \
+ do \
+ rm -rf "$${ITEM}"; \
+ done
+
+ # remove generated files
+ rm -rf deluge/plugins/*/build
+ rm -f deluge/ui/web/js/deluge-all-debug.js
+ rm -f deluge/ui/web/js/extjs/ext-extensions-debug.js
+ rm -f deluge/ui/web/js/gettext.js
+
+ for file in $$(find . -type f -name "*.in"); \
+ do \
+ rm -f "$$(dirname "$${file}")"/"$$(basename "$${file}" .in)"; \
+ done
+
+execute_before_dh_auto_build:
+ echo "$(VERSION)" > RELEASE-VERSION
+
+override_dh_auto_test:
+ # disabled
+
+execute_after_dh_auto_install:
+ # unpacking plugins
+ cd debian/tmp/usr/lib/python*/*-packages/deluge/plugins/; \
+ for EGG in *.egg; \
+ do \
+ mkdir -p $${EGG%-py?.*}.egg; \
+ unzip $${EGG} -d $${EGG%-py?.*}.egg; \
+ rm -f $${EGG}; \
+ done
+
+ # removing unused files
+ find debian/tmp -type d -name '__pycache__' | xargs rm -rf
+
+execute_after_dh_install:
+ if command -v dh_movetousr > /dev/null 2>&1; then dh_movetousr; fi