Skip to content

Commit

Permalink
dist: drop Java tools and change packaging just for cassandra-stress
Browse files Browse the repository at this point in the history
Since Java based tools are deprecated and now we only need
cassandra-stress, change package name to "scylla-cassandra-stress" and
drop deprecated tools from the package.

Closes scylladb#370
  • Loading branch information
syuu1228 committed May 22, 2024
1 parent 8880960 commit ee4654d
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 65 deletions.
2 changes: 1 addition & 1 deletion dist/debian/changelog.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%{product}-tools (%{version}-%{release}-%{revision}) %{codename}; urgency=medium
%{product}-cassandra-stress (%{version}-%{release}-%{revision}) %{codename}; urgency=medium

* New release

Expand Down
36 changes: 28 additions & 8 deletions dist/debian/control.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: %{product}-tools
Source: %{product}-cassandra-stress
Section: misc
Priority: extra
Maintainer: Takuya ASADA <[email protected]>
Expand All @@ -7,17 +7,37 @@ Standards-Version: 3.9.5
Rules-Requires-Root: no

Package: %{product}-tools
Depends: %{product}-cassandra-stress, ${misc:Depends}
Architecture: all
Depends: %{product}-conf, %{product}-tools-core, ${misc:Depends}
Priority: optional
Section: oldlibs
Description: transitional package
This is a transitional package. It can safely be removed.

Package: %{product}-tools-core
Depends: %{product}-cassandra-stress-core, ${misc:Depends}
Architecture: all
Priority: optional
Section: oldlibs
Description: transitional package
This is a transitional package. It can safely be removed.

Package: %{product}-cassandra-stress
Architecture: all
Priority: optional
Depends: %{product}-conf, %{product}-cassandra-stress-core, ${misc:Depends}
Recommends: ntp | time-daemon
Conflicts: cassandra
Breaks: %{product}-server (<< 5.5)
Description: Scylla database tools
Replaces: %{product}-tools (<< 5.5)
Breaks: %{product}-tools (<< 5.5)
Description: Scylla Cassandra Stress
Scylla is a highly scalable, eventually consistent, distributed,
partitioned row DB.

Package: %{product}-tools-core
Package: %{product}-cassandra-stress-core
Architecture: all
Priority: optional
Depends: openjdk-8-jre-headless | openjdk-8-jre | oracle-java8-set-default | adoptopenjdk-8-hotspot-jre | openjdk-11-jre-headless | openjdk-11-jre | oracle-java11-set-default, procps
Description: Scylla database tools core files
Core files for scylla database tools
Replaces: %{product}-tools-core (<< 5.5)
Breaks: %{product}-tools-core (<< 5.5)
Description: Scylla Cassadra Stress core files
Core files for Scylla Cassadra Stress
2 changes: 1 addition & 1 deletion dist/debian/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ override_dh_auto_clean:

override_dh_auto_install:
dh_auto_install
cd scylla-tools; ./install.sh --root "$(CURDIR)/debian/tmp"
cd scylla-cassandra-stress; ./install.sh --root "$(CURDIR)/debian/tmp"

