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
This commit is contained in:
Michael Shuler 2017-06-21 13:57:40 -05:00
parent fdb8c96108
commit 9369db1dfd
4 changed files with 49 additions and 19 deletions

4
debian/changelog vendored
View File

@ -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

View File

@ -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
```

View File

@ -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
;;

View File

@ -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