Skip to content

Commit

Permalink
Build RPM package for CentOS, RedHat etc.
Browse files Browse the repository at this point in the history
Change-Id: I34b70db748ebb0f7b6780bde4730b64601d96c89
Reviewed-on: http://review.couchbase.org/11459
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
  • Loading branch information
avsej committed Dec 7, 2011
1 parent 837aded commit 599d7f0
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -37,6 +37,7 @@
/libvbucket*.changes
/libvbucket*.deb
/libvbucket*.dsc
/libvbucket*.rpm
/libvbucket*.tar.gz
/libvbucket.dll
/libvbucket.exp
Expand Down
69 changes: 69 additions & 0 deletions packaging/rpm/libvbucket.spec.in
@@ -0,0 +1,69 @@
%define _topdir %(pwd)/rpmbuild

Summary: vbucket library for memcached
Name: libvbucket
Version: @VERSION@
Release: @RELEASE@
Vendor: Couchbase, Inc.
Packager: Couchbase SDK Team <support@couchbase.com>
License: Apache-2
Group: System Environment/Libraries
URL: https://github.com/membase/libvbucket
Source: %{name}-%{version}_%{release}.tar.gz
BuildRoot: build/%{name}-%{version}_%{release}

%description
libvbucket is a library providing vbucket distribution layer for memcached
clients.

%package -n %{name}1
Group: System Environment/Libraries
Summary: vbucket library for memcached

%description -n %{name}1
libvbucket is a library providing vbucket distribution layer for memcached
clients.

%package devel
Group: Development/Libraries
Summary: vbucket library for memcached - Header files
Requires: %{name}1

%description devel
Development files for the vbucket library for memcached.

%prep
%setup -q -n %{name}-%{version}_%{release}
%configure

%build
%{__make} %{_smp_mflags}

%install
%{__make} install DESTDIR="%{buildroot}" AM_INSTALL_PROGRAM_FLAGS=""

%clean
%{__rm} -rf %{buildroot}

%post -n %{name}1 -p /sbin/ldconfig

%postun -n %{name}1 -p /sbin/ldconfig

%files -n %{name}1
%defattr(-, root, root)
%{_libdir}/libvbucket.so.*

%files devel
%defattr(-, root, root)
%doc README.markdown LICENSE
%{_bindir}/vbucketkeygen
%{_bindir}/vbuckettool
%{_includedir}/libvbucket
%{_libdir}/libvbucket.la
%{_libdir}/libvbucket.so
%{_libdir}/pkgconfig/libvbucket.pc
%{_mandir}/**/*

%changelog
* Mon Dec 05 2011 Sergey Avseyev <sergey.avseyev@gmail.com> - 1.7.2
- Initial packaging
20 changes: 20 additions & 0 deletions packaging/rpm/package.mk
@@ -0,0 +1,20 @@
.PHONY: dist-rpm

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 }')

dist-rpm: dist
rm -rf $(RPM_WORKSPACE)
mkdir -p $(RPM_DIR)
mkdir $(RPM_DIR)/SOURCES
mkdir $(RPM_DIR)/BUILD
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
(cd $(RPM_WORKSPACE); rpmbuild -ba $(PACKAGE).spec)
mv $(RPM_DIR)/RPMS/*/*.rpm `pwd`
mv $(RPM_DIR)/SRPMS/*.rpm `pwd`
rm -rf $(RPM_WORKSPACE)

0 comments on commit 599d7f0

Please sign in to comment.