From b557752369a35ddf6cd8b8f06f19636aa2feb730 Mon Sep 17 00:00:00 2001 From: Keine_Ahnung Date: Wed, 27 Feb 2013 16:54:53 +0100 Subject: new versionsnumer system for git checkouts --- Makefile.1.6 | 7 +++++-- Makefile.1.7.x | 7 +++++-- script/vdr-uactivity | 0 uactivity.c | 2 +- version | 1 + 5 files changed, 12 insertions(+), 5 deletions(-) mode change 100755 => 100644 script/vdr-uactivity create mode 100644 version diff --git a/Makefile.1.6 b/Makefile.1.6 index fcd7593..af6c6cc 100644 --- a/Makefile.1.6 +++ b/Makefile.1.6 @@ -13,7 +13,10 @@ PLUGIN = uactivity ### The version number of this plugin (taken from the main source file): -VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') +VERSION = $(shell [ -d .git ] && git describe --tags --dirty| sed 's/^v//' || cat version) +ifeq ($(strip $(VERSION)),) + $(error VERSION is undefined) +endif ### The C++ compiler and options: @@ -55,7 +58,7 @@ PACKAGE = vdr-$(ARCHIVE) INCLUDES += -I$(VDRDIR)/include -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DUACTIVITY_COMMAND='"$(PLUGIN_UACTIVITY_COMMAND)"' +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DUACTIVITY_COMMAND='"$(PLUGIN_UACTIVITY_COMMAND)"' -DPLUGIN_VERSION='"$(VERSION)"' ### The object files (add further files here): diff --git a/Makefile.1.7.x b/Makefile.1.7.x index 6c2c777..b22528e 100644 --- a/Makefile.1.7.x +++ b/Makefile.1.7.x @@ -11,7 +11,10 @@ PLUGIN = uactivity ### The version number of this plugin (taken from the main source file): -VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') +VERSION = $(shell [ -d .git ] && git describe --tags --dirty| sed 's/^v//' || cat version) +ifeq ($(strip $(VERSION)),) + $(error VERSION is undefined) +endif ### The directory environment: @@ -61,7 +64,7 @@ SOFILE = libvdr-$(PLUGIN).so INCLUDES += -DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DUACTIVITY_COMMAND='"$(PLUGIN_UACTIVITY_COMMAND)"' +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DUACTIVITY_COMMAND='"$(PLUGIN_UACTIVITY_COMMAND)"' -DPLUGIN_VERSION='"$(VERSION)"' ### The object files (add further files here): diff --git a/script/vdr-uactivity b/script/vdr-uactivity old mode 100755 new mode 100644 diff --git a/uactivity.c b/uactivity.c index f5f5cf9..5e9516e 100644 --- a/uactivity.c +++ b/uactivity.c @@ -17,7 +17,7 @@ #define STRINGIFY(x) STRINGIFYX(x) #define WATCHDOG 0 -static const char *VERSION = "0.0.1pre"; +static const char *VERSION = PLUGIN_VERSION; static const char *DESCRIPTION = trNOOP("running shellscipts based upton user aktivity changes"); class cPluginUactivity : public cPlugin { diff --git a/version b/version new file mode 100644 index 0000000..670ae3e --- /dev/null +++ b/version @@ -0,0 +1 @@ +0.0.1-git \ No newline at end of file -- cgit v1.2.3