]>
Commit | Line | Data |
---|---|---|
90089323 | 1 | Summary: UPS management software for APC UPS models |
225f8890 | 2 | Summary(pl.UTF-8): Oprogramowanie do obsługi UPS-ów APC |
90089323 | 3 | Name: PowerChutePlus |
0c9aae5c | 4 | Version: 4.5.3 |
3b1e2de7 | 5 | Release: 2 |
d94c6a9a | 6 | License: (c) 1999 APC, inc. |
651f8c08 | 7 | Group: Applications/System |
0c9aae5c | 8 | Source0: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pcplus_453_caldera.tar |
2a790a2e | 9 | # Source0-md5: 5eb99efd5561694b9f692aa713bd974d |
0c9aae5c | 10 | Source1: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pc453ug.pdf |
2a790a2e | 11 | # Source1-md5: 0c2a621adcad8fdcb6064ed3cb042711 |
90089323 | 12 | Source2: upsd.init |
651f8c08 | 13 | Source3: %{name}-xpowerchute.sh |
14 | Source4: %{name}-Config.sh | |
15 | Source5: %{name}-powerchute.ini | |
16 | Source6: %{name}-powerchute.ini_templ | |
0c9aae5c | 17 | Source7: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/settings.pdf |
2a790a2e | 18 | # Source7-md5: c69abad141a836fd12ced0cc39049dc6 |
651f8c08 | 19 | Patch0: %{name}-fix-sh.patch |
f1a01700 | 20 | BuildRequires: rpmbuild(macros) >= 1.268 |
a12d1a8b | 21 | Requires(post,preun): /sbin/chkconfig |
a12d1a8b | 22 | Requires(postun): /usr/sbin/groupdel |
049c5fe3 | 23 | Requires(postun): /usr/sbin/userdel |
f1a01700 ER |
24 | Requires(pre): /bin/id |
25 | Requires(pre): /usr/bin/getgid | |
26 | Requires(pre): /usr/sbin/groupadd | |
6940bacc | 27 | Requires(pre): /usr/sbin/groupmod |
f1a01700 | 28 | Requires(pre): /usr/sbin/useradd |
6940bacc | 29 | Requires(pre): /usr/sbin/usermod |
f1a01700 | 30 | Requires: rc-scripts |
68101f62 | 31 | Provides: group(pwrchute) |
32 | Provides: user(pwrchute) | |
90089323 JR |
33 | ExclusiveArch: %{ix86} |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
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. | |
40 | ||
f1a01700 | 41 | Please note that %{_libdir}/powerchute/Config.sh should be run in order |
90089323 JR |
42 | to configure PowerChute plus. |
43 | ||
200ad5a2 JR |
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. | |
58140a47 | 47 | |
200ad5a2 | 48 | Uwaga: aby skonfigurować PowerChute Plus należy uruchomić |
58140a47 JB |
49 | /usr/lib/powerchute/Config.sh . |
50 | ||
90089323 JR |
51 | %prep |
52 | %setup -q -c | |
f1a01700 | 53 | for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP; do |
90089323 JR |
54 | tar xf $i |
55 | done | |
56 | %patch0 -p1 | |
57 | ||
90089323 JR |
58 | %install |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/powerchute} \ | |
61 | $RPM_BUILD_ROOT/etc/rc.d/init.d \ | |
58140a47 | 62 | $RPM_BUILD_ROOT%{_prefix}/X11R6/{bin,lib/X11/{app-defaults,uid}} |
90089323 JR |
63 | |
64 | install %{SOURCE1} . | |
0c9aae5c | 65 | install %{SOURCE7} . |
90089323 | 66 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsd |
651f8c08 | 67 | install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/X11R6/bin/xpowerchute |
90089323 JR |
68 | install %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/powerchute/Config.sh |
69 | install %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/powerchute/powerchute.ini_templ | |
651f8c08 | 70 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/powerchute.ini |
90089323 | 71 | |
a12d1a8b | 72 | ln -sf %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute |
90089323 JR |
73 | |
74 | install _upsd $RPM_BUILD_ROOT%{_sbindir}/upsd | |
75 | ||
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 | |
a12d1a8b | 94 | install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid |
90089323 | 95 | |
651f8c08 | 96 | install pwrchute.ad $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/app-defaults/pwrchute |
90089323 | 97 | |
a12d1a8b JB |
98 | ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute |
99 | ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute | |
90089323 | 100 | |
b550403b JB |
101 | %clean |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
90089323 | 104 | %pre |
6940bacc JR |
105 | # move to trigger? |
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 | |
110 | fi | |
3b1e2de7 JR |
111 | %groupadd -g 233 pwrchute |
112 | %useradd -u 233 -g 233 -d /usr/share/empty -s /bin/false -c "PowerChute Plus" pwrchute | |
90089323 JR |
113 | |
114 | %post | |
dbf0ce20 | 115 | /sbin/chkconfig --add upsd |
f1a01700 | 116 | %service upsd restart "UPSd server" |
90089323 JR |
117 | cd %{_libdir}/powerchute |
118 | ./machine_id | |
119 | echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus" | |
120 | echo "Remember to set the password for pwrchute account" | |
ad3a485b | 121 | |
90089323 | 122 | %preun |
dbf0ce20 | 123 | if [ "$1" = "0" ]; then |
f1a01700 | 124 | %service upsd stop |
dbf0ce20 | 125 | /sbin/chkconfig --del upsd |
126 | fi | |
90089323 JR |
127 | |
128 | %postun | |
dbf0ce20 | 129 | if [ "$1" = "0" ]; then |
68101f62 | 130 | %userremove pwrchute |
131 | %groupremove pwrchute | |
dbf0ce20 | 132 | fi |
90089323 | 133 | |
90089323 JR |
134 | %files |
135 | %defattr(644,root,root,755) | |
a12d1a8b | 136 | %doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf |
90089323 | 137 | %attr(754,root,root) /etc/rc.d/init.d/upsd |
9280cc28 | 138 | %attr(640,root,pwrchute) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/powerchute.ini |
90089323 | 139 | %attr(755,root,root) %{_sbindir}/upsd |
627687b4 | 140 | %dir %{_libdir}/powerchute |
90089323 JR |
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 | |
651f8c08 | 162 | %attr(755,root,root) %{_prefix}/X11R6/bin/xpowerchute |
163 | %{_prefix}/X11R6/lib/X11/app-defaults/* | |
164 | %{_prefix}/X11R6/lib/X11/uid/* | |
9280cc28 ER |
165 | %config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/upsd.pid |
166 | %config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/bkupsd.pid |