From 6c6a6e6ba3a8ea17bbe18f89f8e107557ce89f6b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 31 Aug 2015 15:03:20 +0000 Subject: [PATCH] scst.spec: Make version numbers monotonically increasing for the git tree Additionally, make the fourth component of the version number configurable. An example: make RPM REVISION=r733 Reported-by: Consus git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6491 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 6 +++--- scstadmin/Makefile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b7f8fe971..93d8c76d1 100644 --- a/Makefile +++ b/Makefile @@ -54,11 +54,11 @@ EMULEX_DIR=emulex ISCSI_DIR=iscsi-scst -VERSION = $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)."; \ - if svn info >/dev/null 2>&1; \ +REVISION ?= $(shell if svn info >/dev/null 2>&1; \ then svn info | sed -n 's/^Revision:[[:blank:]]*/r/p';\ - else git show | sed -n 's/^commit[[:blank:]]*\(.......\).*/\1/p'; \ + else echo -n r; git log | grep -c ^commit; \ fi) +VERSION = $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h).$(REVISION)") help: @echo " all : make all" diff --git a/scstadmin/Makefile b/scstadmin/Makefile index 72bb5b831..0cb1cf85c 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -2,11 +2,11 @@ ifndef PREFIX PREFIX=/usr/local endif -VERSION = $(shell echo -n "$$(sed -n 's/^[[:blank:]]*\$$VERSION[[:blank:]]*=[[:blank:]]*[\"'"'"']\([0-9.]*\)[\"'"'"'];$$/\1/p' scstadmin/scst-*/lib/SCST/SCST.pm)."; \ - if svn info >/dev/null 2>&1; \ +REVISION ?= $(shell if svn info >/dev/null 2>&1; \ then svn info | sed -n 's/^Revision:[[:blank:]]*/r/p';\ - else git show | sed -n 's/^commit[[:blank:]]*\(.......\).*/\1/p'; \ + else echo -n r; git log | grep -c ^commit; \ fi) +VERSION = $(shell echo -n "$$(sed -n 's/^[[:blank:]]*\$$VERSION[[:blank:]]*=[[:blank:]]*[\"'"'"']\([0-9.]*\)[\"'"'"'];$$/\1/p' scstadmin/scst-*/lib/SCST/SCST.pm).$(REVISION)") SCSTADMIN_DIR = $(shell if [ ! -h scstadmin ]; then \ rm -f scstadmin; \