Riak Source RPM package for RedHat

Aleksey Morarash aleksey.morarash at massivesolutions.eu
Thu Jul 18 08:55:33 EDT 2013


Hi!

I encountered a problem while rebuilding src.rpm published at
http://docs.basho.com/riak/latest/downloads/ for RedHat 6.4:

1. it can't be rebuilt at all without manual intervention (e.g. by
 some package build system);
2. there is no 'Requires' and 'BuildRequires' tags in RPM spec file
 at all - package user forced to resolve all dependencies by hand;
3. RPM spec file refers to 'init.script' file outside of tarball
 contents.

Here is my patch for RPM spec file (*):

--------------------------------CUT-HERE--------------------------------
--- a/riak.spec   2013-07-17 21:13:46.031988988 +0300
+++ b/riak.spec   2013-07-18 15:07:12.727999988 +0300
@@ -1,8 +1,7 @@
-# _revision, _release, and _version should be defined on the rpmbuild command
-# line like so:
-#
-# --define "_version 0.9.1.19.abcdef" --define "_release 7" \
-# --define "_revision 0.9.1-19-abcdef"
+%define _revision 1.4.0
+%define _version %_revision
+%define _release 1
+%define _tarname riak-%_version.tar.gz
 
 Name: riak
 Version: %{_version}
@@ -16,6 +15,8 @@
 BuildRoot: %{_tmppath}/%{name}-%{_revision}-%{release}-root
 Summary: Riak is a distributed data store
 Obsoletes: riak
+Requires: esl-erlang = R15B03
+BuildRequires: make which gcc gcc-c++ esl-erlang = R15B03
 
 %description
 Riak is a distributed data store
@@ -103,6 +104,13 @@
       %{buildroot}%{_localstatedir}/lib/riak
 
 mkdir -p %{buildroot}%{_sysconfdir}/init.d
+cat deps/node_package/priv/templates/rpm/init.script | \
+    sed 's@{{package_name}}@riak@' | \
+    sed 's@{{package_shortdesc}}@Riak is a distributed data store@' | \
+    sed 's@{{package_install_name}}@riak@' | \
+    sed 's@{{bin_or_sbin}}@sbin@' | \
+    sed 's@{{package_install_user}}@riak@' > \
+    %{_topdir}/init.script
 install -m755 %{_topdir}/init.script  %{buildroot}%{_sysconfdir}/init.d/riak
 
 
--------------------------------CUT-HERE--------------------------------

(*) I am using Erlang OTP provided by Erlang Solutions which uses
'esl-erlang' for RPM package name. If this binary is not the case,
do 'sed s/esl-erlang/erlang/' with my patch.

-- 

Best regards, Aleksey Morarash
e-mail: aleksey.morarash at massivesolutions.eu




More information about the riak-users mailing list