Browse Source

sysstat-12.7.1-1

Tomohiro "Tomo-p" KATO 1 năm trước cách đây
mục cha
commit
1f03ff308a
1 tập tin đã thay đổi với 64 bổ sung18 xóa
  1. 64 18
      s/sysstat/sysstat-vl.spec

+ 64 - 18
s/sysstat/sysstat-vl.spec

@@ -1,22 +1,29 @@
+%bcond_with systemd
+
 Summary:	Collection of performance monitoring tools for Linux
 Summary(ja):	Linux 用パフォーマンス計測ツール集
 Name:		sysstat
-Version:	12.2.1
-Release:	1%{?_dist_release}
+Version:	12.7.1
+Release:	1%{?_dist_release}%{?with_systemd:.systemd}
+Group:		system
+Vendor:		Project Vine
+Distribution:	Vine Linux
+Packager:	shaolin
+
 License:	GPLv2+
-Group:		Applications/System
 URL:		http://sebastien.godard.pagesperso-orange.fr/
 Source:		http://pagesperso-orange.fr/sebastien.godard/%{name}-%{version}.tar.xz
 
-BuildRoot::     %{_tmppath}/%{name}-%{version}-root
-BuildRequires:  gettext, lm-sensors-devel
-Requires:	cronie, findutils, xz
+BuildRoot::	%{_tmppath}/%{name}-%{version}-root
+BuildRequires:	gettext, lm-sensors-devel
+Requires:	findutils, xz
+%if %{with systemd}
+%{?systemd_requires}
+%else
+Requires:	cronie
 Requires(post):   /sbin/chkconfig
 Requires(preun):  /sbin/chkconfig
-
-Vendor:         Project Vine
-Distribution:   Vine Linux
-Packager:       shaolin
+%endif
 
 %description
 The sysstat package contains sar, sadf, mpstat, iostat, pidstat, nfsiostat,
@@ -36,6 +43,9 @@ The nfsiostat command reports I/O statistics for network file systems.
 The cifsiostat command reports I/O statistics for CIFS file systems.
 
 
+%debug_package
+
+
 %prep
 %setup -q
 iconv -f windows-1252 -t utf8 CREDITS > CREDITS.aux
@@ -44,10 +54,14 @@ mv CREDITS.aux CREDITS
 
 %build
 %configure \
-    --enable-install-cron --enable-copy-only --disable-file-attr \
-    --disable-stripping --docdir=%{_docdir}/%{name}-%{version} \
+    --enable-install-cron \
+    --enable-copy-only \
+    --disable-file-attr \
+    --disable-stripping \
+    --docdir='%{_pkgdocdir}' \
     sadc_options='-S DISK' \
-    history=28 compressafter=31
+    history=28 \
+    compressafter=31
 make %{?_smp_mflags}
 
 
@@ -55,39 +69,66 @@ make %{?_smp_mflags}
 rm -rf %{buildroot}
 make install DESTDIR=%{buildroot}
 
-# Install cron file
-mkdir -p %{buildroot}%{_sysconfdir}/cron.d
-install -m 0644 cron/sysstat.crond %{buildroot}%{_sysconfdir}/cron.d/sysstat
+rm -f %{buildroot}%{_pkgdocdir}/COPYING
 
 # Install service file
+%if %{with systemd}
+
+%else
 mkdir -p %{buildroot}%{_initdir}
 install -m 0755 sysstat %{buildroot}%{_initdir}/
 
+# Install cron file
+mkdir -p %{buildroot}%{_sysconfdir}/cron.d
+install -m 0644 cron/sysstat.crond %{buildroot}%{_sysconfdir}/cron.d/sysstat
+%endif
+
 %find_lang %{name}
 
+
 %clean
 rm -rf %{buildroot}
 
+
 %post
+%if %{with systemd}
+%systemd_post sysstat.service sysstat-collect.timer sysstat-summary.timer
+%else
 /sbin/chkconfig --add sysstat
+%endif
 
 %preun
+%if %{with systemd}
+%systemd_preun sysstat.service sysstat-collect.timer sysstat-summary.timer%else
+%endif
 if [[ $1 -eq 0 ]]; then
     # Remove sa logs if removing sysstat completely
     rm -f %{_localstatedir}/log/sa/*
     # Remove service
+%if !%{with systemd}
     /sbin/chkconfig --del sysstat
+%endif
 fi
 
+%if %{with systemd}
+%postun
+%systemd_postun sysstat.service sysstat-collect.timer sysstat-summary.timer
+%endif
+
 
 %files -f %{name}.lang
 %defattr(-,root,root,-)
 %license COPYING
-%doc CHANGES CREDITS README.md FAQ.md
-%config(noreplace) %{_sysconfdir}/cron.d/sysstat
+%doc CHANGES CREDITS README.md FAQ.md %{name}-%{version}.lsm
 %config(noreplace) %{_sysconfdir}/sysconfig/sysstat
 %config(noreplace) %{_sysconfdir}/sysconfig/sysstat.ioconf
+%if %{with systemd}
+%{_systemd_util_dir}/system-sleep/sysstat*
+%{_unitdir}/sysstat*
+%else
+%config(noreplace) %{_sysconfdir}/cron.d/sysstat
 %{_initdir}/sysstat
+%endif
 %{_bindir}/*
 %{_libdir}/sa
 %{_mandir}/man1/*
@@ -95,7 +136,12 @@ fi
 %{_mandir}/man8/*
 %{_localstatedir}/log/sa
 
+
 %changelog
+* Thu Nov 17 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 12.7.1-1
+- updated to 12.7.1.
+- added systemd support (disabled as default).
+
 * Mon Mar 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 12.2.1-1
 - updated to 12.2.1.