summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgustavo panizzo <gfa@zumbi.com.ar>2018-03-11 12:35:15 +0000
committergustavo panizzo <gfa@zumbi.com.ar>2018-03-11 14:29:51 +0000
commita60928df05461916f6612f9013c9bedadca5d9cb (patch)
treeb0451f7ac5d730a48acdd29f14a95b0fe42ecb60
parent45787adc30f55fa37a6f2f975f567bc48c382242 (diff)
Add patch to properly show the package version
-rw-r--r--debian/patches/debian-ways24
-rw-r--r--debian/patches/series1
2 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/debian-ways b/debian/patches/debian-ways
new file mode 100644
index 0000000..0aec10b
--- /dev/null
+++ b/debian/patches/debian-ways
@@ -0,0 +1,24 @@
+Description:
+ This patch overrides upstream's method to detect the release
+ version
+Forwarded: no
+Author: gustavo panizzo <gfa@zumbi.com.ar>
+Last-Update: 2018-03-11
+--- a/Makefile
++++ b/Makefile
+@@ -15,7 +15,14 @@ CC ?= gcc
+ CFLAGS ?= -g -O0
+ CFLAGS += -Wall -Wextra -std=c99 -pedantic
+ GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
+-CFLAGS += -DPROGRAM_VERSION=\"$(GIT_VERSION)\"
++
++# Gets the full version of the source package including debian version
++DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
++DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
++# # Gets only the upstream version of the package
++DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
++
++CFLAGS += -DPROGRAM_VERSION=\"$(DEB_UPSTREAM_VERSION)\"
+
+ ifeq ($(UNAME_S),Linux)
+ LDFLAGS += -Wl,-z,relro -lusb-1.0
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b2e9488
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+debian-ways