summaryrefslogtreecommitdiff
path: root/debian/patches/debian-ways
blob: 0aec10b3ae3c56f4ae19ada17252bead707b4e78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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