From 775fea5ee58ab971fb8b0e4d3ff83a66d93c4f8d Mon Sep 17 00:00:00 2001 From: Stefan Hundhammer Date: Thu, 13 Oct 2016 15:28:37 +0200 Subject: [PATCH] Allow different .dsc files for Debian and Ubuntu --- Makefile.am | 32 ++++++++++++------- configure.ac | 3 +- debian/.gitignore | 2 ++ ...napper.dsc.in => snapper-Debian.dsc.in.in} | 4 +-- debian/snapper-xUbuntu.dsc.in.in | 13 ++++++++ 5 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 debian/.gitignore rename debian/{snapper.dsc.in => snapper-Debian.dsc.in.in} (78%) create mode 100644 debian/snapper-xUbuntu.dsc.in.in diff --git a/Makefile.am b/Makefile.am index 11c8f833..f69c43b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,7 +15,9 @@ snapper-$(VERSION).tar.bz2: dist-bzip2 DEBIAN_FLAVOURS = \ Debian_7.0 \ - Debian_8.0 \ + Debian_8.0 + +UBUNTU_FLAVOURS = \ xUbuntu_14.04 \ xUbuntu_14.10 \ xUbuntu_15.04 \ @@ -25,36 +27,42 @@ DEBIAN_FLAVOURS = \ show-debian: @echo "Debian flavors: $(DEBIAN_FLAVOURS)" +show-ubuntu: + @echo "Ubuntu flavors: $(UBUNTU_FLAVOURS)" + package-clean: rm -f package/snapper-*.tar.bz2 rm -f package/debian.* - rm -f package/*.dsc + rm -f package/*.dsc* # Create all the files necessary for building the package with OBS: # # - Clean up the package/ directory # - create a new tarball (via the depencency) # - copy the content of the debian/ directory -# - generate a master .dsc file with the "Files:" line for the tarball -# with its md5sum, file size in bytes, and name -# - copy that .dsc master file for each flavor of Debian to be supported -# - remove the .dsc master file and the .dsc.in file +# - for both Debian and Ubuntu, generate a master .dsc.in from file with the +# "Files:" line for the tarball with its md5sum, file size in bytes, and name +# - copy that .dsc.in master file for each flavor of Debian or Ubuntu to be supported +# - remove the .dsc.in master file and the .dsc.in.in file # - move the new tarball to the package/ directory # # Unfortunately, using variables for the md5sum and the file size didn't work out # (not even with the GNU make ':=' syntax): They cannot be assigned in the 'actions' # part of a rule, only outside rules. # -# The debian/snapper.dsc file is generated by autoconf (see configure.ac) from -# debian/snapper.dsc.in with @VERSION@ expanded with the content of -# $toplevel/VERSION. +# The .dsc files are generated from a .dsc.in file for each Debian and Ubuntu, +# which in turn are generated by configure/autoconf from .dsc.in.in files (see +# configure.ac) where @VERSION@ is expanded with the content of the toplevel +# VERSION file. # # $< is the first depencency of the rule, i.e. snapper-$(VERSION).tar.gz in this case. # package: snapper-$(VERSION).tar.bz2 package-clean cp debian/* package/ - echo "$(shell md5sum $< | sed -e 's/\s.*//') $(shell wc -c $<)" >>package/snapper.dsc - for DEB in $(DEBIAN_FLAVOURS); do cp -v package/snapper.dsc package/snapper-$${DEB}.dsc; done - rm package/snapper.dsc* + echo "$(shell md5sum $< | sed -e 's/\s.*//') $(shell wc -c $<)" >>package/snapper-Debian.dsc.in + echo "$(shell md5sum $< | sed -e 's/\s.*//') $(shell wc -c $<)" >>package/snapper-xUbuntu.dsc.in + for FLAV in $(DEBIAN_FLAVOURS); do cp -v package/snapper-Debian.dsc.in package/snapper-$${FLAV}.dsc; done + for FLAV in $(UBUNTU_FLAVOURS); do cp -v package/snapper-xUbuntu.dsc.in package/snapper-$${FLAV}.dsc; done + rm package/snapper*.dsc.in* mv snapper-$(VERSION).tar.bz2 package/ diff --git a/configure.ac b/configure.ac index 33ce6eb3..f8199b06 100644 --- a/configure.ac +++ b/configure.ac @@ -183,5 +183,6 @@ AC_OUTPUT( testsuite-real/Makefile testsuite-cmp/Makefile package/snapper.spec:snapper.spec.in - debian/snapper.dsc:debian/snapper.dsc.in + debian/snapper-Debian.dsc.in:debian/snapper-Debian.dsc.in.in + debian/snapper-xUbuntu.dsc.in:debian/snapper-xUbuntu.dsc.in.in ) diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 00000000..4a1b8072 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,2 @@ +snapper*.dsc.in + diff --git a/debian/snapper.dsc.in b/debian/snapper-Debian.dsc.in.in similarity index 78% rename from debian/snapper.dsc.in rename to debian/snapper-Debian.dsc.in.in index 0ffc23c0..8e01f550 100644 --- a/debian/snapper.dsc.in +++ b/debian/snapper-Debian.dsc.in.in @@ -6,8 +6,8 @@ Maintainer: Arvin Schnell Architecture: any Build-Depends: debhelper (>= 4.1.16), acl-dev, g++, libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-test-dev, libxml2-dev, libz-dev, libdbus-1-dev, libpam-dev, xsltproc, docbook-xsl, locales-all # -# The 'Files' line is generated during 'make debian-package': +# The 'Files' line is generated during 'make package': # Files: # 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz -# md5sum size filename +# Files: diff --git a/debian/snapper-xUbuntu.dsc.in.in b/debian/snapper-xUbuntu.dsc.in.in new file mode 100644 index 00000000..401b4f0d --- /dev/null +++ b/debian/snapper-xUbuntu.dsc.in.in @@ -0,0 +1,13 @@ +Format: 1.0 +Source: snapper +Version: @VERSION@ +Binary: snapper +Maintainer: Arvin Schnell +Architecture: any +Build-Depends: debhelper (>= 4.1.16), acl-dev, g++, libboost-dev, libboost-thread-dev, libboost-system-dev, libboost-test-dev, libxml2-dev, libz-dev, libdbus-1-dev, libpam-dev, xsltproc, docbook-xsl, language-pack-en, language-pack-de +# +# The 'Files' line is generated during 'make package': +# Files: +# 423a20ae6e882d44e65a4eff97f2269f 630905 snapper-0.2.8.tar.gz +# +Files: -- 2.47.3