Name: atop Version: 2.0.2 Release: 3 Summary: An advanced interactive monitor to view the load on system and process level Group: Applications/System License: GPLv2+ URL: http://www.atcomputing.nl/Tools/atop/ Source0: http://www.atcomputing.nl/Tools/%{name}/packages/%{name}-%{version}.tar.gz Source1: atop.logrotate Source2: atop.init Source3: atop.crondaily Source4: atop.sysconfig Source5: atop.d Source6: atop.service Patch0: atop-1.23-cron.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: zlib-devel BuildRequires: ncurses-devel %if 0%{?fedora} >= 15 BuildRequires: systemd-units Requires(post): systemd-units Requires(post): systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units %else Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service %endif %description An advanced interactive monitor for Linux-systems to view the load on system-level and process-level. The command atop has some major advantages compared to other performance-monitors: - Resource consumption by all processes - Utilization of all relevant resources - Permanent logging of resource utilization - Highlight critical resources - Watch activity only - Watch deviations only - Accumulated process activity per user - Accumulated process activity per program For more informations: http://www.atcomputing.nl/Tools/atop The package does not make use of the patches available at http://www.atcomputing.nl/Tools/atop/kernpatch.html %prep %setup -q %patch0 -p1 -b .cron %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" %install rm -rf $RPM_BUILD_ROOT install -Dp -m 0755 atop $RPM_BUILD_ROOT%{_bindir}/atop ln -s atop $RPM_BUILD_ROOT%{_bindir}/atopsar install -Dp -m 0644 man/atop.1 $RPM_BUILD_ROOT%{_mandir}/man1/atop.1 install -Dp -m 0644 man/atopsar.1 $RPM_BUILD_ROOT%{_mandir}/man1/atopsar.1 install -Dp -m 0644 man/atoprc.5 $RPM_BUILD_ROOT%{_mandir}/man5/atoprc.5 install -Dp -m 0644 atop.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/atop install -Dp -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/atop # TODO #install -Dp -m 0644 psaccs_atop $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/psaccs_atop #install -Dp -m 0644 psaccu_atop $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/psaccu_atop #install -Dp -m 0711 45atoppm $RPM_BUILD_ROOT%{_sysconfdir}/atop/45atoppm install -Dp -m 0755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/atop install -Dp -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/atop install -Dp -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}/atopd %if 0%{?fedora} >= 15 install -Dp -m 0644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/atop.service %else install -Dp -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/atop %endif install -d $RPM_BUILD_ROOT%{_localstatedir}/log/atop %clean rm -rf $RPM_BUILD_ROOT %post %if 0%{?fedora} >= 15 if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %else if [ $1 -eq 1 ] ; then # Initial installation /sbin/chkconfig --add atop fi %endif # create dummy files to be rotated #touch /var/log/atop/dummy_before /var/log/atop/dummy_after %preun %if 0%{?fedora} >= 15 if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable atop.service > /dev/null 2>&1 || : /bin/systemctl stop atop.service > /dev/null 2>&1 || : fi %else if [ $1 -eq 0 ] ; then # Package removal, not upgrade /sbin/service atop stop > /dev/null 2>&1 || : /sbin/chkconfig atop off > /dev/null 2>&1 || : fi %endif %postun %if 0%{?fedora} >= 15 /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart atop.service >/dev/null 2>&1 || : fi %else if [ $1 -ge 1 ]; then /sbin/service atop condrestart &>/dev/null || : fi %endif %if 0%{?fedora} >= 15 %triggerun -- atop < 1.26-1 # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply atop # to migrate them to systemd targets /usr/bin/systemd-sysv-convert --save atop >/dev/null 2>&1 ||: # Run these because the SysV package being removed won't do them /sbin/chkconfig --del atop >/dev/null 2>&1 || : /bin/systemctl try-restart atop.service >/dev/null 2>&1 || : %endif %files %defattr(-,root,root,-) %doc AUTHOR COPYING README ChangeLog %config(noreplace) %{_sysconfdir}/cron.d/atop %config(noreplace) %{_sysconfdir}/logrotate.d/atop %config(noreplace) %{_sysconfdir}/sysconfig/atop %{_sysconfdir}/cron.daily/atop %{_bindir}/atopsar %{_bindir}/atop %{_bindir}/atopd %{_mandir}/man1/atop.1.gz %{_mandir}/man1/atopsar.1.gz %{_mandir}/man5/atoprc.5.gz %attr(0755,root,root) %dir %{_localstatedir}/log/atop %if 0%{?fedora} >= 15 %{_unitdir}/atop.service %else %{_initrddir}/atop %endif %changelog * Fri Mar 22 2013 Scott R. Shinn - 2.0.2-3 - Updates to pre/post for non-fedora environments * Tue Nov 20 2012 Scott R. Shinn - 2.0.2-2 - Update to 2.0.2 * Mon Dec 5 2011 Scott R. Shinn - Add conditional logic for fedora/el packaging * Tue Jun 21 2011 Jon Ciesla - 1.26-1 - New upstream, BZ 657207. - Migrated from sysv to systemd, BZ 659629. - Modified to respect sysconfig settings, BZ 609124. - Dropped explicit Requires for ncurses. * Mon Feb 07 2011 Fedora Release Engineering - 1.23-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Fri Jul 24 2009 Fedora Release Engineering - 1.23-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Mon Feb 23 2009 Fedora Release Engineering - 1.23-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Mon Jul 21 2008 Kairo Araujo - 1.23-8 - add bug fixes for #455223 and #455375 logrotate output error: error: atop:prerotate or postrotate without endscript * Mon May 5 2008 Kairo Araujo - 1.23-7 - add bug fixes for #445174 * Thu Apr 3 2008 Kairo Araujo - 1.23-6 - removed variable DATALIFE from atop.d and atop.crondaily * Wed Apr 2 2008 Kairo Araujo - 1.23-5 - improved atop.d and atop.crondaily (Manuel Wolfshant) * Mon Mar 31 2008 Kairo Araujo - 1.23-4 - logical bash bug on atop.d and atop.crondaily - implemented security on atop.d and atop.crondaily - common script for init and cron.daily * Sat Mar 29 2008 Kairo Araujo - 1.23-3 - deleted duplicate "-p" on spec file (install) - modified comment about interval on atop.d and atop.crondaily - removed check atop.log on atop.d and atop.crondaily - created new section on atop.crondaily * Thu Mar 27 2008 Kairo Araujo - 1.23-2 - removed atop start on %%post - atop.crondaily with exit after checking - created atop.sysconfig with variables - created atop.d (removed atop.crondaily call from cron.init) * Thu Mar 27 2008 Kairo Araujo - 1.23-1 - update 1.23 - bug on source2 (init file) * Sun Jan 27 2008 Kairo Araujo - 1.22-3 - removed minimal version from requires/build-requires - corrected variable in atop.crondaily - corrected comentary in atop.crondaily * Sun Jan 27 2008 Kairo Araujo - 1.22-2 - corrected license tag to GPLv2+ - replaced references to atop (init file) - rebuild with Fedora mandatory flags (make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS") - chkconfig and service added at pre/post scriptlets - improved name in logrotate file configuration - corrected english description * Sat Jan 26 2008 Kairo Araujo - 1.22-1 - Initial RPM release