[nut/el6] add nut-monitor (gui) to client sub-package
Michal Hlavinka
mhlavink at fedoraproject.org
Wed Jul 27 09:43:30 UTC 2011
commit 29780debb53a1edcb4a71508b933601595db1f14
Author: Michal Hlavinka <mhlavink at redhat.com>
Date: Wed Jul 27 11:43:16 2011 +0200
add nut-monitor (gui) to client sub-package
nut.spec | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/nut.spec b/nut.spec
index 22c0653..5d2ff6a 100644
--- a/nut.spec
+++ b/nut.spec
@@ -6,10 +6,14 @@
%define piddir /var/run/nut
%define modeldir /sbin
+%if ! (0%{?fedora} > 12 || 0%{?rhel} > 6)
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%endif
+
Summary: Network UPS Tools
Name: nut
Version: 2.4.3
-Release: 3%{?dist}
+Release: 4%{?dist}
Group: Applications/System
License: GPLv2+
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -52,6 +56,7 @@ BuildRequires: net-snmp-devel
BuildRequires: netpbm-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
+BuildRequires: python-devel
#BuildRequires: powerman-devel
%ifnarch s390 s390x
@@ -124,6 +129,10 @@ necessary to develop NUT client applications.
%patch1 -p1 -b .halpath
%patch2 -p1 -b .bz575334
%patch3 -p1 -b .udevpatch
+sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop
+sed -i "s|sys.argv\[0\]|'%{_datadir}/%{name}/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor
+sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient-config.in
+sed -i 's|LIBSSL_LDFLAGS|LIBSSL_LIBS|' lib/libupsclient.pc.in
%build
autoreconf -i
@@ -203,6 +212,17 @@ do
mv -f $fe.new $fe
done
+# install PyNUT
+install -p -D -m 644 scripts/python/module/PyNUT.py %{buildroot}%{python_sitelib}/PyNUT.py
+# install nut-monitor
+mkdir -p %{buildroot}%{_datadir}/nut/nut-monitor/pixmaps
+install -p -m 755 scripts/python/app/NUT-Monitor %{buildroot}%{_datadir}/nut/nut-monitor/nut-monitor
+install -p -m 644 scripts/python/app/gui*.glade %{buildroot}%{_datadir}/nut/nut-monitor
+#install -p -m 644 scripts/python/app/pixmaps/* %{buildroot}%{_datadir}/nut/nut-monitor/pixmaps/
+install -p -D scripts/python/app/nut-monitor.png %{buildroot}%{_datadir}/pixmaps/nut-monitor.png
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications scripts/python/app/nut-monitor.desktop
+ln -s %{_datadir}/nut/nut-monitor/nut-monitor %{buildroot}%{_bindir}/nut-monitor
+
%pre
/usr/sbin/useradd -c "Network UPS Tools" -u %{nut_uid} \
@@ -331,6 +351,11 @@ rm -rf %{buildroot}
%{_mandir}/man8/upslog.8.gz
%{_mandir}/man8/upsmon.8.gz
%{_mandir}/man8/upssched.8.gz
+%{_bindir}/nut-monitor
+%{python_sitelib}/PyNUT.*
+%{_datadir}/nut
+%{_datadir}/pixmaps/nut-monitor.png
+%{_datadir}/applications/nut-monitor.desktop
%files cgi
%defattr(-,root,root,-)
@@ -365,6 +390,9 @@ rm -rf %{buildroot}
%{_libdir}/pkgconfig/libupsclient.pc
%changelog
+* Wed Jul 27 2011 Michal Hlavinka <mhlavink at redhat.com> - 2.4.3-4
+- add nut-monitor (gui) to client sub-package
+
* Fri Mar 26 2010 Michal Hlavinka <mhlavink at redhat.com> - 2.4.3-3
- replace BUS with SUBSYSTEMS in udev rules (#573806)
More information about the scm-commits
mailing list