summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--atop.spec108
-rw-r--r--sources1
3 files changed, 110 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..14d6007 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/atop-2.7.1.tar.gz
diff --git a/atop.spec b/atop.spec
new file mode 100644
index 0000000..1c76c44
--- /dev/null
+++ b/atop.spec
@@ -0,0 +1,108 @@
+Name: atop
+Version: 2.7.1
+Release: 2
+Summary: Advanced System and Process Monitor
+URL: https://www.atoptool.nl
+Source0: %{url}/download/%{name}-%{version}.tar.gz
+License: GPL-2.0-only
+Requires: zlib, ncurses
+BuildRequires: zlib-devel, ncurses-devel
+
+%description
+Atop is an ASCII full-screen performance monitor for Linux that is
+capable of reporting the activity of all processes (even if processes
+have finished during the interval), daily logging of system and process
+activity for long-term analysis, highlighting overloaded system resources
+by using colors, etc. At regular intervals, it shows system-level
+activity related to the CPU, memory, swap, disks (including LVM) and
+network layers, and for every process (and thread) it shows e.g. the CPU
+utilization, memory growth, disk utilization, priority, username, state,
+and exit code.
+In combination with the optional kernel module netatop, it even shows
+network activity per process/thread.
+
+%prep
+%setup -q
+
+%build
+export CFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="-Wl,-z,now"
+%make_build
+
+%install
+# generic build
+install -Dp -m 0755 atop $RPM_BUILD_ROOT/usr/bin/atop
+ln -s atop $RPM_BUILD_ROOT/usr/bin/atopsar
+install -Dp -m 0755 atopconvert $RPM_BUILD_ROOT/usr/bin/atopconvert
+install -Dp -m 0755 atopacctd $RPM_BUILD_ROOT/usr/sbin/atopacctd
+install -Dp -m 0755 atopgpud $RPM_BUILD_ROOT/usr/sbin/atopgpud
+install -Dp -m 0644 atop.default $RPM_BUILD_ROOT/etc/default/atop
+
+install -Dp -m 0644 man/atop.1 $RPM_BUILD_ROOT/usr/share/man/man1/atop.1
+install -Dp -m 0644 man/atopsar.1 $RPM_BUILD_ROOT/usr/share/man/man1/atopsar.1
+install -Dp -m 0644 man/atopconvert.1 $RPM_BUILD_ROOT/usr/share/man/man1/atopconvert.1
+install -Dp -m 0644 man/atoprc.5 $RPM_BUILD_ROOT/usr/share/man/man5/atoprc.5
+install -Dp -m 0644 man/atopacctd.8 $RPM_BUILD_ROOT/usr/share/man/man8/atopacctd.8
+install -Dp -m 0644 man/atopgpud.8 $RPM_BUILD_ROOT/usr/share/man/man8/atopgpud.8
+
+install -d -m 0755 $RPM_BUILD_ROOT/var/log/atop
+
+# systemd-specific build
+install -Dp -m 0644 atop.service $RPM_BUILD_ROOT/usr/lib/systemd/system/atop.service
+install -Dp -m 0644 atop-rotate.service $RPM_BUILD_ROOT/usr/lib/systemd/system/atop-rotate.service
+install -Dp -m 0644 atop-rotate.timer $RPM_BUILD_ROOT/usr/lib/systemd/system/atop-rotate.timer
+install -Dp -m 0644 atopacct.service $RPM_BUILD_ROOT/usr/lib/systemd/system/atopacct.service
+install -Dp -m 0644 atopgpu.service $RPM_BUILD_ROOT/usr/lib/systemd/system/atopgpu.service
+install -Dp -m 0755 atop-pm.sh $RPM_BUILD_ROOT/usr/lib/systemd/system-sleep/atop-pm.sh
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/bin/systemctl daemon-reload
+/bin/systemctl enable --now atopacct
+/bin/systemctl enable --now atop
+/bin/systemctl enable --now atop-rotate.timer
+
+%preun
+if [ $1 -eq 0 ]
+then
+ /bin/systemctl disable --now atop
+ /bin/systemctl disable --now atopacct
+ /bin/systemctl disable --now atopgpu
+fi
+
+%files
+%defattr(-,root,root)
+%doc README COPYING AUTHOR ChangeLog
+/usr/bin/atop
+/usr/bin/atopconvert
+/usr/bin/atopsar
+/usr/sbin/atopacctd
+/usr/sbin/atopgpud
+/usr/share/man/man1/atop.1*
+/usr/share/man/man1/atopsar.1*
+/usr/share/man/man1/atopconvert.1*
+/usr/share/man/man5/atoprc.5*
+/usr/share/man/man8/atopacctd.8*
+/usr/share/man/man8/atopgpud.8*
+/usr/lib/systemd/system/atop.service
+/usr/lib/systemd/system/atop-rotate.service
+/usr/lib/systemd/system/atop-rotate.timer
+/usr/lib/systemd/system/atopacct.service
+/usr/lib/systemd/system/atopgpu.service
+/usr/lib/systemd/system-sleep/atop-pm.sh
+/etc/default/atop
+%dir /var/log/atop/
+
+%changelog
+* Mon Jul 18 2022 wangkai <wangkai385@h-partners.com> - 2.7.1-2
+- License compliance rectification
+
+* Wed Jun 22 2022 yangzhao <yangzhao1@kylinos.com> - 2.7.1-1
+- Upgrade to 2.7.1
+
+* Fri Dec 25 2020 licihua <licihua@hawei.com> - 2.6.0-1
+- Upgrade to 2.6.0
+
+* Fri Jul 24 2020 ethan848 <mingfangsen@huawei.com> - 2.5.0-1
+- Initial RPM release
diff --git a/sources b/sources
new file mode 100644
index 0000000..840c2d2
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+25b41209435da224e4509dcc12bba328 atop-2.7.1.tar.gz