Skip to content
Browse files

RPM packaging spec. Patch by Daniel Lundin, Ted Zlatnov, Stu Hood, Pe…

…ter Halliday, and Nick Bailey, reviewed by brandonwilliams for CASSANDRA-786.

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent df57aee commit cbc1f651408d8d1004e3df8419cd1c66646efab3 @driftx driftx committed Sep 22, 2010
Showing with 112 additions and 0 deletions.
  1. +1 −0 CHANGES.txt
  2. +111 −0 redhat/apache-cassandra.spec
@@ -85,6 +85,7 @@
exception rather than the ExecutionException wrapper (CASSANDRA-1226)
* remove Clock from the Thrift (and Avro) API (CASSANDRA-1501)
* Close intra-node sockets when connection is broken (CASSANDRA-1528)
+ * RPM packaging spec file (CASSANDRA-786)
111 redhat/apache-cassandra.spec
@@ -0,0 +1,111 @@
+%define __jar_repack %{nil}
+%global username cassandra
+Name: apache-cassandra
+Version: 0.7.0
+Release: 1%{?dist}
+Summary: Cassandra is a highly scalable, eventually consistent, distributed, structured key-value store.
+Group: Development/Libraries
+License: BSD
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: java-devel
+BuildRequires: jpackage-utils
+BuildRequires: ant
+BuildRequires: ant-nodeps
+Requires: java >= 1.6.0
+Requires: jpackage-utils
+Requires(pre): user(cassandra)
+Requires(pre): group(cassandra)
+Requires(pre): shadow-utils
+Provides: user(cassandra)
+Provides: group(cassandra)
+BuildArch: noarch
+Cassandra brings together the distributed systems technologies from Dynamo
+and the data model from Google's BigTable. Like Dynamo, Cassandra is
+eventually consistent. Like BigTable, Cassandra provides a ColumnFamily-based
+data model richer than typical key/value systems.
+For more information see
+%setup -q -n %{name}-%{version}-src
+ant clean jar -Drelease=true
+%{__rm} -rf %{buildroot}
+mkdir -p %{buildroot}%{_sysconfdir}/%{username}/
+mkdir -p %{buildroot}/usr/share/%{username}
+mkdir -p %{buildroot}/usr/share/%{username}/lib
+mkdir -p %{buildroot}/usr/share/%{username}/default.conf
+mkdir -p %{buildroot}/etc/%{username}/default.conf
+mkdir -p %{buildroot}/etc/rc.d/init.d/
+mkdir -p %{buildroot}/usr/sbin
+mkdir -p %{buildroot}/usr/bin
+cp -p conf/* %{buildroot}/etc/%{username}/default.conf
+cp -p conf/* %{buildroot}/usr/share/%{username}/default.conf
+cp -p contrib/redhat/%{username} %{buildroot}/etc/rc.d/init.d/
+cp -p lib/*.jar %{buildroot}/usr/share/%{username}/lib
+mv bin/ %{buildroot}/usr/share/%{username}
+mv bin/cassandra %{buildroot}/usr/sbin
+rm bin/*.bat
+cp -p bin/* %{buildroot}/usr/bin
+cp build/%{name}-%{version}.jar %{buildroot}/usr/share/%{username}/lib
+mkdir -p %{buildroot}/var/lib/%{username}/commitlog
+mkdir -p %{buildroot}/var/lib/%{username}/data
+mkdir -p %{buildroot}/var/run/%{username}
+mkdir -p %{buildroot}/var/log/%{username}
+%{__rm} -rf %{buildroot}
+getent group %{username} >/dev/null || groupadd -r %{username}
+getent passwd %{username} >/dev/null || \
+useradd -d /usr/share/%{username} -g %{username} -M -r %{username}
+exit 0
+# only delete user on removal, not upgrade
+if [ "$1" = "0" ]; then
+ userdel %{username}
+%doc CHANGES.txt LICENSE.txt README.txt NEWS.txt NOTICE.txt
+%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_sbindir}/cassandra
+%attr(755,root,root) /etc/rc.d/init.d/%{username}
+%attr(755,%{username},%{username}) /usr/share/%{username}*
+%attr(755,%{username},%{username}) %config(noreplace) /%{_sysconfdir}/%{username}
+%attr(755,%{username},%{username}) %config(noreplace) /var/lib/%{username}/*
+%attr(755,%{username},%{username}) /var/log/%{username}*
+%attr(755,%{username},%{username}) /var/run/%{username}*
+alternatives --install /etc/%{username}/conf %{username} /etc/%{username}/default.conf/ 0
+exit 0
+# only delete alternative on removal, not upgrade
+if [ "$1" = "0" ]; then
+ alternatives --remove %{username} /etc/%{username}/default.conf/
+exit 0
+* Tue Aug 03 2010 Nick Bailey <> - 0.7.0-1
+- Updated to make configuration easier and changed package name.
+* Mon Jul 05 2010 Peter Halliday <> - 0.6.3-1
+- Initial package

0 comments on commit cbc1f65

Please sign in to comment.
Something went wrong with that request. Please try again.