diff mbox

[ndctl] ndctl: fix rpm source url, switch back to v$VERSION tag scheme

Message ID 146446831017.33347.13551869494702303909.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit 27683159de2c
Headers show

Commit Message

Dan Williams May 28, 2016, 8:45 p.m. UTC
The way to have github generate tarballs in ndctl-$VERSION format while
maintaining a v$VERSION tag scheme is to use a source url in the
following format:

https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 git-version   |   10 +++++-----
 ndctl.spec.in |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/git-version b/git-version
index 03b44a613a57..3823ee29afaf 100755
--- a/git-version
+++ b/git-version
@@ -2,9 +2,9 @@ 
 
 to_ver() {
 	VN=$1
-	#drop leading 'ndctl-' out of the version so its a pure number
-	if [ ${VN:0:6} = "ndctl-" ]; then
-			VN=${VN:6}
+	#drop leading 'v' out of the version so its a pure number
+	if [ ${VN:0:1} = "v" ]; then
+			VN=${VN:1}
 	fi
 	echo $VN
 }
@@ -29,10 +29,10 @@  LF='
 if test -f version; then
 	VN=$(cat version) || VN="$DEF_VER"
 elif test -d ${GIT_DIR:-.git} -o -f .git &&
-	VN=$(git describe --match "ndctl-[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
+	VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;
-	ndctl-[0-9]*)
+	v[0-9]*)
 		VN="$(dirty $VN)"
 	esac; then
 	VN=$(echo "$VN" | sed -e 's/-/./g');
diff --git a/ndctl.spec.in b/ndctl.spec.in
index 221cd755e2a6..0aaef03b2e5b 100644
--- a/ndctl.spec.in
+++ b/ndctl.spec.in
@@ -5,7 +5,7 @@  Summary:	Manage "libnvdimm" subsystem devices (Non-volatile Memory)
 License:	GPLv2
 Group:		System Environment/Base
 Url:		https://github.com/pmem/ndctl
-Source0:	https://github.com/pmem/ndctl/archive/ndctl-%{version}.tar.gz
+Source0:	https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 
 BuildRequires:	autoconf
 BuildRequires:	asciidoc