override_dh_makeshlibs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ etc/scylla/cassandra/cassandra-env.sh
etc/scylla/cassandra/logback.xml
etc/scylla/cassandra/logback-tools.xml
etc/scylla/cassandra/jvm*.options
usr/bin/scylla-sstableloader
opt/scylladb/share/cassandra/bin/cassandra.in.sh
opt/scylladb/share/cassandra/lib/*.jar
opt/scylladb/share/cassandra/doc/cql3/CQL.css
opt/scylladb/share/cassandra/doc/cql3/CQL.html
opt/scylladb/share/cassandra/bin/scylla-sstableloader
4 changes: 4 additions & 0 deletions dist/debian/debian/scylla-cassandra-stress.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
opt/scylladb/share/cassandra/bin/cassandra-stress
opt/scylladb/share/cassandra/bin/cassandra-stressd
usr/bin/cassandra-stress
usr/bin/cassandra-stressd
15 changes: 0 additions & 15 deletions dist/debian/debian/scylla-tools.install

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
Name: %{product}-tools
Name: %{product}-cassandra-stress
Version: %{version}
Release: %{release}%{?dist}
Summary: Scylla Tools
Summary: Scylla Cassandra Stress
Group: Applications/Databases

License: Apache
URL: http://www.scylladb.com/
Source0: %{reloc_pkg}
BuildArch: noarch
Requires: %{product}-conf %{product}-tools-core
Requires: %{product}-conf %{product}-cassandra-stress-core
AutoReqProv: no
Conflicts: cassandra
Obsoletes: %{product}-tools < 5.5

%description

%package core
License: Apache
URL: http://www.scylladb.com/
BuildArch: noarch
Summary: Core files for Scylla tools
Summary: Core files for Scylla Cassandra Stress
Version: %{version}
Release: %{release}%{?dist}
Requires: jre-11-headless
Obsoletes: %{product}-tools-core < 5.5

%global __brp_python_bytecompile %{nil}
%global __brp_mangle_shebangs %{nil}

%description core
Core files for scylla tools.
Core files for scylla casssandra stress.

%prep
%setup -q -n scylla-tools
%setup -q -n scylla-cassandra-stress


%build
Expand All @@ -40,33 +42,20 @@ rm -rf $RPM_BUILD_ROOT
./install.sh --root "$RPM_BUILD_ROOT"

%files
/opt/scylladb/share/cassandra/bin/nodetool
/opt/scylladb/share/cassandra/bin/sstableloader
/opt/scylladb/share/cassandra/bin/cassandra-stress
/opt/scylladb/share/cassandra/bin/cassandra-stressd
/opt/scylladb/share/cassandra/bin/sstabledump
/opt/scylladb/share/cassandra/bin/sstablelevelreset
/opt/scylladb/share/cassandra/bin/sstablemetadata
/opt/scylladb/share/cassandra/bin/sstablerepairedset
%{_bindir}/sstableloader
%{_bindir}/cassandra-stress
%{_bindir}/cassandra-stressd
%{_bindir}/sstabledump
%{_bindir}/sstablelevelreset
%{_bindir}/sstablemetadata
%{_bindir}/sstablerepairedset

%files core
%{_sysconfdir}/scylla/cassandra/cassandra-env.sh
%{_sysconfdir}/scylla/cassandra/logback.xml
%{_sysconfdir}/scylla/cassandra/logback-tools.xml
%{_sysconfdir}/scylla/cassandra/jvm*.options
%{_bindir}/scylla-sstableloader
/opt/scylladb/share/cassandra/bin/cassandra.in.sh
/opt/scylladb/share/cassandra/lib/*.jar
/opt/scylladb/share/cassandra/doc/cql3/CQL.css
/opt/scylladb/share/cassandra/doc/cql3/CQL.html
/opt/scylladb/share/cassandra/bin/scylla-sstableloader

%changelog
* Fri Aug 7 2015 Takuya ASADA Takuya ASADA <[email protected]>
Expand Down
11 changes: 3 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ b=\"\$(basename \"\$0\")\"
bindir=\"$prefix/share/cassandra/bin\"
exec -a \"\$0\" \"\$bindir/\$b\" \"\$@\""

# scylla-tools-core
# scylla-cassandra-stress-core
install -d -m755 "$retc"/scylla/cassandra
install -d -m755 "$rprefix"/share/cassandra/lib
install -d -m755 "$rprefix"/share/cassandra/doc
Expand Down Expand Up @@ -131,12 +131,7 @@ install_tool_bin () {
fi
}

# scylla-tools
for i in bin/{sstableloader,scylla-sstableloader} tools/bin/{cassandra-stress,cassandra-stressd,sstabledump,sstablelevelreset,sstablemetadata,sstablerepairedset}; do
# scylla-cassandra-stress
for i in tools/bin/{cassandra-stress,cassandra-stressd}; do
install_tool_bin "$i"
done

# Don't create the thunk in $rusr/bin for nodetool, this command is now only
# available as a backup in $rprefix/share/cassandra/bin/nodetool, in case the
# native nodetool doesn't work.
install -m755 bin/nodetool "$rprefix"/share/cassandra/bin/nodetool
6 changes: 3 additions & 3 deletions reloc/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

. /etc/os-release
print_usage() {
echo "build_deb.sh --reloc-pkg build/scylla-tools-package.tar.gz"
echo "build_deb.sh --reloc-pkg build/scylla-cassandra-stress-package.tar.gz"
echo " --reloc-pkg specify relocatable package path"
echo " --builddir specify Debian package build path"
exit 1
}

RELOC_PKG=build/scylla-tools-package.tar.gz
RELOC_PKG=build/scylla-cassandra-stress-package.tar.gz
BUILDDIR=build/debian
while [ $# -gt 0 ]; do
case "$1" in
Expand All @@ -32,7 +32,7 @@ mkdir -p "$BUILDDIR"/scylla-package
tar -C "$BUILDDIR"/scylla-package -xpf $RELOC_PKG
cd "$BUILDDIR"/scylla-package

mv scylla-tools/debian debian
mv scylla-cassandra-stress/debian debian
PKG_NAME=$(dpkg-parsechangelog --show-field Source)
# XXX: Drop revision number from version string.
# Since it always '1', this should be okay for now.
Expand Down
2 changes: 1 addition & 1 deletion reloc/build_reloc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ VERSION=$(./SCYLLA-VERSION-GEN ${VERSION_OVERRIDE:+ --version "$VERSION_OVERRIDE
# the former command should generate build/SCYLLA-PRODUCT-FILE and some other version
# related files
PRODUCT=`cat build/SCYLLA-PRODUCT-FILE`
DEST="build/$PRODUCT-tools-$VERSION.noarch.tar.gz"
DEST="build/$PRODUCT-cassandra-stress-$VERSION.noarch.tar.gz"

is_redhat_variant() {
[ -f /etc/redhat-release ]
Expand Down
12 changes: 6 additions & 6 deletions reloc/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

. /etc/os-release
print_usage() {
echo "build_rpm.sh --reloc-pkg build/scylla-tools-package.tar.gz"
echo "build_rpm.sh --reloc-pkg build/scylla-cassandra-stress-package.tar.gz"
echo " --reloc-pkg specify relocatable package path"
echo " --builddir specify rpmbuild directory"
exit 1
}
RELOC_PKG=build/scylla-tools-package.tar.gz
RELOC_PKG=build/scylla-cassadra-stress-package.tar.gz
BUILDDIR=build/redhat
while [ $# -gt 0 ]; do
case "$1" in
Expand All @@ -28,8 +28,8 @@ done
RELOC_PKG=$(readlink -f $RELOC_PKG)
RPMBUILD=$(readlink -f $BUILDDIR)
mkdir -p "$BUILDDIR"
tar -C "$BUILDDIR" -xpf $RELOC_PKG scylla-tools/SCYLLA-RELEASE-FILE scylla-tools/SCYLLA-RELOCATABLE-FILE scylla-tools/SCYLLA-VERSION-FILE scylla-tools/SCYLLA-PRODUCT-FILE scylla-tools/dist/redhat
cd "$BUILDDIR"/scylla-tools
tar -C "$BUILDDIR" -xpf $RELOC_PKG scylla-cassandra-stress/SCYLLA-RELEASE-FILE scylla-cassandra-stress/SCYLLA-RELOCATABLE-FILE scylla-cassandra-stress/SCYLLA-VERSION-FILE scylla-cassandra-stress/SCYLLA-PRODUCT-FILE scylla-cassandra-stress/dist/redhat
cd "$BUILDDIR"/scylla-cassandra-stress

RELOC_PKG_BASENAME=$(basename "$RELOC_PKG")
SCYLLA_VERSION=$(cat SCYLLA-VERSION-FILE)
Expand All @@ -48,6 +48,6 @@ parameters=(
-D"reloc_pkg $RELOC_PKG_BASENAME"
)

cp dist/redhat/scylla-tools.spec $RPMBUILD/SPECS
cp dist/redhat/scylla-cassandra-stress.spec $RPMBUILD/SPECS
# this rpm can be install on both fedora / centos7, so drop distribution name from the file name
rpmbuild -ba "${parameters[@]}" --define '_binary_payload w2.xzdio' --define "_topdir $RPMBUILD" --undefine "dist" $RPMBUILD/SPECS/scylla-tools.spec
rpmbuild -ba "${parameters[@]}" --define '_binary_payload w2.xzdio' --define "_topdir $RPMBUILD" --undefine "dist" $RPMBUILD/SPECS/scylla-cassandra-stress.spec
2 changes: 1 addition & 1 deletion scripts/create-relocatable-package.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import tarfile
import pathlib

RELOC_PREFIX='scylla-tools'
RELOC_PREFIX='scylla-cassandra-stress'
def reloc_add(self, name, arcname=None, recursive=True, *, filter=None):
if arcname:
return self.add(name, arcname="{}/{}".format(RELOC_PREFIX, arcname))
Expand Down

0 comments on commit ee4654d

Please sign in to comment.