File README.updating of Package cassandra-kit
This package provides build dependencies for building Cassandra using
Tetra (ruby2.2-rubygem-tetra). Using Tetra is necessary due
Cassandra's Ant based build process downloading dependencies at build
time. Tetra will keep track of these downloaded dependencies when
running a so-called "dry-run" build on the maintainer's machine and
generate a tarball (cassandra-kit.tar.xz) containing all of them. This
tarball is then used to allow the same build to run in an offline
manner for the cassandra package in OBS (where there is no Internet
connectivity on purpose in order to allow for reproducible builds).
To generate cassandra-kit.tar.xz for a new version of Cassandra,
proceed as follows (you will need to have Tetra installed for this):
0) How to install tetra without root:
gem install tetra --user-install
alias tetra=~/.gem/ruby/2.5.0/bin/tetra.ruby2.5
1) Download an updated Cassandra tarball to the cassandra package's
checkout directory (we'll refer to that directory as $PKG_DIR form
here on out). We'll assume the new version is 3.11.10 throughout the
rest of this file, which is the version the package was at at the
time of this writing. Please substitute 3.11.10 by the actual
version number wherever it occurs.
cd $PKG_DIR
wget http://www.us.apache.org/dist/cassandra/3.11.10/apache-cassandra-3.11.10-src.tar.gz
2) Initialize a tetra build directory for your new tarball and `cd` to
its source directory:
# OBS checkouts may have colons in their directory names which
# messes with some Java build tools, so use a neutral location:
cp apache-cassandra-3.11.10-src.tar.gz /tmp; cd /tmp
tetra init cassandra apache-cassandra-3.11.10-src.tar.gz
cd cassandra/src/apache-cassandra-3.11.10-src
3) Perform a dry-run build with Tetra:
tetra dry-run
# Without this ant won't find the jars shipped with the
# source/downloaded by ant.
mkdir -p .m2
ln -srf ../../kit/m2/ .m2/repository
# Without this ant won't find its own jars in lib/
export ANT_HOME=../../kit/apache-ant-1.9.7/lib:$PWD/lib
ant clean
# ant or maven-ant-tasks has the local Maven repository hardwired
# to ~/.m2/repository with no way to give it an alternative
# location. We need that to make it put jars downloaded by maven
# into ../../kit/m2, though. Since it respects neither $HOME nor
# the user.home Java variable in addition to that we need to do
# this ridiculous dance:
mv ~/.m2 ~/.m2_actual # Only if you care about the contents of this
# directory. If you are a Java developer you
# probably do.
mkdir ~/.m2
ln -sr ../../kit/m2 ~/.m2/repository
ant
cp lib/*.jar ../../kit/jars/
cp build/maven-ant-tasks-*jar ../../kit/jars/
exit
rm ~/.m2/repository
rm -rf ~/.m2
mv ~/.m2_actual ~/.m2
4) Generate the new kit tarball:
tetra generate-all
You will now find an updated kit tarball in
/tmp/cassandra/packages/cassandra-kit/cassandra-kit.tar.xz
Substitute this tarball for the existing one in the kit package and
bump its version.
Note: these instructions applied for Cassandra-3.11.10 and may not be
sufficient for more recent Cassandra versions. If they turn out to
yield a broken kit tarball and you end up fixing it, please update
this file. Thank you!