1 Summary: UPS management software for APC UPS models
2 Summary(pl.UTF-8): Oprogramowanie do obsługi UPS-ów APC
6 License: (c) 1999 APC, inc.
7 Group: Applications/System
8 Source0: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pcplus_453_caldera.tar
9 # Source0-md5: 5eb99efd5561694b9f692aa713bd974d
10 Source1: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pc453ug.pdf
11 # Source1-md5: 0c2a621adcad8fdcb6064ed3cb042711
13 Source3: %{name}-xpowerchute.sh
14 Source4: %{name}-Config.sh
15 Source5: %{name}-powerchute.ini
16 Source6: %{name}-powerchute.ini_templ
17 Source7: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/settings.pdf
18 # Source7-md5: c69abad141a836fd12ced0cc39049dc6
19 Patch0: %{name}-fix-sh.patch
20 BuildRequires: rpmbuild(macros) >= 1.268
21 Requires(post,preun): /sbin/chkconfig
22 Requires(postun): /usr/sbin/groupdel
23 Requires(postun): /usr/sbin/userdel
24 Requires(pre): /bin/id
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /usr/sbin/groupadd
27 Requires(pre): /usr/sbin/groupmod
28 Requires(pre): /usr/sbin/useradd
29 Requires(pre): /usr/sbin/usermod
31 Provides: group(pwrchute)
32 Provides: user(pwrchute)
33 ExclusiveArch: %{ix86}
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 This program allows users to safely shut down their system in response
38 to power failures and other power events. It also allows users to
39 configure and manage UPS models.
41 Please note that %{_libdir}/powerchute/Config.sh should be run in order
42 to configure PowerChute plus.
44 %description -l pl.UTF-8
45 Ten program pozwala użytkownikom bezpiecznie wyłączyć system w
46 przypadku awarii zasilania. Pozwala także na skonfigurowanie UPS.
48 Uwaga: aby skonfigurować PowerChute Plus należy uruchomić
49 /usr/lib/powerchute/Config.sh .
53 for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP; do
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/powerchute} \
61 $RPM_BUILD_ROOT/etc/rc.d/init.d \
62 $RPM_BUILD_ROOT%{_prefix}/X11R6/{bin,lib/X11/{app-defaults,uid}}
66 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsd
67 install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/X11R6/bin/xpowerchute
68 install %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/powerchute/Config.sh
69 install %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/powerchute/powerchute.ini_templ
70 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/powerchute.ini
72 ln -sf %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute
74 install _upsd $RPM_BUILD_ROOT%{_sbindir}/upsd
76 install _xpwrchute $RPM_BUILD_ROOT%{_libdir}/powerchute
77 install addpage.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
78 install apacheshut $RPM_BUILD_ROOT%{_libdir}/powerchute
79 install bkupsd $RPM_BUILD_ROOT%{_libdir}/powerchute
80 install dialpager.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
81 install killbk.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
82 install killpc.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
83 install machine_id $RPM_BUILD_ROOT%{_libdir}/powerchute
84 install mailer.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
85 install notifier.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
86 install pcshut.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
87 install portcheck $RPM_BUILD_ROOT%{_libdir}/powerchute
88 install ttycheck $RPM_BUILD_ROOT%{_libdir}/powerchute
89 install ups_adjust $RPM_BUILD_ROOT%{_libdir}/powerchute
90 install upsoff $RPM_BUILD_ROOT%{_libdir}/powerchute
91 install upswrite $RPM_BUILD_ROOT%{_libdir}/powerchute
92 install wall.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
93 install what_os.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
94 install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid
96 install pwrchute.ad $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/app-defaults/pwrchute
98 ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
99 ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
102 rm -rf $RPM_BUILD_ROOT
106 if [ -n "`/usr/bin/getgid pwrchute`" ] && [ "`/usr/bin/getgid pwrchute`" = 233 ]; then
107 /usr/sbin/groupmod -g 233 pwrchute
108 chgrp pwrchute %{_sysconfdir}/powerchute.ini
109 /usr/sbin/usermod -u 233 -g 233 pwrchute
111 %groupadd -g 233 pwrchute
112 %useradd -u 233 -g 233 -d /usr/share/empty -s /bin/false -c "PowerChute Plus" pwrchute
115 /sbin/chkconfig --add upsd
116 %service upsd restart "UPSd server"
117 cd %{_libdir}/powerchute
119 echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus"
120 echo "Remember to set the password for pwrchute account"
123 if [ "$1" = "0" ]; then
125 /sbin/chkconfig --del upsd
129 if [ "$1" = "0" ]; then
131 %groupremove pwrchute
135 %defattr(644,root,root,755)
136 %doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf
137 %attr(754,root,root) /etc/rc.d/init.d/upsd
138 %attr(640,root,pwrchute) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/powerchute.ini
139 %attr(755,root,root) %{_sbindir}/upsd
140 %dir %{_libdir}/powerchute
141 %attr(755,root,root) %{_libdir}/powerchute/Config.sh
142 %attr(755,root,root) %{_libdir}/powerchute/_xpwrchute
143 %attr(755,root,root) %{_libdir}/powerchute/addpage.sh
144 %attr(755,root,root) %{_libdir}/powerchute/apacheshut
145 %attr(755,root,root) %{_libdir}/powerchute/bkupsd
146 %attr(755,root,root) %{_libdir}/powerchute/dialpager.sh
147 %attr(755,root,root) %{_libdir}/powerchute/killbk.sh
148 %attr(755,root,root) %{_libdir}/powerchute/killpc.sh
149 %attr(755,root,root) %{_libdir}/powerchute/machine_id
150 %attr(755,root,root) %{_libdir}/powerchute/mailer.sh
151 %attr(755,root,root) %{_libdir}/powerchute/notifier.sh
152 %attr(755,root,root) %{_libdir}/powerchute/pcshut.sh
153 %attr(755,root,root) %{_libdir}/powerchute/portcheck
154 %attr(755,root,root) %{_libdir}/powerchute/ttycheck
155 %attr(755,root,root) %{_libdir}/powerchute/ups_adjust
156 %attr(755,root,root) %{_libdir}/powerchute/upsoff
157 %attr(755,root,root) %{_libdir}/powerchute/upswrite
158 %attr(755,root,root) %{_libdir}/powerchute/wall.sh
159 %attr(755,root,root) %{_libdir}/powerchute/what_os.sh
160 %{_libdir}/powerchute/powerchute.ini
161 %{_libdir}/powerchute/powerchute.ini_templ
162 %attr(755,root,root) %{_prefix}/X11R6/bin/xpowerchute
163 %{_prefix}/X11R6/lib/X11/app-defaults/*
164 %{_prefix}/X11R6/lib/X11/uid/*
165 %config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/upsd.pid
166 %config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/bkupsd.pid