cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mshu...@apache.org
Subject [02/19] cassandra git commit: Prepare 2.1.18 release
Date Wed, 21 Jun 2017 19:10:40 GMT
Prepare 2.1.18 release

- release debian/changelog
- backport RPM packaging fixes from cassandra-2.2 branch for
  CASSANDRA-13046, CASSANDRA-13434, CASSANDRA-13435, CASSANDRA-13433,
  and CASSANDRA-13493


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9369db1d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9369db1d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9369db1d

Branch: refs/heads/cassandra-3.11
Commit: 9369db1dfd92d4eb76284cfb68b1ffb9d22c9b06
Parents: fdb8c96
Author: Michael Shuler <michael@pbandjelly.org>
Authored: Wed Jun 21 13:57:40 2017 -0500
Committer: Michael Shuler <michael@pbandjelly.org>
Committed: Wed Jun 21 14:04:21 2017 -0500

----------------------------------------------------------------------
 debian/changelog      |  4 ++--
 redhat/README.md      | 19 ++++++++++---------
 redhat/cassandra      | 38 ++++++++++++++++++++++++++++++++------
 redhat/cassandra.spec |  7 +++++--
 4 files changed, 49 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9369db1d/debian/changelog
----------------------------------------------------------------------
diff --git a/debian/changelog b/debian/changelog
index 48ed24b..a0ee850 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-cassandra (2.1.18) UNRELEASED; urgency=medium
+cassandra (2.1.18) unstable; urgency=medium
 
   * New release
 
- -- Michael Shuler <michael@pbandjelly.org>  Tue, 21 Feb 2017 13:59:40 -0600
+ -- Michael Shuler <michael@pbandjelly.org>  Wed, 21 Jun 2017 13:57:08 -0500
 
 cassandra (2.1.17) unstable; urgency=medium
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9369db1d/redhat/README.md
----------------------------------------------------------------------
diff --git a/redhat/README.md b/redhat/README.md
index 0b2ab0d..cab42a7 100644
--- a/redhat/README.md
+++ b/redhat/README.md
@@ -7,25 +7,26 @@
 ### Step 1:
 - Build and copy sources to build tree:
 ```
-ant artifacts
-cp build/apache-cassandra-*-src.tar.gz $RPM_BUILD_DIR/SOURCES/
+ant artifacts -Drelease=true
 ```
 
 ### Step 2:
 - Since there is no version specified in the SPEC file, one needs to be passed at `rpmbuild`
time (example with 4.0):
 ```
-rpmbuild --define="version 4.0" -ba redhat/cassandra.spec
+mkdir -p build/rpmbuild/{BUILD,RPMS,SPECS,SRPMS}
+rpmbuild --define="version 4.0" \
+    --define="revision $(date +"%Y%m%d")git$(git rev-parse --short HEAD)%{?dist}" \
+    --define "_topdir $(pwd)/build/rpmbuild" \
+    --define "_sourcedir $(pwd)/build" \
+    -ba redhat/cassandra.spec
 ```
 
+Use revision value in the example above for git based snapshots. Change to `--define="revision
1"` for non-snapshot releases.
+
 - RPM files can be found in their respective build tree directories:
 ```
-ls -l $RPM_BUILD_DIR/{SRPMS,RPMS}/
+ls -l build/rpmbuild/{SRPMS,RPMS}/
 ```
 
 ### Hint:
 - Don't build packages as root..
-```
-# this makes your RPM_BUILD_DIR = ~/rpmbuild
-mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
-echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
-```

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9369db1d/redhat/cassandra
----------------------------------------------------------------------
diff --git a/redhat/cassandra b/redhat/cassandra
index 3e59534..677ff8c 100644
--- a/redhat/cassandra
+++ b/redhat/cassandra
@@ -3,9 +3,23 @@
 # /etc/init.d/cassandra
 #
 # Startup script for Cassandra
-# 
-# chkconfig: 2345 20 80
+#
+# chkconfig: 2345 80 20
 # description: Starts and stops Cassandra
+# pidfile: /var/run/cassandra/cassandra.pid
+
+### BEGIN INIT INFO
+# Provides:          cassandra
+# Required-Start:    $remote_fs $network $named $time
+# Required-Stop:     $remote_fs $network $named $time
+# Should-Start:      ntp mdadm
+# Should-Stop:       ntp mdadm
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: distributed storage system for structured data
+# Description:       Cassandra is a distributed (peer-to-peer) system for
+#                    the management and storage of structured data.
+### END INIT INFO
 
 . /etc/rc.d/init.d/functions
 
@@ -53,6 +67,8 @@ case "$1" in
     start)
         # Cassandra startup
         echo -n "Starting Cassandra: "
+        [ -d `dirname "$pid_file"` ] || \
+            install -m 755 -o $CASSANDRA_OWNR -g $CASSANDRA_OWNR -d `dirname $pid_file`
         su $CASSANDRA_OWNR -c "$CASSANDRA_PROG -p $pid_file" > $log_file 2>&1
         retval=$?
         [ $retval -eq 0 ] && touch $lock_file
@@ -64,16 +80,26 @@ case "$1" in
         su $CASSANDRA_OWNR -c "kill `cat $pid_file`"
         retval=$?
         [ $retval -eq 0 ] && rm -f $lock_file
-        for t in `seq 40`; do $0 status > /dev/null 2>&1 && sleep 0.5 ||
break; done
+        for t in `seq 40`; do
+            status -p $pid_file cassandra > /dev/null 2>&1
+            retval=$?
+            if [ $retval -eq 3 ]; then
+                echo "OK"
+                exit 0
+            else
+                sleep 0.5
+            fi;
+        done
         # Adding a sleep here to give jmx time to wind down (CASSANDRA-4483). Not ideal...
         # Adam Holmberg suggests this, but that would break if the jmx port is changed
         # for t in `seq 40`; do netstat -tnlp | grep "0.0.0.0:7199" > /dev/null 2>&1
&& sleep 0.1 || break; done
         sleep 5
-        STATUS=`$0 status`
-        if [[ $STATUS == "$NAME is stopped" ]]; then
+        status -p $pid_file cassandra > /dev/null 2>&1
+        retval=$?
+        if [ $retval -eq 3 ]; then
             echo "OK"
         else
-            echo "ERROR: could not stop $NAME:  $STATUS"
+            echo "ERROR: could not stop $NAME"
             exit 1
         fi
         ;;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9369db1d/redhat/cassandra.spec
----------------------------------------------------------------------
diff --git a/redhat/cassandra.spec b/redhat/cassandra.spec
index e43238e..d87f760 100644
--- a/redhat/cassandra.spec
+++ b/redhat/cassandra.spec
@@ -2,10 +2,13 @@
 # Turn off the brp-python-bytecompile script
 %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
 
+# rpmbuild should not barf when it spots we ship
+# binary executable files in our 'noarch' package
+%define _binaries_in_noarch_packages_terminate_build   0
+
 %global username cassandra
 
 %define relname apache-cassandra-%{version}
-%define revision 1
 
 Name:          cassandra
 Version:       %{version}
@@ -18,7 +21,7 @@ URL:           http://cassandra.apache.org/
 Source0:       %{relname}-src.tar.gz
 BuildRoot:     %{_tmppath}/%{relname}root-%(%{__id_u} -n)
 
-BuildRequires: ant
+BuildRequires: ant >= 1.9
 
 Requires:      jre >= 1.7.0
 Requires:      python(abi) >= 2.7


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message