Accepting request 202049 from home:posophe:branches:devel:languages:python
Remove sysvinit support OBS-URL: https://build.opensuse.org/request/show/202049 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=44
This commit is contained in:
parent
786c95fae1
commit
c2cf875cf9
133
rrdcached.init
133
rrdcached.init
@ -1,133 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# /etc/init.d/rrdcached
|
||||
# and its symbolic link
|
||||
# /(usr/)sbin/rcrrdcached
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rrdcached
|
||||
# Required-Start: $local_fs $syslog $remote_fs
|
||||
# Should-Start: $time
|
||||
# Required-Stop: $local_fs $syslog $remote_fs
|
||||
# Should-Stop: $null
|
||||
# Default-Start: 3 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: Start and stop rrdtool caching daemon
|
||||
# Description: rrdcached is a caching daemon to aggregate
|
||||
# updates to rrd files
|
||||
### END INIT INFO
|
||||
|
||||
RRDCACHED_BIN='/usr/bin/rrdcached'
|
||||
test -x $RRDCACHED_BIN || { echo "$RRDCACHED_BIN not installed";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 5; fi; }
|
||||
|
||||
# Check for existence of needed config file and read it
|
||||
RRDCACHED_CONFIG='/etc/sysconfig/rrdcached'
|
||||
test -r $RRDCACHED_CONFIG || { echo "$RRDCACHED_CONFIG not existing";
|
||||
if [ "$1" = "stop" ]; then exit 0;
|
||||
else exit 6; fi; }
|
||||
|
||||
RRDCACHED_PID='/var/lib/rrdtool/rrdcached/rrdcached.pid'
|
||||
|
||||
# Read config
|
||||
. $RRDCACHED_CONFIG
|
||||
|
||||
# Source LSB init functions
|
||||
. /etc/rc.status
|
||||
|
||||
# Reset status of this service
|
||||
rc_reset
|
||||
|
||||
function check_and_create_dir(){
|
||||
local DIR=$1
|
||||
test -d "$DIR" || mkdir -p "$DIR"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting rrdcached "
|
||||
check_and_create_dir "$(dirname $RRDCACHED_PID)"
|
||||
chown $RRDCACHED_USER:$RRDCACHED_GROUP "$(dirname $RRDCACHED_PID)"
|
||||
case "$RRDCACHED_ADDRESS" in
|
||||
^unix:)
|
||||
SOCKETDIR=$(dirname ${RRDCACHED_ADDRESS/unix:/})
|
||||
check_and_create_dir "$SOCKETDIR"
|
||||
chgrp $RRDCACHED_GROUP "$SOCKETDIR"
|
||||
;;
|
||||
esac
|
||||
case "$RRDCACHED_CHROOT_DIR" in
|
||||
/tmp)
|
||||
echo "Warning: starting with chroot dir $RRDCACHED_CHROOT_DIR" >&2
|
||||
;;
|
||||
*)
|
||||
check_and_create_dir "$RRDCACHED_CHROOT_DIR"
|
||||
chown $RRDCACHED_USER:$RRDCACHED_GROUP "$RRDCACHED_CHROOT_DIR"
|
||||
;;
|
||||
esac
|
||||
/sbin/startproc -u $RRDCACHED_USER $RRDCACHED_BIN \
|
||||
-s $RRDCACHED_GROUP \
|
||||
-b "$RRDCACHED_CHROOT_DIR" \
|
||||
-p "$RRDCACHED_PID" \
|
||||
-l $RRDCACHED_ADDRESS \
|
||||
-m $RRDCACHED_SOCKET_MASK \
|
||||
-w $RRDCACHED_DISKWRITE \
|
||||
-z $RRDCACHED_DELAY \
|
||||
-t $RRDCACHED_WRITE_THREADS \
|
||||
$RRDCACHED_OPTIONS
|
||||
# workaround for wrong socket ownership and permission after stArt
|
||||
case "$RRDCACHED_ADDRESS" in
|
||||
^unix:)
|
||||
SOCKET=${RRDCACHED_ADDRESS/unix:/}
|
||||
chown $RRDCACHED_USER:$RRDCACHED_GROUP "$SOCKET"
|
||||
chmod $RRDCACHED_SOCKET_MASK "$SOCKET"
|
||||
;;
|
||||
esac
|
||||
rc_status -v
|
||||
;;
|
||||
stop)
|
||||
echo -n "Shutting down rrdcached "
|
||||
/sbin/killproc -p $RRDCACHED_PID -t 10 $RRDCACHED_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
try-restart|condrestart)
|
||||
if test "$1" = "condrestart"; then
|
||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
||||
fi
|
||||
$0 status
|
||||
if test $? = 0; then
|
||||
$0 restart
|
||||
else
|
||||
rc_reset # Not running is not a failure.
|
||||
fi
|
||||
rc_status
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
rc_status
|
||||
;;
|
||||
force-reload)
|
||||
echo -n "Reload service rrdcached "
|
||||
/sbin/killproc -p $RRDCACHED_PID -HUP $RRDCACHED_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
reload)
|
||||
echo -n "Reload service rrdcached "
|
||||
/sbin/killproc -p $RRDCACHED_PID -HUP $RRDCACHED_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for service rrdcached "
|
||||
/sbin/checkproc $RRDCACHED_BIN
|
||||
rc_status -v
|
||||
;;
|
||||
probe)
|
||||
test $RRDCACHED_CONFIG -nt $RRDCACHED_PID && echo reload
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
rc_exit
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 3 14:41:37 UTC 2013 - p.drouand@gmail.com
|
||||
|
||||
- Build is disable for SLE; remove sysvinit support
|
||||
- CLean obsolete conditionnal macros
|
||||
- Fix devel package Group; it have to be Development/Libraries
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 2 13:40:14 UTC 2013 - obs@botter.cc
|
||||
|
||||
|
207
rrdtool.spec
207
rrdtool.spec
@ -28,24 +28,14 @@ BuildRequires: libxml2-devel
|
||||
BuildRequires: pango-devel
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: tcl-devel
|
||||
%if 0%{?suse_version} >= 1100
|
||||
BuildRequires: gettext-tools
|
||||
%else
|
||||
BuildRequires: gettext
|
||||
%endif
|
||||
BuildRequires: ruby-devel
|
||||
%if 0%{?suse_version} > 1210
|
||||
BuildRequires: lua51-devel
|
||||
%else
|
||||
BuildRequires: lua-devel
|
||||
%endif
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
BuildRequires: tcpd-devel
|
||||
%if 0%{?suse_version} >= 1210
|
||||
BuildRequires: systemd
|
||||
%endif
|
||||
Requires: perl = %{perl_version}
|
||||
Version: 1.4.7
|
||||
Release: 0
|
||||
@ -57,11 +47,9 @@ Patch3: rrdtool-tclsegfault.patch
|
||||
Source1: http://www.infodrom.org/projects/cgilib/download/cgilib-%{cgilib_version}.tar.gz
|
||||
Patch11: cgilib-fix_automake.patch
|
||||
Source2: sysconfig.rrdcached
|
||||
Source3: rrdcached.init
|
||||
Source4: rrdcached-systemd-pre
|
||||
Source5: rrdcached.service
|
||||
Url: http://oss.oetiker.ch/rrdtool/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Summary: A tool for data logging and analysis
|
||||
License: GPL-2.0+
|
||||
Group: Productivity/Scientific/Math
|
||||
@ -74,6 +62,87 @@ The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
%package devel
|
||||
Summary: A tool for data logging and analysis - Development files
|
||||
Group: Development/Libraries/Other
|
||||
Requires: %name = %version
|
||||
|
||||
%description devel
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
%package -n python-rrdtool
|
||||
Summary: Python bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %name = %version
|
||||
%py_requires
|
||||
|
||||
%description -n python-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Python bindings
|
||||
|
||||
|
||||
%package -n lua-rrdtool
|
||||
Summary: Lua bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %name = %version
|
||||
|
||||
%description -n lua-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Lua bindings
|
||||
|
||||
%package -n ruby-rrdtool
|
||||
Summary: Ruby bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: ruby
|
||||
|
||||
%description -n ruby-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Ruby bindings
|
||||
|
||||
%package -n tcl-rrdtool
|
||||
Summary: Tcl bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: tcl
|
||||
|
||||
%description -n tcl-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Tcl bindings
|
||||
|
||||
%package cached
|
||||
Summary: Data caching daemon for RRDtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %{name} = %{version}
|
||||
Requires(pre): %fillup_prereq
|
||||
%{?systemd_requires}
|
||||
%define rrdcached_user rrdcached
|
||||
%define rrdcached_group rrdcached
|
||||
|
||||
%description cached
|
||||
rrdcached is a daemon that receives updates to existing RRD files,
|
||||
accumulates them and, if enough have been received or a defined time has
|
||||
passed, writes the updates to the RRD file. The daemon was written with
|
||||
big setups in mind which usually runs into I/O related problems. This
|
||||
daemon was written to alleviate these problems.
|
||||
|
||||
%prep
|
||||
%setup -q -a1
|
||||
%if %{_lib}==lib64
|
||||
@ -92,9 +161,7 @@ echo -n > NEWS
|
||||
aclocal --force
|
||||
autoreconf -fiv
|
||||
CGILIB_CFLAGS="%{optflags} -fPIC -I."
|
||||
%if 0%{?suse_version} >= 1130
|
||||
CGILIB_CFLAGS="$CGILIB_CFLAGS -fexcess-precision=fast"
|
||||
%endif
|
||||
CFLAGS="$CGILIB_CFLAGS" \
|
||||
%configure
|
||||
make %{?jobs:-j %jobs}
|
||||
@ -169,18 +236,11 @@ chmod -x examples/*
|
||||
chmod +x examples/rrdcached
|
||||
# install rrdcached specials
|
||||
install -Dm644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached
|
||||
install -Dm755 %{SOURCE3} %{buildroot}%{_sysconfdir}/init.d/rrdcached
|
||||
%if 0%{?suse_version} >= 1210
|
||||
# install systemd specific files
|
||||
install -Dm755 %{SOURCE4} %{buildroot}%{_datadir}/rrdcached/rrdcached-systemd-pre
|
||||
install -Dm644 %{SOURCE5} %{buildroot}%{_unitdir}/rrdcached.service
|
||||
%endif
|
||||
mkdir -p %{buildroot}%{_sbindir}
|
||||
ln -s %{_sysconfdir}/init.d/rrdcached %{buildroot}%{_sbindir}/rcrrdcached
|
||||
mkdir -p %{buildroot}%{_localstatedir}/lib/rrdtool/rrdcached
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
@ -190,7 +250,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-, root, root)
|
||||
%doc %{_docdir}/rrdtool
|
||||
%doc %{_mandir}/*/*
|
||||
/usr/bin/*
|
||||
%{_bindir}/*
|
||||
%exclude %{_bindir}/rrdcached
|
||||
%{_libdir}/librrd.so.*
|
||||
%{_libdir}/librrd_th.so.*
|
||||
@ -198,61 +258,19 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{perl_vendorarch}/RRDs.pm
|
||||
#%{perl_vendorarch}/ntmake.pl
|
||||
%{perl_vendorarch}/auto/*
|
||||
%if %suse_version < 1140
|
||||
/var/adm/perl-modules/rrdtool
|
||||
%endif
|
||||
#%{_datadir}/%{name}
|
||||
|
||||
%package devel
|
||||
Summary: A tool for data logging and analysis - Development files
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %name = %version
|
||||
|
||||
%description devel
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
/usr/include/*
|
||||
%{_includedir}/*
|
||||
%{_libdir}/librrd_th.so
|
||||
%{_libdir}/librrd.so
|
||||
%{_libdir}/pkgconfig/librrd.pc
|
||||
|
||||
%package -n python-rrdtool
|
||||
Summary: Python bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %name = %version
|
||||
%py_requires
|
||||
|
||||
%description -n python-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Python bindings
|
||||
|
||||
%files -n python-rrdtool
|
||||
%defattr(-, root, root)
|
||||
%{py_sitedir}/*
|
||||
|
||||
%package -n lua-rrdtool
|
||||
Summary: Lua bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %name = %version
|
||||
|
||||
%description -n lua-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Lua bindings
|
||||
|
||||
%files -n lua-rrdtool
|
||||
%defattr(-, root, root)
|
||||
%dir %{_libdir}/lua
|
||||
@ -260,97 +278,40 @@ This package contains the Lua bindings
|
||||
%{_libdir}/lua/*/rrd.so
|
||||
%{_libdir}/lua/*/rrd.so.*
|
||||
|
||||
%package -n tcl-rrdtool
|
||||
Summary: Tcl bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: tcl
|
||||
|
||||
%description -n tcl-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Tcl bindings
|
||||
|
||||
%files -n tcl-rrdtool
|
||||
%defattr(-, root, root)
|
||||
%{tcl_archdir}/*
|
||||
%{_libdir}/tclrrd*.so
|
||||
|
||||
#%{!?rb_sitearchdir: %define rb_sitearchdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]')}
|
||||
%package -n ruby-rrdtool
|
||||
Summary: Ruby bindings for rrdtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: ruby
|
||||
|
||||
%description -n ruby-rrdtool
|
||||
A tool to log and analyze data gathered from all kinds of data sources.
|
||||
The data analysis part of RRDtool is based on the ability to quickly
|
||||
generate graphical representations of the data values collected over a
|
||||
definable time period.
|
||||
|
||||
This package contains the Ruby bindings
|
||||
|
||||
%files -n ruby-rrdtool
|
||||
%defattr(-, root, root)
|
||||
%{rb_sitearchdir}/RRD.so
|
||||
|
||||
%package cached
|
||||
Summary: Data caching daemon for RRDtool
|
||||
Group: Productivity/Scientific/Math
|
||||
Requires: %{name} = %{version}
|
||||
Requires(pre): %insserv_prereq
|
||||
Requires(pre): %fillup_prereq
|
||||
%define rrdcached_user rrdcached
|
||||
%define rrdcached_group rrdcached
|
||||
|
||||
%description cached
|
||||
rrdcached is a daemon that receives updates to existing RRD files,
|
||||
accumulates them and, if enough have been received or a defined time has
|
||||
passed, writes the updates to the RRD file. The daemon was written with
|
||||
big setups in mind which usually runs into I/O related problems. This
|
||||
daemon was written to alleviate these problems.
|
||||
|
||||
%files cached
|
||||
%defattr(-, root, root)
|
||||
%{_bindir}/rrdcached
|
||||
%{_sysconfdir}/init.d/rrdcached
|
||||
%{_sbindir}/rcrrdcached
|
||||
%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached
|
||||
%dir %{_localstatedir}/lib/rrdtool
|
||||
%attr(-,%rrdcached_user,%rrdcached_group) %dir %{_localstatedir}/lib/rrdtool/rrdcached
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%{_datadir}/rrdcached
|
||||
%{_datadir}/rrdcached/rrdcached-systemd-pre
|
||||
%{_unitdir}/rrdcached.service
|
||||
%endif
|
||||
|
||||
%pre cached
|
||||
getent group %rrdcached_group >/dev/null || groupadd %rrdcached_group
|
||||
getent passwd %rrdcached_user >/dev/null || useradd -s /sbin/nologin -g %rrdcached_group -c %rrdcached_user -d %{_localstatedir}/lib %rrdcached_user
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%service_add_pre rrdcached.service
|
||||
%endif
|
||||
|
||||
%post cached
|
||||
%fillup_and_insserv rrdcached
|
||||
%restart_on_update rrdcached
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%service_add_post rrdcached.service
|
||||
%endif
|
||||
%fillup_only rrdcached
|
||||
|
||||
%preun cached
|
||||
%stop_on_removal rrdcached
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%service_del_preun rrdcached.service
|
||||
%endif
|
||||
|
||||
%postun cached
|
||||
%restart_on_update
|
||||
%insserv_cleanup
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%service_del_postun rrdcached.service
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user