From c6077b1e6ca74917384f59af6c328c4734558e52 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Wed, 10 Dec 2014 12:25:43 +0000 Subject: [PATCH] Use the package version as the version number compiled into the binary. --- debian/changelog | 1 + debian/rules | 4 +++- dump1090.c | 5 +++-- dump1090.h | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7229379..60ac286 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ dump1090-mutability (1.08.2302.14+1mu-3) UNRELEASED; urgency=medium the interval is disabled, it makes more sense that way. * Be much more cautious about missing config settings so we don't explode so badly if something is omitted. + * Use the package version as the version number compiled into the binary. -- Oliver Jowett Wed, 10 Dec 2014 02:01:27 +0000 diff --git a/debian/rules b/debian/rules index 2f3b1c6..8f04ea0 100755 --- a/debian/rules +++ b/debian/rules @@ -14,8 +14,10 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk +VER=$(shell dpkg-parsechangelog -SVersion) + override_dh_auto_build: - dh_auto_build -- 'EXTRACFLAGS=-DHTMLPATH=\"/usr/share/dump1090-mutability/html\"' + dh_auto_build -- 'EXTRACFLAGS=-DHTMLPATH=\"/usr/share/dump1090-mutability/html\" -DMODES_DUMP1090_VERSION=\"$(VER)\"' override_dh_install: dh_install diff --git a/dump1090.c b/dump1090.c index 7c06e0e..7d56416 100644 --- a/dump1090.c +++ b/dump1090.c @@ -403,7 +403,7 @@ void snipMode(int level) { void showHelp(void) { printf( "-----------------------------------------------------------------------------\n" -"| dump1090 ModeS Receiver Ver : " MODES_DUMP1090_VERSION " |\n" +"| dump1090 ModeS Receiver %30s |\n" "-----------------------------------------------------------------------------\n" "--device-index Select RTL device (default: 0)\n" "--gain Set gain (default: max gain. Use -10 for auto-gain)\n" @@ -457,7 +457,8 @@ void showHelp(void) { " C = Log frames with good CRC\n" " p = Log frames with bad preamble\n" " n = Log network debugging info\n" -" j = Log frames to frames.js, loadable by debug.html\n" +" j = Log frames to frames.js, loadable by debug.html\n", +"version " MODES_DUMP1090_VERSION ); } diff --git a/dump1090.h b/dump1090.h index f7ee3ec..2fffc3a 100644 --- a/dump1090.h +++ b/dump1090.h @@ -37,7 +37,9 @@ // MinorVer changes when additional features are added, but not for bug fixes (range 00-99) // DayDate & Year changes for all changes, including for bug fixes. It represent the release date of the update // -#define MODES_DUMP1090_VERSION "1.10.3010.14" +#ifndef MODES_DUMP1090_VERSION +# define MODES_DUMP1090_VERSION "1.10.3010.14" +#endif // ============================= Include files ==========================