]>
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 12.?.x released (development version). | |
10 | # Sysstat 12.5.x released (stable version). | |
11 | Name: sysstat | |
12 | Version: 12.5.4 | |
13 | Release: 1 | |
14 | License: GPL v2 | |
15 | Group: Applications/System | |
16 | Source0: http://pagesperso-orange.fr/sebastien.godard/%{name}-%{version}.tar.xz | |
17 | # Source0-md5: 697890a0fe72be4afe1dcdfff802bde1 | |
18 | Source2: %{name}.init | |
19 | Source3: crontab | |
20 | Patch1: install.patch | |
21 | URL: http://sebastien.godard.pagesperso-orange.fr/ | |
22 | BuildRequires: autoconf >= 2.53 | |
23 | BuildRequires: automake | |
24 | BuildRequires: gettext-tools | |
25 | BuildRequires: lm_sensors-devel | |
26 | BuildRequires: rpmbuild(macros) >= 1.671 | |
27 | BuildRequires: tar >= 1:1.22 | |
28 | BuildRequires: xz | |
29 | Requires(post,preun): /sbin/chkconfig | |
30 | Requires: cronjobs | |
31 | Requires: rc-scripts | |
32 | Requires: systemd-units >= 38 | |
33 | Requires: xz | |
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=1 \ | |
75 | sadc_options='-L -S XDISK' \ | |
76 | sa_lib_dir=%{_libexecdir} \ | |
77 | ZIP=%{_bindir}/xz \ | |
78 | --enable-install-cron \ | |
79 | --disable-stripping \ | |
80 | --with-systemdsystemunitdir=%{systemdunitdir} | |
81 | ||
82 | %{__sed} -i 's/SADC_OPTIONS=""/SADC_OPTIONS="-L -S XDISK"/' sysstat.sysconfig | |
83 | ||
84 | %{__make} -j1 \ | |
85 | CC="%{__cc}" \ | |
86 | CFLAGS="%{rpmcflags}" \ | |
87 | ||
88 | %install | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | install -d $RPM_BUILD_ROOT{/etc/{cron.d,rc.d/init.d,sysconfig},/var/log/sa,%{systemdunitdir}} | |
91 | ||
92 | %{__make} install \ | |
93 | CHOWN=/bin/true \ | |
94 | SYSTEMCTL=/bin/true \ | |
95 | SYSTEMD_UNIT_DIR=%{systemdunitdir} \ | |
96 | DESTDIR=$RPM_BUILD_ROOT \ | |
97 | IGNORE_MAN_GROUP=y \ | |
98 | IGNORE_FILE_ATTRIBUTES=y | |
99 | ||
100 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/sysstat | |
101 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/%{name} | |
102 | ||
103 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
104 | ||
105 | %find_lang %{name} | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %post | |
111 | /sbin/chkconfig --add sysstat | |
112 | %service sysstat restart | |
113 | %systemd_post sysstat.service | |
114 | ||
115 | %preun | |
116 | if [ "$1" = "0" ]; then | |
117 | %service sysstat stop | |
118 | /sbin/chkconfig --del sysstat | |
119 | fi | |
120 | %systemd_preun sysstat.service | |
121 | ||
122 | %postun | |
123 | %systemd_reload | |
124 | ||
125 | %triggerpostun -- %{name} < 10.1.6-1 | |
126 | %systemd_trigger sysstat.service | |
127 | ||
128 | %triggerpostun -- %{name} < 12.2.0-2 | |
129 | C=0 | |
130 | for log in /var/log/sa/sa[0-9]*; do | |
131 | if (LC_ALL=C %{_bindir}/sadf -C "$log" 2>&1 | grep -q "Current sysstat version cannot read the format of this file"); then | |
132 | echo "Converting file $log to current format: " | |
133 | if (%{_bindir}/sadf -c "$log" > "$log.migrate"); then | |
134 | chown --reference "$log" "$log.migrate" | |
135 | chmod --reference "$log" "$log.migrate" | |
136 | mv "$log.migrate" "$log" | |
137 | C=1 | |
138 | else | |
139 | echo "$log MIGRATION FAILED." >&2 | |
140 | fi | |
141 | fi | |
142 | done | |
143 | if [ "$C" -eq 1 ]; then | |
144 | %service sysstat restart | |
145 | %systemd_post sysstat.service | |
146 | fi | |
147 | ||
148 | %files -f %{name}.lang | |
149 | %defattr(644,root,root,755) | |
150 | %doc CHANGES CREDITS README.md FAQ.md | |
151 | %attr(755,root,root) %{_bindir}/cifsiostat | |
152 | %attr(755,root,root) %{_bindir}/iostat | |
153 | %attr(755,root,root) %{_bindir}/mpstat | |
154 | %attr(755,root,root) %{_bindir}/tapestat | |
155 | %attr(755,root,root) %{_bindir}/pidstat | |
156 | %attr(755,root,root) %{_bindir}/sadf | |
157 | %attr(755,root,root) %{_bindir}/sar | |
158 | %dir %{_libexecdir} | |
159 | %attr(755,root,root) %{_libexecdir}/sa1 | |
160 | %attr(755,root,root) %{_libexecdir}/sa2 | |
161 | %attr(755,root,root) %{_libexecdir}/sadc | |
162 | %attr(754,root,root) /etc/rc.d/init.d/sysstat | |
163 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/sysstat | |
164 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sysstat | |
165 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/sysstat.ioconf | |
166 | %{systemdunitdir}/sysstat.service | |
167 | %{systemdunitdir}/sysstat-collect.service | |
168 | %{systemdunitdir}/sysstat-collect.timer | |
169 | %{systemdunitdir}/sysstat-summary.service | |
170 | %{systemdunitdir}/sysstat-summary.timer | |
171 | %{systemdunitdir}-sleep/sysstat.sleep | |
172 | %{_mandir}/man1/cifsiostat.1* | |
173 | %{_mandir}/man1/iostat.1* | |
174 | %{_mandir}/man1/mpstat.1* | |
175 | %{_mandir}/man1/tapestat.1* | |
176 | %{_mandir}/man1/pidstat.1* | |
177 | %{_mandir}/man1/sadf.1* | |
178 | %{_mandir}/man1/sar.1* | |
179 | %{_mandir}/man5/sysstat.5* | |
180 | %{_mandir}/man8/sa1.8* | |
181 | %{_mandir}/man8/sa2.8* | |
182 | %{_mandir}/man8/sadc.8* | |
183 | %attr(750,root,root) %dir /var/log/sa |