summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules103
1 files changed, 103 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 00000000..e0ea7b63
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,103 @@
+#!/usr/bin/make -f
+
+DOPACKAGES = $(shell dh_listpackages)
+export PYBUILD_DESTDIR=debian/tmp
+
+# Make it easier to build one machines with ansible << 2.10 installed.
+export ANSIBLE_SKIP_CONFLICT_CHECK=1
+
+%:
+# dh $@ --with python3,sphinxdoc --buildsystem=pybuild
+ dh $@ --with python3 --buildsystem=pybuild
+
+override_dh_clean:
+ dh_clean \
+ -X.bak \
+ -X.md~ \
+ -X.j2~ \
+ -X.py~ \
+ -X.txt~ \
+ -X.txt.orig \
+ -X.un~ \
+ -X.yaml~ \
+ -X.yml~
+
+override_dh_auto_build:
+ dh_auto_build
+ dh_auto_build --sourcedir=collections-debian-merged
+#ifneq (,$(filter ansible-doc,$(DOPACKAGES)))
+# # html documentation
+# $(MAKE) webdocs
+# # manpage documentation
+# $(MAKE) docs
+#endif
+
+override_dh_auto_test:
+ # For now, disable the tests
+ #make tests-nonet
+
+override_dh_python3:
+ dh_python3 --shebang=/usr/bin/python3
+
+execute_after_dh_auto_install:
+ find debian/tmp/ -depth -name '.git*' -exec rm -r {} +
+ find debian/tmp/ -depth -name '.*' -exec rm -r {} +
+ find debian/tmp/ -name '*~' -delete
+ find debian/tmp/ -name '*.bak' -delete
+ find debian/tmp/ -name '*.orig' -delete
+
+# NB: Source packages merged in bullseye (Debian 11)
+#
+# As a temporary measure, upstream sources ansible-base and ansible have been
+# merged in bullseye. The get-orig-source target implements this merge.
+#
+# The approach here is somewhat inflexible/hacky. It is assumed that it will be
+# only needed very rarely (as it happens in stable), so it gets the job done
+# without being too complicated and fancy.
+
+PKGDIR = $(abspath $(dir $(MAKEFILE_LIST)))/..
+BASEVER = $(shell sed -nre 's/ansible-base: ([.0-9]+)/\1/p' $(PKGDIR)/debian/merged.versions)
+COLLVER = $(shell sed -nre 's/ansible: ([.0-9]+)/\1/p' $(PKGDIR)/debian/merged.versions)
+RPCKDIR = ansible-$(COLLVER)+merged+dfsg
+
+get-orig-source:
+ # Download both tarballs
+ uscan \
+ --noconf \
+ --package=ansible \
+ --upstream-version=$(BASEVER) \
+ --watchfile=$(PKGDIR)/debian/watch.base \
+ --copyright-file=$(PKGDIR)/debian/copyright \
+ --verbose \
+ --rename \
+ --destdir=$(CURDIR) \
+ --check-dirname-level=0 \
+ --force-download \
+ --download-version=$(BASEVER)
+ uscan \
+ --noconf \
+ --package=ansible-collections \
+ --upstream-version=$(COLLVER) \
+ --watchfile=$(PKGDIR)/debian/watch \
+ --copyright-file=$(PKGDIR)/debian/copyright \
+ --verbose \
+ --rename \
+ --destdir=$(CURDIR) \
+ --check-dirname-level=0 \
+ --force-download \
+ --download-version=$(COLLVER)
+ # Extract both tarballs into the same base dir, with the second
+ # tarball in a subdir
+ mkdir -p $(RPCKDIR)/collections-debian-merged
+ tar -xJf ansible_$(BASEVER)+dfsg.orig.tar.xz \
+ --strip-components=1 \
+ -C $(RPCKDIR)
+ tar -xzf ansible-collections_$(COLLVER).orig.tar.gz \
+ --strip-components=1 \
+ -C $(RPCKDIR)/collections-debian-merged
+ # Get rid of the old tarballs
+ rm -f ansible_$(BASEVER)+dfsg.orig.tar.xz
+ rm -f ansible-collections_$(COLLVER).orig.tar.gz
+ # Repack the basedir as a single new tarball
+ tar -cJf ansible_$(COLLVER)+merged+base+$(BASEVER)+dfsg.orig.tar.xz --strip-components=1 $(RPCKDIR)
+ rm -rf $(RPCKDIR)