]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Fix or remove install.patch (seems systemd files are installed now) | |
3 | Summary: The sar and iostat system monitoring commands | |
4 | Summary(pl.UTF-8): Polecenia sar i iostat dla systemu Linux | |
5 | Summary(ru.UTF-8): Содержит программы системного мониторинга sar и iostat | |
6 | Summary(uk.UTF-8): Містить команди системного моніторингу sar та iostat | |
7 | Summary(zh_CN.UTF-8): sar, iostat 等系统监视工具 | |
8 | # use stable versions | |
9 | # Sysstat 11.5.x (development version). | |
10 | # Sysstat 11.4.x (stable version). | |
11 | # Sysstat 11.2.x (stable version). | |
12 | Name: sysstat | |
13 | Version: 11.4.3 | |
14 | Release: 2 | |
15 | License: GPL v2 | |
16 | Group: Applications/System | |
17 | Source0: http://pagesperso-orange.fr/sebastien.godard/%{name}-%{version}.tar.xz | |
18 | # Source0-md5: 76e449bb83a25d95355694338b5ace70 | |
19 | Source2: %{name}.init | |
20 | Source3: crontab | |
21 | Patch1: install.patch | |
22 | URL: http://perso.wanadoo.fr/sebastien.godard/ | |
23 | BuildRequires: autoconf >= 2.53 | |
24 | BuildRequires: automake | |
25 | BuildRequires: gettext-tools | |
26 | BuildRequires: lm_sensors-devel | |
27 | BuildRequires: rpmbuild(macros) >= 1.671 | |
28 | BuildRequires: tar >= 1:1.22 | |
29 | BuildRequires: xz | |
30 | Requires(post,preun): /sbin/chkconfig | |
31 | Requires: cronjobs | |
32 | Requires: rc-scripts | |
33 | Requires: systemd-units >= 38 | |
34 | Obsoletes: iostat | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %define _libexecdir %{_prefix}/lib/sa | |
38 | ||
39 | %description | |
40 | This package provides the sar and iostat commands for the Linux | |
41 | operating system, similar to their traditional UNIX counterparts. They | |
42 | enable system monitoring of disk, network, and other IO activity. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Pakiet ten udostępnia polecenia sar i iostat dla systemu Linux podobne | |
46 | w działaniu do tradycyjnych narzędzi systemu Unix. Polecenia te | |
47 | umożliwiają monitorowanie obciążenia zasobów dyskowych, interfejsów | |
48 | sieciowych i innych operacji wejścia/wyjścia. | |
49 | ||
50 | %description -l ru.UTF-8 | |
51 | Этот пакет содержит программы sar и iostat для Linux, похожие на | |
52 | традиционные одноименные программы UNIX. Они позволяют осуществлять | |
53 | мониторинг дисковой, сетевой и прочей активности системы. | |
54 | ||
55 | %description -l uk.UTF-8 | |
56 | Цей пакет містить програми sar та iostat для Linux, схожі на | |
57 | традиційні відповідні програми UNIX. Вони дозволяють здійснювати | |
58 | моніторинг дискової, мережевої та іншої активності системи. | |
59 | ||
60 | %description -l zh_CN.UTF-8 | |
61 | 本软件提供了用于Linux的系统监视工具, 可以监视磁盘, 网络以及 其他 IO 的活动情况. | |
62 | ||
63 | %prep | |
64 | %setup -q | |
65 | %patch1 -p1 | |
66 | ||
67 | %build | |
68 | %{__aclocal} | |
69 | %{__autoconf} | |
70 | %configure \ | |
71 | history=28 \ | |
72 | compressafter=31 \ | |
73 | cron_owner=root \ | |
74 | cron_interval=10 \ | |
75 | sa_lib_dir=%{_libexecdir} \ | |
76 | --enable-install-cron \ | |
77 | --disable-stripping \ | |
78 | --with-systemdsystemunitdir=%{systemdunitdir} | |
79 | ||
80 | %{__sed} -i 's/SADC_OPTIONS=""/SADC_OPTIONS="-L"/' sysstat.sysconfig | |
81 | ||
82 | %{__make} -j1 \ | |
83 | CC="%{__cc}" \ | |
84 | CFLAGS="%{rpmcflags}" \ | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | install -d $RPM_BUILD_ROOT{/etc/{cron.d,rc.d/init.d,sysconfig},/var/log/sa,%{systemdunitdir}} | |
89 | ||
90 | %{__make} install \ | |
91 | CHOWN=/bin/true \ | |
92 | SYSTEMCTL=/bin/true \ | |
93 | SYSTEMD_UNIT_DIR=%{systemdunitdir} \ | |
94 | DESTDIR=$RPM_BUILD_ROOT \ | |
95 | IGNORE_MAN_GROUP=y \ | |
96 | IGNORE_FILE_ATTRIBUTES=y | |
97 | ||
98 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/sysstat | |
99 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name} | |
100 | ||
101 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
102 | ||
103 | %find_lang %{name} | |
104 | ||
105 | %clean | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %post | |
109 | /sbin/chkconfig --add sysstat | |
110 | %service sysstat restart | |
111 | %systemd_post sysstat.service | |
112 | ||
113 | %preun | |
114 | if [ "$1" = "0" ]; then | |
115 | %service sysstat stop | |
116 | /sbin/chkconfig --del sysstat | |
117 | fi | |
118 | %systemd_preun sysstat.service | |
119 | ||
120 | %postun | |
121 | %systemd_reload | |
122 | ||
123 | %triggerpostun -- %{name} < 10.1.6-1 | |
124 | %systemd_trigger sysstat.service | |
125 | ||
126 | %triggerpostun -- %{name} < 11.2.0-2 | |
127 | C=0 | |
128 | for log in /var/log/sa/sa[0-9]*; do | |
129 | if (LC_ALL=C %{_bindir}/sadf -C "$log" 2>&1 | grep -q "Current sysstat version cannot read the format of this file"); then | |
130 | echo "Converting file $log to current format: " | |
131 | if (%{_bindir}/sadf -c "$log" > "$log.migrate"); then | |
132 | chown --reference "$log" "$log.migrate" | |
133 | chmod --reference "$log" "$log.migrate" | |
134 | mv "$log.migrate" "$log" | |
135 | C=1 | |
136 | else | |
137 | echo "$log MIGRATION FAILED." >&2 | |
138 | fi | |
139 | fi | |
140 | done | |
141 | if [ "$C" -eq 1 ]; then | |
142 | %service sysstat restart | |
143 | %systemd_post sysstat.service | |
144 | fi | |
145 | ||
146 | %files -f %{name}.lang | |
147 | %defattr(644,root,root,755) | |
148 | %doc CHANGES CREDITS README.md FAQ | |
149 | %attr(755,root,root) %{_bindir}/cifsiostat | |
150 | %attr(755,root,root) %{_bindir}/iostat | |
151 | %attr(755,root,root) %{_bindir}/mpstat | |
152 | %attr(755,root,root) %{_bindir}/tapestat | |
153 | %attr(755,root,root) %{_bindir}/pidstat | |
154 | %attr(755,root,root) %{_bindir}/sadf | |
155 | %attr(755,root,root) %{_bindir}/sar | |
156 | %dir %{_libexecdir} | |
157 | %attr(755,root,root) %{_libexecdir}/sa1 | |
158 | %attr(755,root,root) %{_libexecdir}/sa2 | |
159 | %attr(755,root,root) %{_libexecdir}/sadc | |
160 | %attr(754,root,root) /etc/rc.d/init.d/sysstat | |
161 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sysstat | |
162 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sysstat | |
163 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sysstat.ioconf | |
164 | %{systemdunitdir}/sysstat.service | |
165 | %{systemdunitdir}/sysstat-collect.service | |
166 | %{systemdunitdir}/sysstat-collect.timer | |
167 | %{systemdunitdir}/sysstat-summary.service | |
168 | %{systemdunitdir}/sysstat-summary.timer | |
169 | %{_mandir}/man1/cifsiostat.1* | |
170 | %{_mandir}/man1/iostat.1* | |
171 | %{_mandir}/man1/mpstat.1* | |
172 | %{_mandir}/man1/tapestat.1* | |
173 | %{_mandir}/man1/pidstat.1* | |
174 | %{_mandir}/man1/sadf.1* | |
175 | %{_mandir}/man1/sar.1* | |
176 | %{_mandir}/man5/sysstat.5* | |
177 | %{_mandir}/man8/sa1.8* | |
178 | %{_mandir}/man8/sa2.8* | |
179 | %{_mandir}/man8/sadc.8* | |
180 | %attr(750,root,root) %dir /var/log/sa |