# Script to add reproducible-builds.org's patches to Ubuntu's dpkg # See https://wiki.debian.org/ReproducibleBuilds set -ex mkdir -p dir.tmp cd dir.tmp # Get Ubuntu's current dpkg sources, and back them up apt source dpkg cp -a dpkg-1.18.4ubuntu1 dpkg-1.18.4ubuntu1.tmp # Get the reproducible-builds feature branch git clone git://anonscm.debian.org/reproducible/dpkg.git || true cd dpkg git checkout pu/reproducible_builds git reset --hard 1.18.4 # Kludge: arrange for patches to apply by adding back missing files dotfiles=`find . -type f -name '.*' ` tar -cf - $dotfiles debian/changelog | tar -C ../dpkg-1.18.4ubuntu1.tmp -xf - cd .. # Create a single patch that prepares for applying the patch series diff -Naur dpkg-1.18.4ubuntu1 dpkg-1.18.4ubuntu1.tmp > 0000-changelog.patch || true # Finally, create the patch series representing the reproducible-builds feature cd dpkg git reset --hard pu/1.18.5.0_reproducible1 git format-patch 1.18.4 cd .. # Apply the patches rm -rf dpkg-1.18.4ubuntu1.tmp cd dpkg-1.18.4ubuntu1 cp debian/changelog debian/changelog.old for a in ../0000-changelog.patch ../dpkg/0*.patch do patch -p1 < $a done cat - debian/changelog.old > debian/changelog <<_EOF_ dpkg (1.18.5.0~reproducible1~ppa1) UNRELEASED; urgency=low * Apply reproducible-build.org patches atop Ubuntu's 1.18.4 -- Daniel Richard Kegel (Temporary PPA signing key) Mon, 09 May 2016 19:20:49 -0700 _EOF_ cd .. mv dpkg-1.18.4ubuntu1 dpkg-1.18.5.0ubuntu1ppa1 cd dpkg-1.18.5.0ubuntu1ppa1 debuild -S -sd