From 6058412da4fb219c33a3e1ea724d3cdf84c7e163 Mon Sep 17 00:00:00 2001
From: "Jeremiah C. Foster" <jeremiah.foster@puri.sm>
Date: Thu, 11 Jun 2020 21:02:25 -0400
Subject: [PATCH] Patching the meson.build file to bring back log output files

---
 debian/changelog                              |  13 +
 debian/patches/bring-in-more-upstream-files   | 674 ++++++++++++++++++
 debian/patches/changelog-upstream             | 398 +++++++++++
 .../exported-versioninfo-from-upstream        |  28 -
 debian/patches/series                         |   4 +-
 debian/patches/upstream-versioning-tools      | 257 -------
 meson.build                                   |   1 -
 util/getrevision.sh                           |   0
 versioninfo.inc                               |   3 +-
 9 files changed, 1089 insertions(+), 289 deletions(-)
 create mode 100644 debian/patches/bring-in-more-upstream-files
 create mode 100644 debian/patches/changelog-upstream
 delete mode 100644 debian/patches/exported-versioninfo-from-upstream
 delete mode 100644 debian/patches/upstream-versioning-tools
 mode change 100644 => 100755 util/getrevision.sh

diff --git a/debian/changelog b/debian/changelog
index 2c6c166c..d45ae50f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+flashrom (1.2.0-0pureos8) amber-updates; urgency=medium
+
+  * Removing git-hooks in util/ and adding in debian dir.
+  * Adding in gbp in gitlab-ci.yml
+  * Looks like we have to have util/getrevision.sh if we want a version from the binary.
+  * Uncommenting rules/clean:: and --not-automatic-dbgsym
+  * Removing flashrom.udev
+  * Adding in versioninfo.inc so we don't have to do contortions to find this info.
+  * Patching the meson.build file to bring back log output files
+  * Upstream changes to meson.build file.
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 11 Jun 2020 21:22:11 -0400
+
 flashrom (1.2.0-0pureos7) amber-updates; urgency=medium
 
   * Found a cleaner way to remove git-hooks directory
