From f83f9e81b02c6778d79ab31f086e8a1a40f8dc9d Mon Sep 17 00:00:00 2001 From: Carlos Maddela Date: Mon, 14 Aug 2017 23:15:27 +1000 Subject: [PATCH 1/4] Use complete Debian revision number as build number Use complete Debian revision number as build number, instead of just the numeric part. Also, re-implement scripts/time-stamper.bash without direct calls to dpkg-parsechangelog. --- debian/changelog | 10 ++ .../patches/14-make-builds-reproducible.patch | 113 ++++++++++++++++-- ...-fix-all-but-deprecated-api-warnings.patch | 2 +- .../27-allow-opening-in-browser-again.patch | 4 +- debian/patches/29-fix-more-typos.patch | 6 +- ...31-improve-hurd-and-kfreebsd-support.patch | 2 +- debian/rules | 1 + 7 files changed, 123 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index f618a5e..d931199 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +dvdisaster (0.79.5-4) UNRELEASED; urgency=medium + + * Team upload. + * Use complete Debian revision number as build number, instead of + just the numeric part. + * Re-implement scripts/time-stamper.bash without direct calls to + dpkg-parsechangelog. + + -- Carlos Maddela Mon, 14 Aug 2017 23:04:38 +1000 + dvdisaster (0.79.5-3) unstable; urgency=medium * Team upload. diff --git a/debian/patches/14-make-builds-reproducible.patch b/debian/patches/14-make-builds-reproducible.patch index d93e63e..b448716 100644 --- a/debian/patches/14-make-builds-reproducible.patch +++ b/debian/patches/14-make-builds-reproducible.patch @@ -7,15 +7,111 @@ Description: Make builds reproducible. so that we can make reproducible binaries. Author: Carlos Maddela Forwarded: not-needed -Last-Update: 2016-12-19 +Last-Update: 2017-08-14 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- - scripts/time-stamper.bash | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + build.c | 2 +- + closure.c | 2 +- + dvdisaster.h | 2 +- + locale/cs.po | 4 ++-- + locale/pt_BR.po | 4 ++-- + locale/ru.po | 4 ++-- + scripts/time-stamper.bash | 8 ++++---- + 7 files changed, 13 insertions(+), 13 deletions(-) +diff --git a/build.c b/build.c +index 1666795..05a3b24 100644 +--- a/build.c ++++ b/build.c +@@ -25,4 +25,4 @@ + /* build is incremented at each make; + make recompile of dependent file as fast as possible */ + +-int buildCount = BUILD; ++const char *const buildCount = BUILD; +diff --git a/closure.c b/closure.c +index 7568cba..51e91a2 100644 +--- a/closure.c ++++ b/closure.c +@@ -433,7 +433,7 @@ void InitClosure() + #define BITNESS_STRING "" + #endif + +- Closure->versionString = g_strdup_printf("dvdisaster %s build %d, %s%s", ++ Closure->versionString = g_strdup_printf("dvdisaster %s build %s, %s%s", + Closure->cookedVersion, buildCount, SYS_NAME, BITNESS_STRING); + + /* Replace the dot with a locale-resistant separator */ +diff --git a/dvdisaster.h b/dvdisaster.h +index db2031e..bcfd4f5 100644 +--- a/dvdisaster.h ++++ b/dvdisaster.h +@@ -450,7 +450,7 @@ void FreeBitmap(Bitmap*); + *** build.h + ***/ + +-int buildCount; ++extern const char *const buildCount; + + /*** + *** cacheprobe.h +diff --git a/locale/cs.po b/locale/cs.po +index ed1fc65..24b1e7c 100644 +--- a/locale/cs.po ++++ b/locale/cs.po +@@ -6476,11 +6476,11 @@ msgstr "Novinky v této verzi:" + + #~ msgid "" + #~ "\n" +-#~ "dvdisaster version %s build %d\n" ++#~ "dvdisaster version %s build %s\n" + #~ "\n" + #~ msgstr "" + #~ "\n" +-#~ "dvdisaster verze %s sestavení %d\n" ++#~ "dvdisaster verze %s sestavení %s\n" + #~ "\n" + + #~ msgid "--prefetch-sectors must be in range 32...8096" +diff --git a/locale/pt_BR.po b/locale/pt_BR.po +index 04b33b5..012ce9e 100644 +--- a/locale/pt_BR.po ++++ b/locale/pt_BR.po +@@ -6200,11 +6200,11 @@ msgstr "Novidades dessa versão:" + + #~ msgid "" + #~ "\n" +-#~ "dvdisaster version %s build %d\n" ++#~ "dvdisaster version %s build %s\n" + #~ "\n" + #~ msgstr "" + #~ "\n" +-#~ "dvdisaster, versão %s build %d\n" ++#~ "dvdisaster, versão %s build %s\n" + + #~ msgid "--cache-size maximum is 8192MiB." + #~ msgstr "--cache-size máximo é 8192MiB." +diff --git a/locale/ru.po b/locale/ru.po +index 6cd3789..912d6fb 100644 +--- a/locale/ru.po ++++ b/locale/ru.po +@@ -6215,11 +6215,11 @@ msgstr "Новое в этой версии:" + + #~ msgid "" + #~ "\n" +-#~ "dvdisaster version %s build %d\n" ++#~ "dvdisaster version %s build %s\n" + #~ "\n" + #~ msgstr "" + #~ "\n" +-#~ "dvdisaster версия %s сборка %d\n" ++#~ "dvdisaster версия %s сборка %s\n" + #~ "\n" + + #~ msgid "--cache-size maximum is 8192MiB." diff --git a/scripts/time-stamper.bash b/scripts/time-stamper.bash -index fd28794..60fe91a 100755 +index fd28794..4ec3e60 100755 --- a/scripts/time-stamper.bash +++ b/scripts/time-stamper.bash @@ -1,7 +1,7 @@ @@ -23,9 +119,10 @@ index fd28794..60fe91a 100755 -build=$(grep BUILD $1 | cut -d\ -f3) -build=$((build+1)) -+# Use Debian changelog details to derive build number and date. -+build=$(dpkg-parsechangelog -S Version | sed 's/.*-\([0-9]\+\).*/\1/') - echo "#define BUILD $build" >$1 +-echo "#define BUILD $build" >$1 -date=$(date +"%d.%m.%y (%A, %H:%M)") -+date=$(date --date="$(dpkg-parsechangelog -S Date)" +"%d.%m.%y (%A, %H:%M)") ++# Use Debian changelog details to derive build number and date. ++build=$(echo "${DEB_VERSION}" | cut -f2 -d-) ++echo "#define BUILD \"$build\"" >$1 ++date=$(date --date="@${SOURCE_DATE_EPOCH}" --utc +"%d.%m.%y (%A, %H:%M)") echo "#define BDATE \"$date\"" >>$1 diff --git a/debian/patches/17-fix-all-but-deprecated-api-warnings.patch b/debian/patches/17-fix-all-but-deprecated-api-warnings.patch index 01ababb..312c5ee 100644 --- a/debian/patches/17-fix-all-but-deprecated-api-warnings.patch +++ b/debian/patches/17-fix-all-but-deprecated-api-warnings.patch @@ -22,7 +22,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ 9 files changed, 38 insertions(+), 32 deletions(-) diff --git a/closure.c b/closure.c -index 7568cba..0e2f889 100644 +index 51e91a2..40bb225 100644 --- a/closure.c +++ b/closure.c @@ -196,7 +196,7 @@ void ReadDotfile() diff --git a/debian/patches/27-allow-opening-in-browser-again.patch b/debian/patches/27-allow-opening-in-browser-again.patch index d61a01b..fddee5f 100644 --- a/debian/patches/27-allow-opening-in-browser-again.patch +++ b/debian/patches/27-allow-opening-in-browser-again.patch @@ -17,7 +17,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ create mode 100644 show-html.c diff --git a/closure.c b/closure.c -index 0e2f889..632c103 100644 +index 40bb225..f408f7a 100644 --- a/closure.c +++ b/closure.c @@ -467,6 +467,7 @@ void InitClosure() @@ -37,7 +37,7 @@ index 0e2f889..632c103 100644 cond_free(Closure->simulateCD); cond_free(Closure->dDumpDir); diff --git a/dvdisaster.h b/dvdisaster.h -index db2031e..22eab5a 100644 +index bcfd4f5..ae874ae 100644 --- a/dvdisaster.h +++ b/dvdisaster.h @@ -213,6 +213,7 @@ typedef struct _GlobalClosure diff --git a/debian/patches/29-fix-more-typos.patch b/debian/patches/29-fix-more-typos.patch index cb083ec..e803d36 100644 --- a/debian/patches/29-fix-more-typos.patch +++ b/debian/patches/29-fix-more-typos.patch @@ -40,7 +40,7 @@ index 51ff827..80fe9d3 100644 \bigskip diff --git a/locale/cs.po b/locale/cs.po -index ed1fc65..9010d21 100644 +index 24b1e7c..497a4a9 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -1903,7 +1903,7 @@ msgid "Media ejection" @@ -79,7 +79,7 @@ index a074339..000d5c3 100644 #: preferences.c:2091 diff --git a/locale/pt_BR.po b/locale/pt_BR.po -index 04b33b5..00bcaee 100644 +index 012ce9e..4624071 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -1839,7 +1839,7 @@ msgid "Media ejection" @@ -92,7 +92,7 @@ index 04b33b5..00bcaee 100644 #: preferences.c:2091 diff --git a/locale/ru.po b/locale/ru.po -index 6cd3789..1c677d4 100644 +index 912d6fb..66fc036 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -1841,7 +1841,7 @@ msgid "Media ejection" diff --git a/debian/patches/31-improve-hurd-and-kfreebsd-support.patch b/debian/patches/31-improve-hurd-and-kfreebsd-support.patch index a62d867..84a883f 100644 --- a/debian/patches/31-improve-hurd-and-kfreebsd-support.patch +++ b/debian/patches/31-improve-hurd-and-kfreebsd-support.patch @@ -75,7 +75,7 @@ index 60c55f9..f30f5d3 100644 diff --git a/closure.c b/closure.c -index 632c103..7c8b3bd 100644 +index f408f7a..f4b1893 100644 --- a/closure.c +++ b/closure.c @@ -50,7 +50,8 @@ static void get_base_dirs() diff --git a/debian/rules b/debian/rules index db7de76..8181a4c 100755 --- a/debian/rules +++ b/debian/rules @@ -7,6 +7,7 @@ export DEB_CFLAGS_MAINT_APPEND = $(CPPFLAGS) -Wall -Wno-deprecated-declarations export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed include /usr/share/dpkg/pkg-info.mk +export DEB_VERSION export FORCE_SOURCE_DATE = 1 MUTABLE_FILES := build.h $(wildcard locale/*.po) \ From a5f48d91a3eb2a724409f32c7442bc04c36b389b Mon Sep 17 00:00:00 2001 From: Carlos Maddela Date: Tue, 15 Aug 2017 00:29:03 +1000 Subject: [PATCH 2/4] Call ./configure script directly Call ./configure script directly, instead of relying on debhelper, to resolve incompatibilities with Bash-based script. --- debian/changelog | 2 ++ debian/rules | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index d931199..4dc4499 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ dvdisaster (0.79.5-4) UNRELEASED; urgency=medium just the numeric part. * Re-implement scripts/time-stamper.bash without direct calls to dpkg-parsechangelog. + * Call ./configure script directly, instead of relying on debhelper, + to resolve incompatibilities with Bash-based script. -- Carlos Maddela Mon, 14 Aug 2017 23:04:38 +1000 diff --git a/debian/rules b/debian/rules index 8181a4c..5d08cc7 100755 --- a/debian/rules +++ b/debian/rules @@ -20,9 +20,11 @@ override_dh_auto_configure: for f in $(MUTABLE_FILES); do \ cp -an $$f $$f.orig; \ done - dh_auto_configure -- \ - --localedir=\$${prefix}/share/locale \ - --docdir=\$${prefix}share/doc \ + ./configure \ + --prefix=/usr \ + --mandir=share/man \ + --localedir=share/locale \ + --docdir=share/doc \ --docsubdir=dvdisaster-doc \ --with-embedded-src-path=no From 06c675c1fdf5b42f5b4032a397c770b6c885def0 Mon Sep 17 00:00:00 2001 From: Carlos Maddela Date: Tue, 15 Aug 2017 02:00:37 +1000 Subject: [PATCH 3/4] Remove dependencies on dh-exec and dpkg-dev. * Use alternative way of installing icons to remove dependency on dh-exec. * Drop redundant dependency on dpkg-dev. --- debian/changelog | 3 +++ debian/control | 2 -- debian/dvdisaster.install | 9 ++------- debian/rules | 12 +++++++++++- 4 files changed, 16 insertions(+), 10 deletions(-) mode change 100755 => 100644 debian/dvdisaster.install diff --git a/debian/changelog b/debian/changelog index 4dc4499..0e4ca8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ dvdisaster (0.79.5-4) UNRELEASED; urgency=medium dpkg-parsechangelog. * Call ./configure script directly, instead of relying on debhelper, to resolve incompatibilities with Bash-based script. + * Use alternative way of installing icons to remove dependency on + dh-exec. + * Drop redundant dependency on dpkg-dev. -- Carlos Maddela Mon, 14 Aug 2017 23:04:38 +1000 diff --git a/debian/control b/debian/control index 59d4b40..60f886c 100644 --- a/debian/control +++ b/debian/control @@ -6,8 +6,6 @@ Uploaders: TANIGUCHI Takaki , Rogério Brito , Carlos Maddela Build-Depends: debhelper (>= 10), - dh-exec, - dpkg-dev (>= 1.16.1.1), gettext, libbz2-dev, libcam-dev [kfreebsd-any], diff --git a/debian/dvdisaster.install b/debian/dvdisaster.install old mode 100755 new mode 100644 index 303dfb8..ae9e496 --- a/debian/dvdisaster.install +++ b/debian/dvdisaster.install @@ -1,10 +1,5 @@ -#!/usr/bin/dh-exec +contrib/dvdisaster.desktop usr/share/applications usr/bin +usr/share/icons usr/share/locale usr/share/man -contrib/dvdisaster.desktop usr/share/applications -contrib/dvdisaster16.png => usr/share/icons/hicolor/16x16/apps/dvdisaster.png -contrib/dvdisaster24.png => usr/share/icons/hicolor/24x24/apps/dvdisaster.png -contrib/dvdisaster32.png => usr/share/icons/hicolor/32x32/apps/dvdisaster.png -contrib/dvdisaster48.png => usr/share/icons/hicolor/48x48/apps/dvdisaster.png -contrib/dvdisaster64.png => usr/share/icons/hicolor/64x64/apps/dvdisaster.png diff --git a/debian/rules b/debian/rules index 5d08cc7..4e176dd 100755 --- a/debian/rules +++ b/debian/rules @@ -13,6 +13,10 @@ export FORCE_SOURCE_DATE = 1 MUTABLE_FILES := build.h $(wildcard locale/*.po) \ documentation/config/version.tex +BUILDROOT := $(CURDIR)/debian/tmp +ICONS := $(wildcard contrib/dvdisaster*.png) +ICON_SIZES := $(patsubst contrib/dvdisaster%.png,%,$(ICONS)) + %: dh $@ @@ -50,7 +54,13 @@ override_dh_auto_build-indep: true override_dh_auto_install-arch: - dh_auto_install -a -- BUILDROOT=$(CURDIR)/debian/tmp + dh_auto_install -a -- BUILDROOT=$(BUILDROOT) + set -e; \ + for S in $(ICON_SIZES); do \ + D="$(BUILDROOT)/usr/share/icons/hicolor/$${S}x$${S}/apps"; \ + install -d "$${D}"; \ + install -T "contrib/dvdisaster$${S}.png" "$${D}/dvdisaster.png"; \ + done override_dh_auto_install-indep: true From 5d5e943c515f78fc37668792f9867d2f71b1dce3 Mon Sep 17 00:00:00 2001 From: Carlos Maddela Date: Tue, 15 Aug 2017 03:25:37 +1000 Subject: [PATCH 4/4] Reproducibly generate PDF documentation from TeX sources. --- debian/changelog | 1 + debian/control | 6 +++--- ....patch => 28-pdftex-reproducibility.patch} | 17 ++++++++++------- debian/patches/series | 2 +- debian/rules | 19 +++++-------------- 5 files changed, 20 insertions(+), 25 deletions(-) rename debian/patches/{28-fudge-pdf-doc-ids.patch => 28-pdftex-reproducibility.patch} (59%) diff --git a/debian/changelog b/debian/changelog index 0e4ca8f..313525e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ dvdisaster (0.79.5-4) UNRELEASED; urgency=medium * Use alternative way of installing icons to remove dependency on dh-exec. * Drop redundant dependency on dpkg-dev. + * Reproducibly generate PDF documentation from TeX sources. -- Carlos Maddela Mon, 14 Aug 2017 23:04:38 +1000 diff --git a/debian/control b/debian/control index 60f886c..4a09f58 100644 --- a/debian/control +++ b/debian/control @@ -12,9 +12,9 @@ Build-Depends: debhelper (>= 10), libgtk2.0-dev, libpng-dev, pkg-config -# Build-Depends-Indep: texlive-fonts-recommended, -# texlive-latex-base, -# texlive-latex-extra +Build-Depends-Indep: texlive-fonts-recommended, + texlive-latex-base, + texlive-latex-extra Standards-Version: 4.0.1 Vcs-Browser: https://anonscm.debian.org/git/pkg-opt-media/dvdisaster.git Vcs-Git: https://anonscm.debian.org/git/pkg-opt-media/dvdisaster.git diff --git a/debian/patches/28-fudge-pdf-doc-ids.patch b/debian/patches/28-pdftex-reproducibility.patch similarity index 59% rename from debian/patches/28-fudge-pdf-doc-ids.patch rename to debian/patches/28-pdftex-reproducibility.patch index 748e7cc..f8fee2b 100644 --- a/debian/patches/28-fudge-pdf-doc-ids.patch +++ b/debian/patches/28-pdftex-reproducibility.patch @@ -1,26 +1,29 @@ From: Carlos Maddela Date: Thu, 5 Jan 2017 19:14:35 +1100 -Subject: Generate the same PDF document IDs for build reproducibility. +Subject: Apply pdftex workarounds for build reproducibility. -Description: Generate the same PDF IDs for build reproducibility. +Description: Apply pdftex workarounds for build reproducibility. + * Generate the same PDF IDs. + * Suppress additional metadata for included images. Author: Carlos Maddela Forwarded: not-needed -Last-Update: 2016-12-21 +Last-Update: 2017-08-15 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- - documentation/user-manual/manual.tex | 1 + - 1 file changed, 1 insertion(+) + documentation/user-manual/manual.tex | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/documentation/user-manual/manual.tex b/documentation/user-manual/manual.tex -index 60fb51e..aaab4fa 100644 +index 60fb51e..bf4364d 100644 --- a/documentation/user-manual/manual.tex +++ b/documentation/user-manual/manual.tex -@@ -65,6 +65,7 @@ +@@ -65,6 +65,8 @@ \fancyfoot{} \fancyfoot[LE,RO]{page \thepage\ of \pageref{LastPage}} +\pdftrailerid{dvdisaster} ++\pdfsuppressptexinfo=-1 \begin{document} \definecolor{lightorange}{RGB}{255,224,150} diff --git a/debian/patches/series b/debian/patches/series index ebd02f0..8136eba 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -19,7 +19,7 @@ 25-fix-man-pages.patch 26-fix-display-of-manual.pdf.patch 27-allow-opening-in-browser-again.patch -28-fudge-pdf-doc-ids.patch +28-pdftex-reproducibility.patch 29-fix-more-typos.patch 30-hurd-kfreebsd-ftbfs.patch 31-improve-hurd-and-kfreebsd-support.patch diff --git a/debian/rules b/debian/rules index 4e176dd..53a47e0 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,8 @@ export DEB_VERSION export FORCE_SOURCE_DATE = 1 MUTABLE_FILES := build.h $(wildcard locale/*.po) \ - documentation/config/version.tex + documentation/config/version.tex \ + documentation/user-manual/manual.pdf BUILDROOT := $(CURDIR)/debian/tmp ICONS := $(wildcard contrib/dvdisaster*.png) @@ -41,17 +42,8 @@ override_dh_clean: override_dh_auto_build-arch: make all -# For the time being, we'll just package the upstream-generated -# manual.pdf, since we can't build the PDF reproducibly ourselves. -# The reason we can't is most probably due to the fact that the -# LaTeX document embeds other PDF documents and PNG images. -# Although we are able to reproduce the PDF's creation and mod -# dates, as well as its PDF IDs, the stream elements representing -# the embedded images are always what seem to differ each time we -# try to generate the PDF. override_dh_auto_build-indep: - # make manual - true + make manual override_dh_auto_install-arch: dh_auto_install -a -- BUILDROOT=$(BUILDROOT) @@ -66,9 +58,8 @@ override_dh_auto_install-indep: true # Ensure that none of the text files that the application -# tries to display directly are not compressed, as it doesn't +# tries to display directly are compressed, as it doesn't # automatically decompress text files. -override_dh_compress: +override_dh_compress-arch: dh_compress -p dvdisaster \ -XCHANGELOG -XCREDITS -XREADME.MODIFYING -XTODO - dh_compress --remaining-packages