add support for multiple substitutions
authormirabilos <t.glaser@tarent.de>
Sat, 2 Dec 2017 23:47:37 +0000 (00:47 +0100)
committermirabilos <t.glaser@tarent.de>
Sat, 2 Dec 2017 23:47:37 +0000 (00:47 +0100)
debian/control.in
debian/rules

index f3c28d7..84ae1d8 100644 (file)
@@ -3,7 +3,7 @@ Section: editors
 Priority: optional
 Maintainer: Thorsten Glaser <tg@mirbsd.de>
 Homepage: https://www.mirbsd.org/jupp.htm
-Build-Depends: @@DEPS@@
+Build-Depends: @@DSC_DEPS@@
 Standards-Version: 4.1.2
 VCS-git: https://anonscm.debian.org/git/collab-maint/jupp.git -b master
 VCS-Browser: https://anonscm.debian.org/cgit/collab-maint/jupp.git/?h=master
index 354f9fb..9e509df 100755 (executable)
@@ -120,6 +120,7 @@ EXTRA_LDFLAGS=              -Wl,--as-needed
 # 5 is enough
 DEBHELPER_VERSION:=    9
 DSC_DEPS:=             debhelper (>= ${DEBHELPER_VERSION})
+SUBST_VARS+=           DSC_DEPS
 
 ifeq (${USE_LIBC},dietlibc)
 DSC_DEPS:=             ${DSC_DEPS}, dietlibc-dev
@@ -257,10 +258,12 @@ debian/.control_stamp:
                exit 1; \
        fi)
        echo ${DEBHELPER_VERSION} >debian/compat
-       sed -e 's\ 1@@DEPS@@\ 1$(strip ${DSC_DEPS})\ 1' \
+       sed \
+           $(foreach v,${SUBST_VARS},-e 's\ 1@@'$(call shellescape,$v)'@@\ 1'$(call shellescape,$(strip ${$v}))'\ 1') \
            <debian/control.in >debian/.gencontrol_stamp
        : bail out if these differ: in those cases,
-       : you are to regenerate debian/control and retry
+       : retry the build, after regenerating debian/control
+       : with cp debian/.gencontrol_stamp debian/control
        diff -Nu debian/control debian/.gencontrol_stamp
        @:>$@