diff --git a/debian/patches/bring-in-more-upstream-files b/debian/patches/bring-in-more-upstream-files
new file mode 100644
index 00000000..a0a7629b
--- /dev/null
+++ b/debian/patches/bring-in-more-upstream-files
@@ -0,0 +1,674 @@
+Description: Bring back in some upstream files for versioning
+
+ There are some tools for versioning that were previously removed,
+ I've added those back in because we use the version in PureOS.
+ Removing the -DSTANDALONE flag from the build tool
+ .
+ flashrom (1.2.0-0pureos8) amber-updates; urgency=medium
+ .
+   * Removing git-hooks in util/ and adding in debian dir.
+   * Adding in gbp in gitlab-ci.yml
+   * Looks like we have to have util/getrevision.sh if we want a version from the binary.
+   * Uncommenting rules/clean:: and --not-automatic-dbgsym
+   * Removing flashrom.udev
+   * Adding in versioninfo.inc so we don't have to do contortions to find this info.
+   * Patching the meson.build file to bring back log output files
+   * Upstream changes to meson.build file.
+Author: Jeremiah C. Foster <jeremiah.foster@puri.sm>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: 2020-06-12
+
+--- /dev/null
++++ flashrom-1.2.0/.features
+@@ -0,0 +1,7 @@
++FEATURES := yes
++FTDISUPPORT := yes
++FT232H := yes
++LINUX_MTD_SUPPORT := yes
++LINUX_SPI_SUPPORT := yes
++UTSNAME := yes
++CLOCK_GETTIME := yes
+--- flashrom-1.2.0.orig/changelog
++++ /dev/null
+@@ -1,379 +0,0 @@
+-flashrom (1.1.0-0pureos1) green; urgency=medium
+-
+-  * New upstream version
+-  * Changed maintainers to PureOS maintainers
+-
+- -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Wed, 07 Aug 2019 14:35:31 -0400
+-
+-flashrom (1.0.0-0pureos2) green; urgency=medium
+-
+-  * New compat version, updated standards version
+-
+- -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 24 Jan 2019 13:44:18 -0500
+-
+-flashrom (1.0.0-0pureos1) green; urgency=medium
+-
+-  * New upstream version
+-
+- -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 24 Jan 2019 13:41:34 -0500
+-
+-flashrom (0.9.9+r1954-1pureos1) green; urgency=medium
+-
+-  * Fork for PureOS:
+-    + Set dev@puri.sm as maintainer, prefixing original XSBC-Original-.
+-    + Set myself as uploader, dropping original.
+-  * Suppress building *-dbgsym packages, to avoid NEW queue.
+-  * No-change rebuild to fix segfault on PureOS.
+-
+- -- Jonas Smedegaard <jonas.smedegaard@puri.sm>  Wed, 15 Nov 2017 13:34:32 +0100
+-
+-flashrom (0.9.9+r1954-1) unstable; urgency=medium
+-
+-  * New upstream release.
+-  * Don't build-depend on libftdi1-dev on Hurd, it's not available.
+-
+- -- Uwe Hermann <uwe@debian.org>  Sun, 13 Mar 2016 20:41:00 +0100
+-
+-flashrom (0.9.9~rc1+r1946-1) unstable; urgency=medium
+-
+-  * New upstream release (Closes: #788426, #802342).
+-      + Partial support for alpha, hppa, m68k, sh, and s390 (Closes: 774405).
+-  * debian/control:
+-      + On kFreeBSD only build-depend on libusb-1.0-0-dev, that
+-        package also includes the old libusb 0.1 API (Closes: #815947).
+-        Thanks Steven Chamberlain for the patch!
+-      + Don't build-depend on libusb-1.0-0-dev on Hurd, it's not available.
+-      + Add pkg-config to build-depends, since it is used by the upstream
+-        Makefile. Otherwise the Makefile uses hardcoded guesses, which
+-        are not always correct.
+-      + Drop "Recommends: dmidecode [any-i386 any-amd64 ia64 armhf]".
+-        Upstream has its own code now, no longer uses dmidecode by default.
+-  * debian/rules: Add "export DEB_BUILD_MAINT_OPTIONS = hardening=+all".
+-  * Standards-Version: 3.9.7 (no changes required).
+-  * Package description: Update list of supported devices.
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 01 Mar 2016 00:07:45 +0100
+-
+-flashrom (0.9.9~rc1+r1942-1) unstable; urgency=medium
+-
+-  * Acknowledge NMU, thanks Anibal Monsalve Salazar! (Closes: #775428).
+-  * New upstream release (Closes: #786917).
+-      + Dediprog SF100 support is now enabled by default (Closes: #639957).
+-      + debian/patches/20_svn_version.patch: Drop, no longer needed (if the
+-        tarball is generated via 'make tarball' from svn checkout).
+-      + debian/patches/mips-fix-internal.patch: Drop, fixed upstream.
+-  * New build-depends: libusb-1.0-0-dev (in addition to libusb-dev).
+-  * Updated build-depends: libftdi-dev -> libftdi1-dev (Closes: #810372).
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 23 Feb 2016 19:34:07 +0100
+-
+-flashrom (0.9.7+r1852-1.1) unstable; urgency=medium
+-
+-  * Non-maintainer upload.
+-  * Fix FTBFS on mipsel.
+-    Patch by Dejan Latinovic <Dejan.Latinovic@imgtec.com>.
+-    Add mips-fix-internal.patch.
+-    Closes: #775428.
+-
+- -- Anibal Monsalve Salazar <anibal@debian.org>  Wed, 14 Oct 2015 09:21:36 +0100
+-
+-flashrom (0.9.7+r1852-1) unstable; urgency=medium
+-
+-  * New upstream release.
+-  * Standards-Version: 3.9.6 (no changes required).
+-  * Use 'Architecture: any', flashrom should build/work pretty much everywhere.
+-  * debian/patches:
+-      + 10_disable_linuxspi.patch: Drop.
+-      + 20_svn_version.patch: Update.
+-  * Shorten dmidecode 'Recommends' to [any-i386 any-amd64 ia64 armhf].
+-  * Add missing upstream ChangeLog file (via "svn log").
+-
+- -- Uwe Hermann <uwe@debian.org>  Mon, 27 Oct 2014 21:20:52 +0100
+-
+-flashrom (0.9.7+r1782-1) unstable; urgency=high
+-
+-  * New upstream release (Closes: #746734, #690478).
+-  * debian/compat: Upgrade from 5 to 9.
+-  * Standards-Version: 3.9.5 (no changes required).
+-
+- -- Uwe Hermann <uwe@debian.org>  Sat, 03 May 2014 17:39:35 +0200
+-
+-flashrom (0.9.6.1+r1563-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Wed, 08 Aug 2012 23:39:15 +0200
+-
+-flashrom (0.9.5.2+r1546-1) unstable; urgency=medium
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Fri, 29 Jun 2012 20:49:55 +0200
+-
+-flashrom (0.9.5.2+r1517-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Standards-Version: 3.9.3 (no changes required).
+-
+- -- Uwe Hermann <uwe@debian.org>  Sat, 07 Apr 2012 23:27:50 +0200
+-
+-flashrom (0.9.5.1+r1508-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Sun, 26 Feb 2012 15:44:49 +0100
+-
+-flashrom (0.9.5+r1503-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * debian/docs: Add mysteries_intel.txt.
+-
+- -- Uwe Hermann <uwe@debian.org>  Mon, 20 Feb 2012 11:54:48 +0100
+-
+-flashrom (0.9.4+r1394-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * debian/patches/10_svnversion.patch: Drop, no longer needed.
+-
+- -- Uwe Hermann <uwe@debian.org>  Thu, 28 Jul 2011 21:29:32 +0200
+-
+-flashrom (0.9.3+r1323-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Standards-Version: 3.9.2 (no changes required).
+-  * debian/rules: Delete .libdeps file in 'clean' target.
+-
+- -- Uwe Hermann <uwe@debian.org>  Fri, 03 Jun 2011 16:53:47 +0200
+-
+-flashrom (0.9.2+r1141-2) unstable; urgency=high
+-
+-  * Drop alpha and netbsd-alpha from the arch list for now (builds fail).
+-    + Keeping "urgency=high" due to high-priority fixes in the last upload,
+-      in order to allow those fixes to migrate to testing.
+-    + It's unclear how well alpha (if at all) is supported upstream at this
+-      point. There's a compile-time #error in the upstream code breaking
+-      the build intentionally on alpha right now.
+-      Alpha support will be re-enabled as soon as this has been sorted out
+-      upstream, but it may take quite a while.
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 17 Aug 2010 00:50:27 +0200
+-
+-flashrom (0.9.2+r1141-1) unstable; urgency=high
+-
+-  * New upstream release. Urgency high due to multiple critical bugfixes that
+-    could potentially brick the PC (or worse: laptop) of users.
+-    Other important fixes include:
+-    + Properly writing Atmel AT25 chips would fail on some SPI controllers.
+-    + Fix breakage with brick-potential on various non-x86 architectures.
+-    + Fix broken reads on Winbond W25x16, especially on some ICH SPI chipsets.
+-    + Fix write failure on 3COM NICs with parallel flash.
+-    + Fix "byte merge" related corruption on some VIA chipsets.
+-    + Fix some format string bugs.
+-    + Fix hard hang on some recent (e.g. QM57) Intel chipsets.
+-  * Install new upstream udev rules file to allow users to use flashrom
+-    without root permissions on some (USB-based) programmers.
+-  * Standards-Version: 3.9.1 (no changes required).
+-  * debian/copyright: Updates.
+-
+- -- Uwe Hermann <uwe@debian.org>  Sun, 15 Aug 2010 19:07:19 +0200
+-
+-flashrom (0.9.2+r1028-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Add dmidecode as Recommends on architectures where it's available.
+-  * debian/README.Debian: Fix typo.
+-  * debian/copyright: Update upstream svn URL.
+-
+- -- Uwe Hermann <uwe@debian.org>  Fri, 04 Jun 2010 18:13:52 +0200
+-
+-flashrom (0.9.1+r946-1) unstable; urgency=high
+-
+-  * New upstream release.
+-     + Urgency high, as it fixes multiple important bugs, including such bugs
+-       which can potentially "brick" a user's mainboard. Details at
+-       http://www.flashrom.org/pipermail/flashrom/2010-March/002507.html.
+-     + This build should have a non-truncated manpage (Closes: #566217).
+-  * Standards-Version: 3.8.4 (no changes required).
+-
+- -- Uwe Hermann <uwe@debian.org>  Wed, 17 Mar 2010 09:50:05 +0100
+-
+-flashrom (0.9.1+r873-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Wed, 20 Jan 2010 15:18:23 +0100
+-
+-flashrom (0.9.1+r792-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * debian/control, debian/copyright: Update upstream website to flashrom.org.
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 08 Dec 2009 10:13:35 +0100
+-
+-flashrom (0.9.1+r736-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 29 Sep 2009 13:09:58 +0200
+-
+-flashrom (0.9.1+r706-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Standards-Version: 3.8.3 (no changes required).
+-  * debian/copyright: Update.
+-
+- -- Uwe Hermann <uwe@debian.org>  Mon, 31 Aug 2009 18:32:13 +0200
+-
+-flashrom (0.9+r631-1) unstable; urgency=low
+-
+-  * New upstream release.
+-     + The command line usage has changed a bit in this release:
+-        + Combined operations like -wv or -Ewv are no longer allowed.
+-        + The -w option automatically does an auto-verify after writing
+-          (but you can also explicitly do it via 'flashrom -v file').
+-        + The -E option is also automatically verified per default.
+-     + Support for external programmers was added (-p), see manpage.
+-     + Acer Aspire One is now marked unsupported upstream (Closes: #528308).
+-  * Add build-dependency on libftdi-dev, flashrom now supports an
+-    external libftdi-based programmer (ft2232spi).
+-  * debian/patches/20_drop_svndef.patch: Drop, we use 'make tarball' now,
+-    which properly handles svn version printing in flashrom.
+-  * Standards-Version: 3.8.2 (no changes required).
+-  * debian/copyright: Update.
+-
+- -- Uwe Hermann <uwe@debian.org>  Thu, 25 Jun 2009 14:18:53 +0200
+-
+-flashrom (0.9+r544-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * debian/patches/10_makefile.patch: Drop, no longer needed.
+-  * debian/copyright: Update.
+-
+- -- Uwe Hermann <uwe@debian.org>  Thu, 21 May 2009 21:34:03 +0200
+-
+-flashrom (0.9+r446-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Sat, 11 Apr 2009 16:28:33 +0200
+-
+-flashrom (0.0+r3844-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Sat, 27 Dec 2008 09:05:27 +0100
+-
+-flashrom (0.0+r3734-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Sat, 08 Nov 2008 01:38:08 +0100
+-
+-flashrom (0.0+r3613-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * debian/watch: Add dummy file to silence lintian (we track svn revisions).
+-
+- -- Uwe Hermann <uwe@debian.org>  Sat, 27 Sep 2008 19:28:36 +0200
+-
+-flashrom (0.0+r3397-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Standards-Version: 3.8.0 (no changes required).
+-
+- -- Uwe Hermann <uwe@debian.org>  Mon, 30 Jun 2008 17:11:25 +0200
+-
+-flashrom (0.0+r3274-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * debian/control:
+-    + pciutils-dev was renamed to libpci-dev (Closes: #478379).
+-    + Drop ia64 from architectures list for now, unlikely to work.
+-    + Don't link with -lz anymore, don't build-depend on zlib1g-dev.
+-      We don't explicitly need zlib, libpci-dev now properly depends on it.
+-  * Add upstream changelog ('svn log' output) to the package (Closes: #467398).
+-
+- -- Uwe Hermann <uwe@debian.org>  Sun, 04 May 2008 00:34:44 +0200
+-
+-flashrom (0.0+r3112-2) unstable; urgency=low
+-
+-  * Fix debian/rules to make it work on Ubuntu, too (Closes: #466994).
+-
+- -- Uwe Hermann <uwe@debian.org>  Sat, 23 Feb 2008 21:17:09 +0100
+-
+-flashrom (0.0+r3112-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Thu, 21 Feb 2008 00:11:54 +0100
+-
+-flashrom (0.0+r3073-1) unstable; urgency=low
+-
+-  * New upstream release (Closes: #462248).
+-    + Flashrom is now installed in /usr/sbin instead of /usr/bin.
+-    + The manpage is now in section 8 (not 1).
+-    + Fix broken references to old bug tracker URL (Closes: #460554).
+-  * Restrict list of architectures to the known-working ones for now.
+-    More architectures will gradually be re-added if we're sure they work.
+-    + These are known to work: amd64, i386, kfreebsd-amd64, kfreebsd-i386
+-    + These should work (untested, though): alpha, hurd-i386, ia64,
+-      netbsd-alpha, netbsd-i386
+-    + These are disabled for now, as flashrom will very likely not work: arm,
+-      armel, armeb, hppa, m32r, m68k, mips, mipsel, powerpc, sh, sparc, s390
+-  * Standards-Version: 3.7.3 (no changes required).
+-  * debian/control:
+-     + Add Homepage field.
+-     + Update package description.
+-  * debian/copyright: Update URLs and list of authors.
+-  * Simplified packaging a bit.
+-
+- -- Uwe Hermann <uwe@debian.org>  Thu, 24 Jan 2008 13:47:48 +0100
+-
+-flashrom (0.0+r2769-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Do not attempt to build flashrom on S/390, as it doesn't build
+-    and is not useful there anyway (Closes: #404342, #418712).
+-    It is yet to be determined on which other architectures flashrom can
+-    work and on which not.
+-  * Honour DEB_BUILD_OPTIONS=nostrip variable by removing hardcoded 'strip'
+-    invocation in the Makefile and letting cdbs handle it (Closes: #436850).
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 11 Sep 2007 17:54:11 +0200
+-
+-flashrom (0.0+r2739-1) unstable; urgency=low
+-
+-  * New upstream release.
+-
+- -- Uwe Hermann <uwe@debian.org>  Sun, 15 Jul 2007 15:23:51 +0200
+-
+-flashrom (0.0+r2601-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Drop a few patches which are now merged upstream.
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 10 Apr 2007 12:38:58 +0200
+-
+-flashrom (0.0+r2526-2) unstable; urgency=medium
+-
+-  * Add missing build dependency on zlib1g-dev (Closes: #403322).
+-    Thanks Julien Danjou <acid@debian.org> and
+-    Alex de Oliveira Silva <enerv@host.sk>.
+-  * Standards-Version: 3.7.2.2 (no changes required).
+-
+- -- Uwe Hermann <uwe@debian.org>  Tue, 19 Dec 2006 10:36:04 +0100
+-
+-flashrom (0.0+r2526-1) unstable; urgency=low
+-
+-  * New upstream release.
+-  * Do not compile in DoC support (it's considered unsupported upstream).
+-    This will also make the flash part identification process a lot faster.
+-
+- -- Uwe Hermann <uwe@debian.org>  Thu, 14 Dec 2006 18:37:07 +0100
+-
+-flashrom (0.0+r2504-1) unstable; urgency=low
+-
+-  * Initial release (Closes: #399893).
+-
+- -- Uwe Hermann <uwe@debian.org>  Thu, 14 Dec 2006 16:56:49 +0100
+-
+--- flashrom-1.2.0.orig/meson.build
++++ flashrom-1.2.0/meson.build
+@@ -393,7 +393,6 @@ executable(
+   ],
+   c_args : [
+     cargs,
+-    '-DSTANDALONE',
+     '-DCONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_INVALID',
+     '-DCONFIG_DEFAULT_PROGRAMMER_ARGS=""',
+   ],
+--- /dev/null
++++ flashrom-1.2.0/util/getrevision.sh
+@@ -0,0 +1,238 @@
++#!/bin/sh
++# NB: Supposed to be POSIX compatible but at least the usage of 'local' is not.
++#
++# This file is part of the flashrom project.
++#
++# Copyright (C) 2005 coresystems GmbH <stepan@coresystems.de>
++# Copyright (C) 2009,2010 Carl-Daniel Hailfinger
++# Copyright (C) 2010 Chromium OS Authors
++# Copyright (C) 2013-2016 Stefan Tauner
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++
++EXIT_SUCCESS=0
++EXIT_FAILURE=1
++
++# Make sure we don't get translated output
++export LC_ALL=C
++# nor local times or dates
++export TZ=UTC0
++
++# Helper functions
++# First argument is the path to inspect (usually optional; without
++# it the whole repository will be considered)
++git_has_local_changes() {
++	git update-index -q --refresh >/dev/null
++	! git diff-index --quiet HEAD -- "$1"
++}
++
++git_last_commit() {
++	# git rev-parse --short HEAD would suffice if repository as a whole is of interest (no $1)
++	git log --pretty=format:"%h" -1 -- "$1"
++}
++
++git_is_file_tracked() {
++	git ls-files --error-unmatch -- "$1" >/dev/null 2>&1
++}
++
++is_file_tracked() {
++	git_is_file_tracked "$1"
++}
++
++# Tries to find a remote source for the changes committed locally.
++# This includes the URL of the remote repository including the last commit and a suitable branch name.
++# Takes one optional argument: the path to inspect
++git_url() {
++	last_commit=$(git_last_commit "$1")
++	# get all remote branches containing the last commit (excluding origin/HEAD)
++	branches=$(git branch -r --contains $last_commit | sed '/\//!d;/.*->.*/d;s/[\t ]*//')
++	if [ -z "$branches" ] ; then
++		echo "No remote branch contains a suitable commit">&2
++		return
++	fi
++
++	# find "nearest" branch
++	local mindiff=9000
++	local target=
++	for branch in $branches ; do
++		curdiff=$(git rev-list --count $last_commit..$branch)
++		if [ $curdiff -ge $mindiff ] ; then
++			continue
++		fi
++		mindiff=$curdiff
++		target=$branch
++	done
++
++	echo "$(git ls-remote --exit-code --get-url ${target%/*}) ${target#*/}"
++}
++
++# Returns a string indicating where others can get the current source code (excluding uncommitted changes).
++# Takes one optional argument: the path to inspect
++scm_url() {
++	local url=
++
++	if git_is_file_tracked "$1" ; then
++		url="$(git_url "$1")"
++	else
++		return ${EXIT_FAILURE}
++	fi
++
++	echo "${url}"
++}
++
++# Retrieve timestamp since last modification. If the sources are pristine,
++# then the timestamp will match that of the SCM's most recent modification
++# date.
++timestamp() {
++	local t
++
++	# date syntaxes are manifold:
++	# gnu		date [-d input]... [+FORMAT]
++	# netbsd	date [-ajnu] [-d date] [-r seconds] [+format] [[[[[[CC]yy]mm]dd]HH]MM[.SS]]
++	# freebsd	date [-jnu]  [-d dst] [-r seconds] [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] [...]
++	# dragonflybsd	date [-jnu]  [-d dst] [-r seconds] [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] [...]
++	# openbsd	date [-aju]  [-d dst] [-r seconds] [+format] [[[[[[cc]yy]mm]dd]HH]MM[.SS]] [...]
++	if git_is_file_tracked "$2" ; then
++		# are there local changes?
++		if git_has_local_changes "$2" ; then
++			t=$(date -u "${1}")
++		else
++			# No local changes, get date of the last commit
++			case $(uname) in
++			# Most BSD dates do not support parsing date values from user input with -d but all of
++			# them support parsing epoch seconds with -r. Thanks to git we can easily use that:
++			NetBSD|OpenBSD|DragonFly|FreeBSD)
++				t=$(date -u -r "$(git log --pretty=format:%ct -1 -- $2)"  "$1" 2>/dev/null);;
++			*)
++				t=$(date -d "$(git log --pretty=format:%cD -1 -- $2)" -u "$1" 2>/dev/null);;
++			esac
++		fi
++	else
++		t=$(date -u "$1")
++	fi
++
++	if [ -z "$t" ]; then
++		echo "Warning: Could not determine timestamp." 2>/dev/null
++	fi
++	echo "${t}"
++}
++
++revision() {
++	local r
++	if git_is_file_tracked "$1" ; then
++		r=$(git describe $(git_last_commit "$1"))
++		if git_has_local_changes "$1" ; then
++			r="$r-dirty"
++		fi
++	else
++		r="unknown"
++	fi
++
++	echo "${r}"
++}
++
++is_tracked() {
++	is_file_tracked "$1"
++}
++
++show_help() {
++	echo "Usage:
++	${0} <command> [path]
++
++Commands
++    -h or --help
++        this message
++    -c or --check
++        test if path is under version control at all
++    -r or --revision
++        return unique revision information including an indicator for
++        uncommitted changes
++    -U or --url
++        URL associated with the latest commit
++    -d or --date
++        date of most recent modification
++    -t or --timestamp
++        timestamp of most recent modification
++"
++	return
++}
++
++check_action() {
++	if [ -n "$action" ]; then
++		echo "Error: Multiple actions given.">&2
++		exit ${EXIT_FAILURE}
++	fi
++}
++
++main() {
++	local query_path=
++	local action=
++
++	# Argument parser loop
++	while [ $# -gt 0 ];
++	do
++		case ${1} in
++		-h|--help)
++			action=show_help;
++			shift;;
++		-U|--url)
++			check_action $1
++			action=scm_url
++			shift;;
++		-d|--date)
++			check_action $1
++			action="timestamp +%Y-%m-%d" # refrain from suffixing 'Z' to indicate it's UTC
++			shift;;
++		-r|--revision)
++			check_action $1
++			action=revision
++			shift;;
++		-t|--timestamp)
++			check_action $1
++			action="timestamp +%Y-%m-%dT%H:%M:%SZ" # There is only one valid time format! ISO 8601
++			shift;;
++		-c|--check)
++			check_action $1
++			action=is_tracked
++			shift;;
++		-*)
++			show_help;
++			echo "Error: Invalid option: ${1}"
++			exit ${EXIT_FAILURE};;
++		*)
++			if [ -z "$query_path" ] ; then
++				if [ ! -e "$1" ] ; then
++					echo "Error: Path \"${1}\" does not exist.">&2
++					exit ${EXIT_FAILURE}
++				fi
++				query_path=$1
++			else
++				echo "Warning: Ignoring overabundant parameter: \"${1}\"">&2
++			fi
++			shift;;
++		esac;
++	done
++
++	# default to current directory (usually equals the whole repository)
++	if [ -z "$query_path" ] ; then
++		query_path=.
++	fi
++	if [ -z "$action" ] ; then
++		show_help
++		echo "Error: No actions specified"
++		exit ${EXIT_FAILURE}
++	fi
++
++	$action "$query_path"
++}
++
++main $@
diff --git a/debian/patches/changelog-upstream b/debian/patches/changelog-upstream
new file mode 100644
index 00000000..e8afa635
--- /dev/null
+++ b/debian/patches/changelog-upstream
@@ -0,0 +1,398 @@
+Description: Add in upstream changelog
+ .
+ flashrom (1.2.0-0pureos8) amber-updates; urgency=medium
+ .
+   * Removing git-hooks in util/ and adding in debian dir.
+   * Adding in gbp in gitlab-ci.yml
+   * Looks like we have to have util/getrevision.sh if we want a version from the binary.
+   * Uncommenting rules/clean:: and --not-automatic-dbgsym
+   * Removing flashrom.udev
+   * Adding in versioninfo.inc so we don't have to do contortions to find this info.
+   * Patching the meson.build file to bring back log output files
+   * Upstream changes to meson.build file.
+Author: Jeremiah C. Foster <jeremiah.foster@puri.sm>
+
+---
+
+--- /dev/null
++++ flashrom-1.2.0/changelog
+@@ -0,0 +1,379 @@
++flashrom (1.1.0-0pureos1) green; urgency=medium
++
++  * New upstream version
++  * Changed maintainers to PureOS maintainers
++
++ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Wed, 07 Aug 2019 14:35:31 -0400
++
++flashrom (1.0.0-0pureos2) green; urgency=medium
++
++  * New compat version, updated standards version
++
++ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 24 Jan 2019 13:44:18 -0500
++
++flashrom (1.0.0-0pureos1) green; urgency=medium
++
++  * New upstream version
++
++ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 24 Jan 2019 13:41:34 -0500
++
++flashrom (0.9.9+r1954-1pureos1) green; urgency=medium
++
++  * Fork for PureOS:
++    + Set dev@puri.sm as maintainer, prefixing original XSBC-Original-.
++    + Set myself as uploader, dropping original.
++  * Suppress building *-dbgsym packages, to avoid NEW queue.
++  * No-change rebuild to fix segfault on PureOS.
++
++ -- Jonas Smedegaard <jonas.smedegaard@puri.sm>  Wed, 15 Nov 2017 13:34:32 +0100
++
++flashrom (0.9.9+r1954-1) unstable; urgency=medium
++
++  * New upstream release.
++  * Don't build-depend on libftdi1-dev on Hurd, it's not available.
++
++ -- Uwe Hermann <uwe@debian.org>  Sun, 13 Mar 2016 20:41:00 +0100
++
++flashrom (0.9.9~rc1+r1946-1) unstable; urgency=medium
++
++  * New upstream release (Closes: #788426, #802342).
++      + Partial support for alpha, hppa, m68k, sh, and s390 (Closes: 774405).
++  * debian/control:
++      + On kFreeBSD only build-depend on libusb-1.0-0-dev, that
++        package also includes the old libusb 0.1 API (Closes: #815947).
++        Thanks Steven Chamberlain for the patch!
++      + Don't build-depend on libusb-1.0-0-dev on Hurd, it's not available.
++      + Add pkg-config to build-depends, since it is used by the upstream
++        Makefile. Otherwise the Makefile uses hardcoded guesses, which
++        are not always correct.
++      + Drop "Recommends: dmidecode [any-i386 any-amd64 ia64 armhf]".
++        Upstream has its own code now, no longer uses dmidecode by default.
++  * debian/rules: Add "export DEB_BUILD_MAINT_OPTIONS = hardening=+all".
++  * Standards-Version: 3.9.7 (no changes required).
++  * Package description: Update list of supported devices.
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 01 Mar 2016 00:07:45 +0100
++
++flashrom (0.9.9~rc1+r1942-1) unstable; urgency=medium
++
++  * Acknowledge NMU, thanks Anibal Monsalve Salazar! (Closes: #775428).
++  * New upstream release (Closes: #786917).
++      + Dediprog SF100 support is now enabled by default (Closes: #639957).
++      + debian/patches/20_svn_version.patch: Drop, no longer needed (if the
++        tarball is generated via 'make tarball' from svn checkout).
++      + debian/patches/mips-fix-internal.patch: Drop, fixed upstream.
++  * New build-depends: libusb-1.0-0-dev (in addition to libusb-dev).
++  * Updated build-depends: libftdi-dev -> libftdi1-dev (Closes: #810372).
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 23 Feb 2016 19:34:07 +0100
++
++flashrom (0.9.7+r1852-1.1) unstable; urgency=medium
++
++  * Non-maintainer upload.
++  * Fix FTBFS on mipsel.
++    Patch by Dejan Latinovic <Dejan.Latinovic@imgtec.com>.
++    Add mips-fix-internal.patch.
++    Closes: #775428.
++
++ -- Anibal Monsalve Salazar <anibal@debian.org>  Wed, 14 Oct 2015 09:21:36 +0100
++
++flashrom (0.9.7+r1852-1) unstable; urgency=medium
++
++  * New upstream release.
++  * Standards-Version: 3.9.6 (no changes required).
++  * Use 'Architecture: any', flashrom should build/work pretty much everywhere.
++  * debian/patches:
++      + 10_disable_linuxspi.patch: Drop.
++      + 20_svn_version.patch: Update.
++  * Shorten dmidecode 'Recommends' to [any-i386 any-amd64 ia64 armhf].
++  * Add missing upstream ChangeLog file (via "svn log").
++
++ -- Uwe Hermann <uwe@debian.org>  Mon, 27 Oct 2014 21:20:52 +0100
++
++flashrom (0.9.7+r1782-1) unstable; urgency=high
++
++  * New upstream release (Closes: #746734, #690478).
++  * debian/compat: Upgrade from 5 to 9.
++  * Standards-Version: 3.9.5 (no changes required).
++
++ -- Uwe Hermann <uwe@debian.org>  Sat, 03 May 2014 17:39:35 +0200
++
++flashrom (0.9.6.1+r1563-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Wed, 08 Aug 2012 23:39:15 +0200
++
++flashrom (0.9.5.2+r1546-1) unstable; urgency=medium
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Fri, 29 Jun 2012 20:49:55 +0200
++
++flashrom (0.9.5.2+r1517-1) unstable; urgency=low
++
++  * New upstream release.
++  * Standards-Version: 3.9.3 (no changes required).
++
++ -- Uwe Hermann <uwe@debian.org>  Sat, 07 Apr 2012 23:27:50 +0200
++
++flashrom (0.9.5.1+r1508-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Sun, 26 Feb 2012 15:44:49 +0100
++
++flashrom (0.9.5+r1503-1) unstable; urgency=low
++
++  * New upstream release.
++  * debian/docs: Add mysteries_intel.txt.
++
++ -- Uwe Hermann <uwe@debian.org>  Mon, 20 Feb 2012 11:54:48 +0100
++
++flashrom (0.9.4+r1394-1) unstable; urgency=low
++
++  * New upstream release.
++  * debian/patches/10_svnversion.patch: Drop, no longer needed.
++
++ -- Uwe Hermann <uwe@debian.org>  Thu, 28 Jul 2011 21:29:32 +0200
++
++flashrom (0.9.3+r1323-1) unstable; urgency=low
++
++  * New upstream release.
++  * Standards-Version: 3.9.2 (no changes required).
++  * debian/rules: Delete .libdeps file in 'clean' target.
++
++ -- Uwe Hermann <uwe@debian.org>  Fri, 03 Jun 2011 16:53:47 +0200
++
++flashrom (0.9.2+r1141-2) unstable; urgency=high
++
++  * Drop alpha and netbsd-alpha from the arch list for now (builds fail).
++    + Keeping "urgency=high" due to high-priority fixes in the last upload,
++      in order to allow those fixes to migrate to testing.
++    + It's unclear how well alpha (if at all) is supported upstream at this
++      point. There's a compile-time #error in the upstream code breaking
++      the build intentionally on alpha right now.
++      Alpha support will be re-enabled as soon as this has been sorted out
++      upstream, but it may take quite a while.
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 17 Aug 2010 00:50:27 +0200
++
++flashrom (0.9.2+r1141-1) unstable; urgency=high
++
++  * New upstream release. Urgency high due to multiple critical bugfixes that
++    could potentially brick the PC (or worse: laptop) of users.
++    Other important fixes include:
++    + Properly writing Atmel AT25 chips would fail on some SPI controllers.
++    + Fix breakage with brick-potential on various non-x86 architectures.
++    + Fix broken reads on Winbond W25x16, especially on some ICH SPI chipsets.
++    + Fix write failure on 3COM NICs with parallel flash.
++    + Fix "byte merge" related corruption on some VIA chipsets.
++    + Fix some format string bugs.
++    + Fix hard hang on some recent (e.g. QM57) Intel chipsets.
++  * Install new upstream udev rules file to allow users to use flashrom
++    without root permissions on some (USB-based) programmers.
++  * Standards-Version: 3.9.1 (no changes required).
++  * debian/copyright: Updates.
++
++ -- Uwe Hermann <uwe@debian.org>  Sun, 15 Aug 2010 19:07:19 +0200
++
++flashrom (0.9.2+r1028-1) unstable; urgency=low
++
++  * New upstream release.
++  * Add dmidecode as Recommends on architectures where it's available.
++  * debian/README.Debian: Fix typo.
++  * debian/copyright: Update upstream svn URL.
++
++ -- Uwe Hermann <uwe@debian.org>  Fri, 04 Jun 2010 18:13:52 +0200
++
++flashrom (0.9.1+r946-1) unstable; urgency=high
++
++  * New upstream release.
++     + Urgency high, as it fixes multiple important bugs, including such bugs
++       which can potentially "brick" a user's mainboard. Details at
++       http://www.flashrom.org/pipermail/flashrom/2010-March/002507.html.
++     + This build should have a non-truncated manpage (Closes: #566217).
++  * Standards-Version: 3.8.4 (no changes required).
++
++ -- Uwe Hermann <uwe@debian.org>  Wed, 17 Mar 2010 09:50:05 +0100
++
++flashrom (0.9.1+r873-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Wed, 20 Jan 2010 15:18:23 +0100
++
++flashrom (0.9.1+r792-1) unstable; urgency=low
++
++  * New upstream release.
++  * debian/control, debian/copyright: Update upstream website to flashrom.org.
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 08 Dec 2009 10:13:35 +0100
++
++flashrom (0.9.1+r736-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 29 Sep 2009 13:09:58 +0200
++
++flashrom (0.9.1+r706-1) unstable; urgency=low
++
++  * New upstream release.
++  * Standards-Version: 3.8.3 (no changes required).
++  * debian/copyright: Update.
++
++ -- Uwe Hermann <uwe@debian.org>  Mon, 31 Aug 2009 18:32:13 +0200
++
++flashrom (0.9+r631-1) unstable; urgency=low
++
++  * New upstream release.
++     + The command line usage has changed a bit in this release:
++        + Combined operations like -wv or -Ewv are no longer allowed.
++        + The -w option automatically does an auto-verify after writing
++          (but you can also explicitly do it via 'flashrom -v file').
++        + The -E option is also automatically verified per default.
++     + Support for external programmers was added (-p), see manpage.
++     + Acer Aspire One is now marked unsupported upstream (Closes: #528308).
++  * Add build-dependency on libftdi-dev, flashrom now supports an
++    external libftdi-based programmer (ft2232spi).
++  * debian/patches/20_drop_svndef.patch: Drop, we use 'make tarball' now,
++    which properly handles svn version printing in flashrom.
++  * Standards-Version: 3.8.2 (no changes required).
++  * debian/copyright: Update.
++
++ -- Uwe Hermann <uwe@debian.org>  Thu, 25 Jun 2009 14:18:53 +0200
++
++flashrom (0.9+r544-1) unstable; urgency=low
++
++  * New upstream release.
++  * debian/patches/10_makefile.patch: Drop, no longer needed.
++  * debian/copyright: Update.
++
++ -- Uwe Hermann <uwe@debian.org>  Thu, 21 May 2009 21:34:03 +0200
++
++flashrom (0.9+r446-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Sat, 11 Apr 2009 16:28:33 +0200
++
++flashrom (0.0+r3844-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Sat, 27 Dec 2008 09:05:27 +0100
++
++flashrom (0.0+r3734-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Sat, 08 Nov 2008 01:38:08 +0100
++
++flashrom (0.0+r3613-1) unstable; urgency=low
++
++  * New upstream release.
++  * debian/watch: Add dummy file to silence lintian (we track svn revisions).
++
++ -- Uwe Hermann <uwe@debian.org>  Sat, 27 Sep 2008 19:28:36 +0200
++
++flashrom (0.0+r3397-1) unstable; urgency=low
++
++  * New upstream release.
++  * Standards-Version: 3.8.0 (no changes required).
++
++ -- Uwe Hermann <uwe@debian.org>  Mon, 30 Jun 2008 17:11:25 +0200
++
++flashrom (0.0+r3274-1) unstable; urgency=low
++
++  * New upstream release.
++  * debian/control:
++    + pciutils-dev was renamed to libpci-dev (Closes: #478379).
++    + Drop ia64 from architectures list for now, unlikely to work.
++    + Don't link with -lz anymore, don't build-depend on zlib1g-dev.
++      We don't explicitly need zlib, libpci-dev now properly depends on it.
++  * Add upstream changelog ('svn log' output) to the package (Closes: #467398).
++
++ -- Uwe Hermann <uwe@debian.org>  Sun, 04 May 2008 00:34:44 +0200
++
++flashrom (0.0+r3112-2) unstable; urgency=low
++
++  * Fix debian/rules to make it work on Ubuntu, too (Closes: #466994).
++
++ -- Uwe Hermann <uwe@debian.org>  Sat, 23 Feb 2008 21:17:09 +0100
++
++flashrom (0.0+r3112-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Thu, 21 Feb 2008 00:11:54 +0100
++
++flashrom (0.0+r3073-1) unstable; urgency=low
++
++  * New upstream release (Closes: #462248).
++    + Flashrom is now installed in /usr/sbin instead of /usr/bin.
++    + The manpage is now in section 8 (not 1).
++    + Fix broken references to old bug tracker URL (Closes: #460554).
++  * Restrict list of architectures to the known-working ones for now.
++    More architectures will gradually be re-added if we're sure they work.
++    + These are known to work: amd64, i386, kfreebsd-amd64, kfreebsd-i386
++    + These should work (untested, though): alpha, hurd-i386, ia64,
++      netbsd-alpha, netbsd-i386
++    + These are disabled for now, as flashrom will very likely not work: arm,
++      armel, armeb, hppa, m32r, m68k, mips, mipsel, powerpc, sh, sparc, s390
++  * Standards-Version: 3.7.3 (no changes required).
++  * debian/control:
++     + Add Homepage field.
++     + Update package description.
++  * debian/copyright: Update URLs and list of authors.
++  * Simplified packaging a bit.
++
++ -- Uwe Hermann <uwe@debian.org>  Thu, 24 Jan 2008 13:47:48 +0100
++
++flashrom (0.0+r2769-1) unstable; urgency=low
++
++  * New upstream release.
++  * Do not attempt to build flashrom on S/390, as it doesn't build
++    and is not useful there anyway (Closes: #404342, #418712).
++    It is yet to be determined on which other architectures flashrom can
++    work and on which not.
++  * Honour DEB_BUILD_OPTIONS=nostrip variable by removing hardcoded 'strip'
++    invocation in the Makefile and letting cdbs handle it (Closes: #436850).
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 11 Sep 2007 17:54:11 +0200
++
++flashrom (0.0+r2739-1) unstable; urgency=low
++
++  * New upstream release.
++
++ -- Uwe Hermann <uwe@debian.org>  Sun, 15 Jul 2007 15:23:51 +0200
++
++flashrom (0.0+r2601-1) unstable; urgency=low
++
++  * New upstream release.
++  * Drop a few patches which are now merged upstream.
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 10 Apr 2007 12:38:58 +0200
++
++flashrom (0.0+r2526-2) unstable; urgency=medium
++
++  * Add missing build dependency on zlib1g-dev (Closes: #403322).
++    Thanks Julien Danjou <acid@debian.org> and
++    Alex de Oliveira Silva <enerv@host.sk>.
++  * Standards-Version: 3.7.2.2 (no changes required).
++
++ -- Uwe Hermann <uwe@debian.org>  Tue, 19 Dec 2006 10:36:04 +0100
++
++flashrom (0.0+r2526-1) unstable; urgency=low
++
++  * New upstream release.
++  * Do not compile in DoC support (it's considered unsupported upstream).
++    This will also make the flash part identification process a lot faster.
++
++ -- Uwe Hermann <uwe@debian.org>  Thu, 14 Dec 2006 18:37:07 +0100
++
++flashrom (0.0+r2504-1) unstable; urgency=low
++
++  * Initial release (Closes: #399893).
++
++ -- Uwe Hermann <uwe@debian.org>  Thu, 14 Dec 2006 16:56:49 +0100
++
diff --git a/debian/patches/exported-versioninfo-from-upstream b/debian/patches/exported-versioninfo-from-upstream
deleted file mode 100644
index 9c91004a..00000000
--- a/debian/patches/exported-versioninfo-from-upstream
+++ /dev/null
@@ -1,28 +0,0 @@
-Description: flashrom version info	
- There are a couple shell scripts, a Makefile, and a meson build file
- that all need to know or try to find the version info. But the
- versioninfo file seems to be the smartest choice for our needs.
- .
- flashrom (1.2.0-0pureos7) amber-updates; urgency=medium
- .
-   * Found a cleaner way to remove git-hooks directory
-   * Bringing back in version information
-Author: Jeremiah C. Foster <jeremiah.foster@puri.sm>
-
----
-The information above should follow the Patch Tagging Guidelines, please
-checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
-are templates for supplementary fields that you might want to add:
-
-Origin: <vendor|upstream|other>, <url of original patch>
-Bug: <url in upstream bugtracker>
-Bug-Debian: https://bugs.debian.org/<bugnumber>
-Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
-Forwarded: <no|not-needed|url proving that it has been forwarded>
-Reviewed-By: <name and email of someone who approved the patch>
-Last-Update: 2020-06-12
-
---- /dev/null
-+++ flashrom-1.2.0/versioninfo.inc
-@@ -0,0 +1 @@
-+VERSION = v1.2-3
diff --git a/debian/patches/series b/debian/patches/series
index 78eb24df..97fbf2b5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
-upstream-versioning-tools
-exported-versioninfo-from-upstream
+bring-in-more-upstream-files
+changelog-upstream
diff --git a/debian/patches/upstream-versioning-tools b/debian/patches/upstream-versioning-tools
deleted file mode 100644
index 68672396..00000000
--- a/debian/patches/upstream-versioning-tools
+++ /dev/null
@@ -1,257 +0,0 @@
-Description: Bring in upstreams versioning tools
- Upstream does a little dance to version.
- .
- flashrom (1.2.0-0pureos7) amber-updates; urgency=medium
- .
-   * Found a cleaner way to remove git-hooks directory
-   * Bringing back in version information
-Author: Jeremiah C. Foster <jeremiah.foster@puri.sm>
-
----
-
---- /dev/null
-+++ flashrom-1.2.0/util/getrevision.sh
-@@ -0,0 +1,238 @@
-+#!/bin/sh
-+# NB: Supposed to be POSIX compatible but at least the usage of 'local' is not.
-+#
-+# This file is part of the flashrom project.
-+#
-+# Copyright (C) 2005 coresystems GmbH <stepan@coresystems.de>
-+# Copyright (C) 2009,2010 Carl-Daniel Hailfinger
-+# Copyright (C) 2010 Chromium OS Authors
-+# Copyright (C) 2013-2016 Stefan Tauner
-+#
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 2 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+#
-+
-+EXIT_SUCCESS=0
-+EXIT_FAILURE=1
-+
-+# Make sure we don't get translated output
-+export LC_ALL=C
-+# nor local times or dates
-+export TZ=UTC0
-+
-+# Helper functions
-+# First argument is the path to inspect (usually optional; without
-+# it the whole repository will be considered)
-+git_has_local_changes() {
-+	git update-index -q --refresh >/dev/null
-+	! git diff-index --quiet HEAD -- "$1"
-+}
-+
-+git_last_commit() {
-+	# git rev-parse --short HEAD would suffice if repository as a whole is of interest (no $1)
-+	git log --pretty=format:"%h" -1 -- "$1"
-+}
-+
-+git_is_file_tracked() {
-+	git ls-files --error-unmatch -- "$1" >/dev/null 2>&1
-+}
-+
-+is_file_tracked() {
-+	git_is_file_tracked "$1"
-+}
-+
-+# Tries to find a remote source for the changes committed locally.
-+# This includes the URL of the remote repository including the last commit and a suitable branch name.
-+# Takes one optional argument: the path to inspect
-+git_url() {
-+	last_commit=$(git_last_commit "$1")
-+	# get all remote branches containing the last commit (excluding origin/HEAD)
-+	branches=$(git branch -r --contains $last_commit | sed '/\//!d;/.*->.*/d;s/[\t ]*//')
-+	if [ -z "$branches" ] ; then
-+		echo "No remote branch contains a suitable commit">&2
-+		return
-+	fi
-+
-+	# find "nearest" branch
-+	local mindiff=9000
-+	local target=
-+	for branch in $branches ; do
-+		curdiff=$(git rev-list --count $last_commit..$branch)
-+		if [ $curdiff -ge $mindiff ] ; then
-+			continue
-+		fi
-+		mindiff=$curdiff
-+		target=$branch
-+	done
-+
-+	echo "$(git ls-remote --exit-code --get-url ${target%/*}) ${target#*/}"
-+}
-+
-+# Returns a string indicating where others can get the current source code (excluding uncommitted changes).
-+# Takes one optional argument: the path to inspect
-+scm_url() {
-+	local url=
-+
-+	if git_is_file_tracked "$1" ; then
-+		url="$(git_url "$1")"
-+	else
-+		return ${EXIT_FAILURE}
-+	fi
-+
-+	echo "${url}"
-+}
-+
-+# Retrieve timestamp since last modification. If the sources are pristine,
-+# then the timestamp will match that of the SCM's most recent modification
-+# date.
-+timestamp() {
-+	local t
-+
-+	# date syntaxes are manifold:
-+	# gnu		date [-d input]... [+FORMAT]
-+	# netbsd	date [-ajnu] [-d date] [-r seconds] [+format] [[[[[[CC]yy]mm]dd]HH]MM[.SS]]
-+	# freebsd	date [-jnu]  [-d dst] [-r seconds] [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] [...]
-+	# dragonflybsd	date [-jnu]  [-d dst] [-r seconds] [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] [...]
-+	# openbsd	date [-aju]  [-d dst] [-r seconds] [+format] [[[[[[cc]yy]mm]dd]HH]MM[.SS]] [...]
-+	if git_is_file_tracked "$2" ; then
-+		# are there local changes?
-+		if git_has_local_changes "$2" ; then
-+			t=$(date -u "${1}")
-+		else
-+			# No local changes, get date of the last commit
-+			case $(uname) in
-+			# Most BSD dates do not support parsing date values from user input with -d but all of
-+			# them support parsing epoch seconds with -r. Thanks to git we can easily use that:
-+			NetBSD|OpenBSD|DragonFly|FreeBSD)
-+				t=$(date -u -r "$(git log --pretty=format:%ct -1 -- $2)"  "$1" 2>/dev/null);;
-+			*)
-+				t=$(date -d "$(git log --pretty=format:%cD -1 -- $2)" -u "$1" 2>/dev/null);;
-+			esac
-+		fi
-+	else
-+		t=$(date -u "$1")
-+	fi
-+
-+	if [ -z "$t" ]; then
-+		echo "Warning: Could not determine timestamp." 2>/dev/null
-+	fi
-+	echo "${t}"
-+}
-+
-+revision() {
-+	local r
-+	if git_is_file_tracked "$1" ; then
-+		r=$(git describe $(git_last_commit "$1"))
-+		if git_has_local_changes "$1" ; then
-+			r="$r-dirty"
-+		fi
-+	else
-+		r="unknown"
-+	fi
-+
-+	echo "${r}"
-+}
-+
-+is_tracked() {
-+	is_file_tracked "$1"
-+}
-+
-+show_help() {
-+	echo "Usage:
-+	${0} <command> [path]
-+
-+Commands
-+    -h or --help
-+        this message
-+    -c or --check
-+        test if path is under version control at all
-+    -r or --revision
-+        return unique revision information including an indicator for
-+        uncommitted changes
-+    -U or --url
-+        URL associated with the latest commit
-+    -d or --date
-+        date of most recent modification
-+    -t or --timestamp
-+        timestamp of most recent modification
-+"
-+	return
-+}
-+
-+check_action() {
-+	if [ -n "$action" ]; then
-+		echo "Error: Multiple actions given.">&2
-+		exit ${EXIT_FAILURE}
-+	fi
-+}
-+
-+main() {
-+	local query_path=
-+	local action=
-+
-+	# Argument parser loop
-+	while [ $# -gt 0 ];
-+	do
-+		case ${1} in
-+		-h|--help)
-+			action=show_help;
-+			shift;;
-+		-U|--url)
-+			check_action $1
-+			action=scm_url
-+			shift;;
-+		-d|--date)
-+			check_action $1
-+			action="timestamp +%Y-%m-%d" # refrain from suffixing 'Z' to indicate it's UTC
-+			shift;;
-+		-r|--revision)
-+			check_action $1
-+			action=revision
-+			shift;;
-+		-t|--timestamp)
-+			check_action $1
-+			action="timestamp +%Y-%m-%dT%H:%M:%SZ" # There is only one valid time format! ISO 8601
-+			shift;;
-+		-c|--check)
-+			check_action $1
-+			action=is_tracked
-+			shift;;
-+		-*)
-+			show_help;
-+			echo "Error: Invalid option: ${1}"
-+			exit ${EXIT_FAILURE};;
-+		*)
-+			if [ -z "$query_path" ] ; then
-+				if [ ! -e "$1" ] ; then
-+					echo "Error: Path \"${1}\" does not exist.">&2
-+					exit ${EXIT_FAILURE}
-+				fi
-+				query_path=$1
-+			else
-+				echo "Warning: Ignoring overabundant parameter: \"${1}\"">&2
-+			fi
-+			shift;;
-+		esac;
-+	done
-+
-+	# default to current directory (usually equals the whole repository)
-+	if [ -z "$query_path" ] ; then
-+		query_path=.
-+	fi
-+	if [ -z "$action" ] ; then
-+		show_help
-+		echo "Error: No actions specified"
-+		exit ${EXIT_FAILURE}
-+	fi
-+
-+	$action "$query_path"
-+}
-+
-+main $@
---- flashrom-1.2.0.orig/versioninfo.inc
-+++ /dev/null
-@@ -1,2 +0,0 @@
--VERSION = v1.2
--MAN_DATE = 2019-12-31
diff --git a/meson.build b/meson.build
index 375089c3..2c5ba071 100644
--- a/meson.build
+++ b/meson.build
@@ -393,7 +393,6 @@ executable(
   ],
   c_args : [
     cargs,
-    '-DSTANDALONE',
     '-DCONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_INVALID',
     '-DCONFIG_DEFAULT_PROGRAMMER_ARGS=""',
   ],
diff --git a/util/getrevision.sh b/util/getrevision.sh
old mode 100644
new mode 100755
diff --git a/versioninfo.inc b/versioninfo.inc
index 2c74ea6e..3c809b34 100644
--- a/versioninfo.inc
+++ b/versioninfo.inc
@@ -1 +1,2 @@
-VERSION = v1.2-3
+VERSION = v1.2
+MAN_DATE = 2019-12-31
-- 
GitLab