From 58ee84e770cff0911d65d624fca05c311f9bd433bf87d3f1bb1393660d825b38 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Sun, 1 Jan 2017 17:27:50 +0000 Subject: [PATCH] Accepting request 444179 from home:jengelh:branches:devel:languages:python - Implement shared library packaging guideline - Reduce %serivce_* calls, speed up find by using {}+ instead, rectify RPM groups, trim descriptions. - Abort package installation when user/group cannot be created. OBS-URL: https://build.opensuse.org/request/show/444179 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=73 --- rrdtool.changes | 8 ++++++++ rrdtool.spec | 54 ++++++++++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/rrdtool.changes b/rrdtool.changes index 6ff33ba..809c6ae 100644 --- a/rrdtool.changes +++ b/rrdtool.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Dec 6 12:59:16 UTC 2016 - jengelh@inai.de + +- Implement shared library packaging guideline +- Reduce %serivce_* calls, speed up find by using {}+ instead, + rectify RPM groups, trim descriptions. +- Abort package installation when user/group cannot be created. + ------------------------------------------------------------------- Thu Dec 1 16:44:25 UTC 2016 - luizluca@tre-sc.jus.br diff --git a/rrdtool.spec b/rrdtool.spec index a899e2d..9de3b1a 100644 --- a/rrdtool.spec +++ b/rrdtool.spec @@ -71,28 +71,37 @@ BuildRequires: librados2-devel Requires: dejavu %description -RRD is the Acronym for Round Robin Database. RRD is a system to store and +RRD stands for Round Robin Database. RRD is a system to store and display time-series data (i.e. network bandwidth, machine-room temperature, -server load average). It stores the data in a very compact way that will not +server load average). It stores the data in a compact way that will not expand over time, and it presents useful graphs by processing the data to enforce a certain data density. It can be used either via simple wrapper scripts (from shell or Perl) or via frontends that poll network devices and put a friendly user interface on it. +%package -n librrd8 +Summary: Round Robin Database tool library +Group: System/Libraries + +%description -n librrd8 +RRD stands for Round Robin Database. RRD is a system to store and +display time-series data. + %package devel -Summary: RRDtool libraries and header files +Summary: RRDtool header files Group: Development/Libraries/C and C++ -Requires: %{name} = %{version}-%{release} +Requires: librrd8 = %{version}-%{release} %description devel -RRD is the Acronym for Round Robin Database. RRD is a system to store and +RRD stands for Round Robin Database. RRD is a system to store and display time-series data (i.e. network bandwidth, machine-room temperature, -server load average). This package allow you to use directly this library. +server load average). This package allow you to build programs making +use of the library. %package doc -Summary: RRDtool documentation +Summary: Documentation for rrdtool Group: Documentation %description doc @@ -181,7 +190,8 @@ Summary: Data caching daemon for RRDtool Group: Productivity/Scientific/Math Requires: %{name} = %{version}-%{release} Requires(pre): %fillup_prereq -Requires(pre): pwdutils +Requires(pre): /usr/sbin/useradd +Requires(pre): /usr/sbin/groupadd %description cached rrdcached is a daemon that receives updates to existing RRD files, @@ -200,7 +210,7 @@ daemon was written to alleviate these problems. modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" TIME="\"$(date -d "${modified}" "+%%R")\"" -find . -name '*.c' -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} \; +find . -name '*.c' -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" "{}" "+" %build %configure \ @@ -274,7 +284,7 @@ find %{buildroot}%{_libdir} -type f -name "*.la" -delete -print # documentation rm %{buildroot}%{_docdir}/%{name}/txt/*.pod -find %{buildroot}%{_docdir}/%{name}/examples/ -type f -exec chmod 0644 {} \; +find %{buildroot}%{_docdir}/%{name}/examples/ -type f -exec chmod 0644 "{}" "+" # install rrdcached specials install -D -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached @@ -290,15 +300,13 @@ mkdir -p %{buildroot}%{_sbindir} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcrrdcached %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} || : -%service_add_pre rrdcached.service -%service_add_pre rrdcached.socket +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} +%service_add_pre rrdcached.service rrdcached.socket %post cached %fillup_only rrdcached -%service_add_post rrdcached.service -%service_add_post rrdcached.socket +%service_add_post rrdcached.servicet rrdcached.socket %if 0%{?suse_version} <= 1320 systemd-tmpfiles --create %{_tmpfilesdir}/rddcached.conf >/dev/null 2>&1 || : %else @@ -306,16 +314,13 @@ systemd-tmpfiles --create %{_tmpfilesdir}/rddcached.conf >/dev/null 2>&1 || : %endif %preun cached -%service_del_preun rrdcached.service -%service_del_preun rrdcached.socket +%service_del_preun rrdcached.service rrdcached.socket %postun cached -%service_del_postun rrdcached.service -%service_del_postun rrdcached.socket +%service_del_postun rrdcached.service rrdcached.socket -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig +%post -n librrd8 -p /sbin/ldconfig +%postun -n librrd8 -p /sbin/ldconfig %files %defattr(-,root,root,-) @@ -325,6 +330,9 @@ systemd-tmpfiles --create %{_tmpfilesdir}/rddcached.conf >/dev/null 2>&1 || : %exclude %{_mandir}/man3/RRD* %{_bindir}/* %exclude %{_bindir}/rrdcached + +%files -n librrd8 +%defattr(-,root,root) %{_libdir}/librrd.so.* %files devel