2015-09-01 21:32:54 +02:00
|
|
|
Name: scylla-jmx
|
2015-09-17 09:16:12 +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/
|
2015-09-17 09:16:12 +02:00
|
|
|
Source0: %{name}-@@VERSION@@-@@RELEASE@@.tar
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
BuildArch: noarch
|
2015-10-26 15:41:16 +01:00
|
|
|
BuildRequires: maven systemd-units java-devel
|
|
|
|
Requires: scylla-server java-headless
|
2015-09-01 21:32:54 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
2016-06-01 10:35:58 +02:00
|
|
|
mvn -B install
|
2016-06-01 09:56:58 +02:00
|
|
|
mkdir build
|
2016-05-24 11:51:12 +02:00
|
|
|
cp dist/common/systemd/scylla-jmx.service.in build/scylla-jmx.service
|
|
|
|
sed -i -e "s#@@SYSCONFDIR@@#/etc/sysconfig#g" build/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}
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/scylla/
|
|
|
|
|
2015-10-24 14:34:51 +02:00
|
|
|
install -m644 dist/common/sysconfig/scylla-jmx $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/
|
2016-05-24 11:51:12 +02:00
|
|
|
install -m644 build/*.service $RPM_BUILD_ROOT%{_unitdir}/
|
2015-09-01 21:32:54 +02:00
|
|
|
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla
|
|
|
|
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
|
2016-05-18 16:04:14 +02:00
|
|
|
install -d -m755 $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/symlinks
|
2015-12-17 08:19:58 +01:00
|
|
|
install -m644 target/scylla-jmx-1.0.jar $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/
|
2015-12-01 15:27:22 +01:00
|
|
|
install -m755 scripts/scylla-jmx $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx
|
2016-05-18 16:04:14 +02:00
|
|
|
ln -sf /usr/bin/java $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx/symlinks/scylla-jmx
|
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
|
2015-12-01 15:27:22 +01:00
|
|
|
%{_prefix}/lib/scylla/jmx/scylla-jmx
|
2015-12-17 08:19:58 +01:00
|
|
|
%{_prefix}/lib/scylla/jmx/scylla-jmx-1.0.jar
|
2016-05-18 16:04:14 +02:00
|
|
|
%{_prefix}/lib/scylla/jmx/symlinks/scylla-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
|