Permalink
Browse files

Allow for tagged releases when building RPMs.

This change allows for tags such as 1.8.0.1 or
git describe output that extends it.  It ends up losing
the RPM metadata in that case, but in a known way.

Will pursue a better versioning fix later.

Change-Id: Iab1167eece5c4a53800ac02d5bdbd408b708d2c4
Reviewed-on: http://review.couchbase.org/12574
Tested-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
  • Loading branch information...
1 parent 2e398e5 commit 5b164251dcb0e11a48f8b93593d349a13f954b78 @ingenthr ingenthr committed Jan 22, 2012
Showing with 11 additions and 5 deletions.
  1. +1 −1 config/version.pl
  2. +3 −3 packaging/rpm/libvbucket.spec.in
  3. +7 −1 packaging/rpm/package.mk
View
@@ -4,7 +4,7 @@
use warnings;
use strict;
-my $version = `git describe --long`;
+my $version = `git describe`;
chomp $version;
# Test the various versions.
#my $version = 'foob';
@@ -9,8 +9,8 @@ Packager: Couchbase SDK Team <support@couchbase.com>
License: Apache-2
Group: System Environment/Libraries
URL: http://www.couchbase.com
-Source: %{name}-%{version}_%{release}.tar.gz
-BuildRoot: %{_topdir}/build/%{name}-%{version}_%{release}
+Source: @TARREDAS@.tar.gz
+BuildRoot: %{_topdir}/build/@TARREDAS@
%description
libvbucket is a library providing vbucket distribution layer for Couchbase
@@ -33,7 +33,7 @@ Requires: %{name}1
Development files for the vbucket library for Couchbase.
%prep
-%setup -q -n %{name}-%{version}_%{release}
+%setup -q -n @TARREDAS@
%configure
%build
View
@@ -4,6 +4,12 @@ RPM_WORKSPACE=$(shell pwd)/build
RPM_DIR=$(RPM_WORKSPACE)/rpmbuild
RPM_VER=$(shell echo $(VERSION) | awk -F_ '{ print $$1 }')
RPM_REL=$(shell echo $(VERSION) | awk -F_ '{ print $$2"_"$$3 }')
+ifeq ($(RPM_REL),_)
+ RPM_REL=1
+ TARPREFIX=%{name}-%{version}
+else
+ TARPREFIX=%{name}-%{version}_%{release}
+endif
dist-rpm: dist
rm -rf $(RPM_WORKSPACE)
@@ -13,7 +19,7 @@ dist-rpm: dist
mkdir $(RPM_DIR)/RPMS
mkdir $(RPM_DIR)/SRPMS
cp $(PACKAGE)-$(VERSION).tar.gz $(RPM_DIR)/SOURCES
- sed 's/@VERSION@/$(RPM_VER)/g;s/@RELEASE@/$(RPM_REL)/g' < packaging/rpm/$(PACKAGE).spec.in > $(RPM_WORKSPACE)/$(PACKAGE).spec
+ sed 's/@VERSION@/$(RPM_VER)/g;s/@RELEASE@/$(RPM_REL)/g;s/@TARREDAS@/$(TARPREFIX)/g' < packaging/rpm/$(PACKAGE).spec.in > $(RPM_WORKSPACE)/$(PACKAGE).spec
(cd $(RPM_WORKSPACE); rpmbuild -ba $(PACKAGE).spec)
mv $(RPM_DIR)/RPMS/*/*.rpm `pwd`
mv $(RPM_DIR)/SRPMS/*.rpm `pwd`

0 comments on commit 5b16425

Please sign in to comment.