[sagemath] 02/03: Automatically generate rules for per-language doc packages

Ximin Luo infinity0 at debian.org
Sun Oct 16 20:52:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagemath.

commit 8193190d6ca3476d0f0fc8b45ebc3475b3978fde
Author: Ximin Luo <infinity0 at debian.org>
Date:   Sun Oct 16 22:10:26 2016 +0200

    Automatically generate rules for per-language doc packages
---
 debian/.gitignore                   |  4 ++++
 debian/{control => control.in}      |  0
 debian/rules                        | 19 +++++++++++++++++--
 debian/sagemath-doc-LANG.control.in |  5 +++++
 debian/sagemath-doc-LANG.install.in |  3 +++
 5 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/debian/.gitignore b/debian/.gitignore
index 93ed7a1..c1f89e5 100644
--- a/debian/.gitignore
+++ b/debian/.gitignore
@@ -3,3 +3,7 @@
 /pruner/config.*
 /pruner/pruner.py
 /pruner/autom4te.cache
+/sagemath-doc-*.install
+/sagemath-doc-*.control
+/control
+!/*.in
diff --git a/debian/control b/debian/control.in
similarity index 100%
rename from debian/control
rename to debian/control.in
diff --git a/debian/rules b/debian/rules
index 1c5fe06..ab600af 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,9 +26,24 @@ endif
 export SAGE_LOCAL = $(shell pwd)/debian/tmp/usr
 export PYTHONPATH = $(shell pwd)/debian/tmp/usr/lib/python2.7/dist-packages
 
+LANGS = $(shell cd sage/src/doc && find . -mindepth 1 -maxdepth 1 -type d | grep -v common | cut -b3-)
+DOCS_INSTALL = $(LANGS:%=debian/sagemath-doc-%.install)
+DOCS_CONTROL = $(LANGS:%=debian/sagemath-doc-%.control)
+
 %:
 	dh $@ --parallel
 
+gencontrol: $(DOCS_INSTALL) debian/control
+
+debian/control: debian/control.in $(DOCS_CONTROL)
+	cat $^ > "$@"
+
+debian/sagemath-doc-%.control: debian/sagemath-doc-LANG.control.in debian/rules
+	sed -e 's/LANG/$*/g' < "$<" > "$@"
+
+debian/sagemath-doc-%.install: debian/sagemath-doc-LANG.install.in debian/rules
+	sed -e 's/LANG/$*/g' < "$<" > "$@"
+
 override_dh_auto_build: prune
 	$(MAKE) --directory=sage $(DEB_BUILD_TARGET)
 
@@ -71,7 +86,7 @@ endif
 clean-docbuild:
 	rm -rf debian/tmp/usr/share/doc/sage
 
-reset: clean clean-docbuild
+reset: gencontrol clean clean-docbuild
 	QUILT_PATCHES=debian/patches quilt pop -af || true
 	cd sage; git clean -fdx && git submodule update --force
 	QUILT_PATCHES=debian/patches quilt push -a
@@ -87,4 +102,4 @@ build-dep:
 failed-tests:
 	grep "Failed example:" sage/logs/ptestlong.log | awk '{s++} END {print s}'
 
-.PHONY: clean-doc-build reset build-dep
+.PHONY: gencontrol ptestlong clean-doc-build reset build-dep gencontrol
diff --git a/debian/sagemath-doc-LANG.control.in b/debian/sagemath-doc-LANG.control.in
new file mode 100644
index 0000000..5091fde
--- /dev/null
+++ b/debian/sagemath-doc-LANG.control.in
@@ -0,0 +1,5 @@
+
+Package: sagemath-doc-LANG
+Architecture: all
+Description: Documentation for SageMath (LANG)
+Depends: ${misc:Depends}
diff --git a/debian/sagemath-doc-LANG.install.in b/debian/sagemath-doc-LANG.install.in
new file mode 100644
index 0000000..cc93d0f
--- /dev/null
+++ b/debian/sagemath-doc-LANG.install.in
@@ -0,0 +1,3 @@
+debian/tmp/usr/share/doc/sage/doctrees/LANG    /usr/share/doc/sage/doctrees/
+debian/tmp/usr/share/doc/sage/html/LANG        /usr/share/doc/sage/html/
+debian/tmp/usr/share/doc/sage/inventory/LANG   /usr/share/doc/sage/inventory/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list