[liblinear] 04/09: d/rules: Update get-orig-source for new x.y.z versioning scheme

Christian Kastner ckk at moszumanska.debian.org
Sun Nov 1 17:03:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

ckk pushed a commit to branch master
in repository liblinear.

commit 406feddf6c8aad0916da94391c3b93a600c6cefc
Author: Christian Kastner <ckk at kvr.at>
Date:   Sun Nov 1 16:41:44 2015 +0100

    d/rules: Update get-orig-source for new x.y.z versioning scheme
---
 debian/rules | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/debian/rules b/debian/rules
index df9622e..cd02b45 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,10 +7,21 @@
 
 # Path to package source directory 
 PKGDIR := $(dir $(firstword $(MAKEFILE_LIST)))..
-# Get version numbers for SONAME from changelog
-UPVER := $(shell cd $(PKGDIR) && dpkg-parsechangelog -SVersion | \
-		sed -rne 's/([0-9]+\.[0-9]+).*/\1/p')
-export UPVER
+
+# Needed for our Makefile customizations, and for get-orig-source
+DEBVER := $(shell cd $(PKGDIR) && dpkg-parsechangelog -SVersion | \
+		sed -rne 's/([0-9]\.[0-9]\.[0-9]).*/\1/p')
+DMAJOR := $(shell echo $(DEBVER) | sed -rne 's/([0-9])\.[0-9]\.[0-9].*/\1/p')
+DMINOR := $(shell echo $(DEBVER) | sed -rne 's/[0-9]\.([0-9])\.[0-9].*/\1/p')
+DPATCH := $(shell echo $(DEBVER) | sed -rne 's/[0-9]\.[0-9]\.([0-9]).*/\1/p')
+# Replicate upstream's naming convention... (see d/watch)
+ifeq ($(DPATCH),0)
+    UPVER := $(DMAJOR).$(DMINOR)
+else
+    UPVER := $(DMAJOR).$(DMINOR)$(DPATCH)
+endif
+export UPVER DEBVER DMAJOR DMINOR DPATCH
+
 
 export DEB_CFLAGS_MAINT_APPEND += -Wall
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -21,6 +32,7 @@ endif
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
+
 %:
 	dh $@ --with=python2,python3
 
@@ -44,7 +56,7 @@ get-orig-source:
 		--noconf \
 		--no-symlink \
 		--force-download \
-		--download-version $(UPVER) \
+		--download-version $(DEBVER) \
 		--check-dirname-level=0 \
 		--destdir=$(CURDIR) \
 		$(PKGDIR)
@@ -66,13 +78,13 @@ get-orig-source:
 	sed -i -e 's| blas/blas.a||' liblinear-$(UPVER)/Makefile
 	sed -i -e '/blas/d' liblinear-$(UPVER)/Makefile
 	
-	mv liblinear-$(UPVER) liblinear-$(UPVER)+dfsg
+	mv liblinear-$(UPVER) liblinear-$(DEBVER)+dfsg
 	tar \
 		--owner=root \
 		--group=root \
 		--mode=a+rX \
 		--xz \
-		-cf liblinear_$(UPVER)+dfsg.orig.tar.xz \
-		liblinear-$(UPVER)+dfsg
+		-cf liblinear_$(DEBVER)+dfsg.orig.tar.xz \
+		liblinear-$(DEBVER)+dfsg
 	
-	rm -rf liblinear-$(UPVER)+dfsg
+	rm -rf liblinear-$(DEBVER)+dfsg

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/liblinear.git



More information about the debian-science-commits mailing list