Summary: UPS management software for APC UPS models
-Summary(pl): Oprogramowanie do obs³ugi UPS-ów APC
+Summary(pl.UTF-8): Oprogramowanie do obsługi UPS-ów APC
Name: PowerChutePlus
Version: 4.5.3
-Release: 1
+Release: 2
License: (c) 1999 APC, inc.
Group: Applications/System
Source0: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pcplus_453_caldera.tar
Source7: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/settings.pdf
# Source7-md5: c69abad141a836fd12ced0cc39049dc6
Patch0: %{name}-fix-sh.patch
-PreReq: rc-scripts
-Requires(pre): /bin/id
-Requires(pre): /usr/bin/getgid
-Requires(pre): /usr/sbin/useradd
-Requires(pre): /usr/sbin/groupadd
+BuildRequires: rpmbuild(macros) >= 1.268
Requires(post,preun): /sbin/chkconfig
Requires(postun): /usr/sbin/groupdel
Requires(postun): /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/groupmod
+Requires(pre): /usr/sbin/useradd
+Requires(pre): /usr/sbin/usermod
+Requires: rc-scripts
+Provides: group(pwrchute)
+Provides: user(pwrchute)
ExclusiveArch: %{ix86}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
to power failures and other power events. It also allows users to
configure and manage UPS models.
-Please note that /usr/lib/powerchute/Config.sh should be run in order
+Please note that %{_libdir}/powerchute/Config.sh should be run in order
to configure PowerChute plus.
-%description -l pl
-Ten program pozwala u¿ytkownikom bezpiecznie wy³±czyæ system w
-przypadku awarii zasilania. Pozwala tak¿e na skonfigurowanie UPS.
+%description -l pl.UTF-8
+Ten program pozwala użytkownikom bezpiecznie wyłączyć system w
+przypadku awarii zasilania. Pozwala także na skonfigurowanie UPS.
-Uwaga: aby skonfigurowaæ PowerChute Plus nale¿y uruchomiæ
+Uwaga: aby skonfigurować PowerChute Plus należy uruchomić
/usr/lib/powerchute/Config.sh .
%prep
%setup -q -c
-for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP ; do
+for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP; do
tar xf $i
done
%patch0 -p1
-%build
-# No build, binary package
-
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/powerchute} \
rm -rf $RPM_BUILD_ROOT
%pre
-if [ -n "`getgid pwrchute`" ]; then
- if [ "`getgid pwrchute`" != "68" ]; then
- echo "Error: group pwrchute doesn't have gid=68. Correct this before installing PowerChutePlus." 1>&2
- exit 1
- fi
-else
- /usr/sbin/groupadd -g 68 pwrchute
-fi
-if [ -n "`id -u pwrchute 2>/dev/null`" ]; then
- if [ "`id -u pwrchute`" != "68" ]; then
- echo "Error: user pwrchute doesn't have uid=68. Correct this before installing PowerChutePlus." 1>&2
- exit 1
- fi
-else
- /usr/sbin/useradd -u 68 -g 68 -d /dev/null -s /bin/false -c "PowerChute Plus" pwrchute
+# move to trigger?
+if [ -n "`/usr/bin/getgid pwrchute 2>/dev/null`" ] && [ "`/usr/bin/getgid pwrchute`" != 233 ]; then
+ /usr/sbin/groupmod -g 233 pwrchute
+ chgrp pwrchute %{_sysconfdir}/powerchute.ini
+ /usr/sbin/usermod -u 233 -g 233 pwrchute
fi
+%groupadd -g 233 pwrchute
+%useradd -u 233 -g 233 -d /usr/share/empty -s /bin/false -c "PowerChute Plus" pwrchute
%post
/sbin/chkconfig --add upsd
-if [ -f /var/lock/subsys/upsd ]; then
- /etc/rc.d/init.d/upsd restart 1>&2
-else
- echo "Type \"/etc/rc.d/init.d/upsd start\" to start UPSd server" 1>&2
-fi
+%service upsd restart "UPSd server"
cd %{_libdir}/powerchute
./machine_id
echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus"
echo "Remember to set the password for pwrchute account"
-
+
%preun
if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/upsd ]; then
- /etc/rc.d/init.d/upsd stop 1>&2
- fi
+ %service upsd stop
/sbin/chkconfig --del upsd
fi
%postun
if [ "$1" = "0" ]; then
- /usr/sbin/userdel pwrchute
- /usr/sbin/groupdel pwrchute
+ %userremove pwrchute
+ %groupremove pwrchute
fi
%files
%defattr(644,root,root,755)
%doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf
%attr(754,root,root) /etc/rc.d/init.d/upsd
-%attr(640,root,pwrchute) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/powerchute.ini
+%attr(640,root,pwrchute) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/powerchute.ini
%attr(755,root,root) %{_sbindir}/upsd
+%dir %{_libdir}/powerchute
%attr(755,root,root) %{_libdir}/powerchute/Config.sh
%attr(755,root,root) %{_libdir}/powerchute/_xpwrchute
%attr(755,root,root) %{_libdir}/powerchute/addpage.sh
%attr(755,root,root) %{_prefix}/X11R6/bin/xpowerchute
%{_prefix}/X11R6/lib/X11/app-defaults/*
%{_prefix}/X11R6/lib/X11/uid/*
-%config(noreplace) %verify(not size mtime md5) %{_libdir}/powerchute/upsd.pid
-%config(noreplace) %verify(not size mtime md5) %{_libdir}/powerchute/bkupsd.pid
+%config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/upsd.pid
+%config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/bkupsd.pid