2018-08-22 09:21:04 +02:00
|
|
|
Name: {{product}}-jmx
|
2018-06-06 20:31:13 +02:00
|
|
|
Version: {{version}}
|
|
|
|
Release: {{release}}%{?dist}
|
2015-09-01 21:32:54 +02:00
|
|
|
Summary: Scylla JMX
|
2015-09-07 12:47:38 +02:00
|
|
|
Group: Applications/Databases
|
2015-09-01 21:32:54 +02:00
|
|
|
|
2015-09-22 12:33:24 +02:00
|
|
|
License: AGPLv3
|
2015-09-17 12:07:08 +02:00
|
|
|
URL: http://www.scylladb.com/
|
2018-10-24 04:04:47 +02:00
|
|
|
Source0: scylla-jmx-package.tar.gz
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
BuildArch: noarch
|
2018-10-24 04:04:47 +02:00
|
|
|
BuildRequires: systemd-units
|
2018-10-28 18:57:57 +01:00
|
|
|
BuildRequires: pystache
|
|
|
|
%{?rhel:BuildRequires: python-setuptools}
|
2018-08-22 09:21:04 +02:00
|
|
|
Requires: {{product}}-server java-1.8.0-openjdk-headless
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
2018-10-24 04:04:47 +02:00
|
|
|
%setup -c
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
%build
|
2018-06-06 20:31:13 +02:00
|
|
|
MUSTACHE_DIST="\"redhat\": true"
|
2018-10-24 04:04:47 +02:00
|
|
|
pystache dist/common/systemd/scylla-jmx.service.mustache "{ $MUSTACHE_DIST }" > scylla-jmx.service
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2015-09-16 16:17:37 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
|
2015-09-01 21:32:54 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
2019-06-18 14:24:51 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/opt/scylladb/
|
2015-09-01 21:32:54 +02:00
|
|
|
|
2015-10-24 14:34:51 +02:00
|
|
|
install -m644 dist/common/sysconfig/scylla-jmx $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
|
2018-10-24 04:04:47 +02:00
|
|
|
install -m644 scylla-jmx.service $RPM_BUILD_ROOT%{_unitdir}/
|
2019-06-18 14:24:51 +02:00
|
|
|
install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/
|
|
|
|
install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/jmx
|
|
|
|
install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/jmx/symlinks
|
|
|
|
install -m644 scylla-jmx-1.0.jar $RPM_BUILD_ROOT/opt/scylladb/jmx/
|
|
|
|
install -m755 scylla-jmx $RPM_BUILD_ROOT/opt/scylladb/jmx
|
|
|
|
ln -sf /usr/bin/java $RPM_BUILD_ROOT/opt/scylladb/jmx/symlinks/scylla-jmx
|
|
|
|
install -d -m755 $RPM_BUILD_ROOT/opt/scylladb/scripts
|
|
|
|
# create symlink for /usr/lib/scylla/jmx
|
|
|
|
ln -sf /opt/scylladb/jmx $RPM_BUILD_ROOT/opt/scylladb/scripts/
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
%pre
|
|
|
|
/usr/sbin/groupadd scylla 2> /dev/null || :
|
|
|
|
/usr/sbin/useradd -g scylla -s /sbin/nologin -r -d ${_sharedstatedir}/scylla scylla 2> /dev/null || :
|
2015-09-24 14:34:42 +02:00
|
|
|
ping -c1 `hostname` > /dev/null 2>&1
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo
|
|
|
|
echo "**************************************************************"
|
|
|
|
echo "* WARNING: You need to add hostname on /etc/hosts, otherwise *"
|
|
|
|
echo "* scylla-jmx will not able to start up. *"
|
|
|
|
echo "**************************************************************"
|
|
|
|
echo
|
|
|
|
fi
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
%post
|
|
|
|
%systemd_post scylla-jmx.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%systemd_preun scylla-jmx.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%systemd_postun
|
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
2015-12-01 17:27:47 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/scylla-jmx
|
2015-09-01 21:32:54 +02:00
|
|
|
%{_unitdir}/scylla-jmx.service
|
2019-06-18 14:24:51 +02:00
|
|
|
/opt/scylladb/jmx/scylla-jmx
|
|
|
|
/opt/scylladb/jmx/scylla-jmx-1.0.jar
|
|
|
|
/opt/scylladb/jmx/symlinks/scylla-jmx
|
|
|
|
/opt/scylladb/scripts/jmx
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
%changelog
|
|
|
|
* Fri Aug 7 2015 Takuya ASADA Takuya ASADA <syuu@cloudius-systems.com>
|
|
|
|
- inital version of scylla-tools.spec
|