]>
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 | |
27 | Requires(pre): /usr/sbin/useradd | |
28 | Requires: rc-scripts | |
68101f62 | 29 | Provides: group(pwrchute) |
30 | Provides: user(pwrchute) | |
90089323 JR |
31 | ExclusiveArch: %{ix86} |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | This program allows users to safely shut down their system in response | |
36 | to power failures and other power events. It also allows users to | |
37 | configure and manage UPS models. | |
38 | ||
f1a01700 | 39 | Please note that %{_libdir}/powerchute/Config.sh should be run in order |
90089323 JR |
40 | to configure PowerChute plus. |
41 | ||
200ad5a2 JR |
42 | %description -l pl.UTF-8 |
43 | Ten program pozwala użytkownikom bezpiecznie wyłączyć system w | |
44 | przypadku awarii zasilania. Pozwala także na skonfigurowanie UPS. | |
58140a47 | 45 | |
200ad5a2 | 46 | Uwaga: aby skonfigurować PowerChute Plus należy uruchomić |
58140a47 JB |
47 | /usr/lib/powerchute/Config.sh . |
48 | ||
90089323 JR |
49 | %prep |
50 | %setup -q -c | |
f1a01700 | 51 | for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP; do |
90089323 JR |
52 | tar xf $i |
53 | done | |
54 | %patch0 -p1 | |
55 | ||
90089323 JR |
56 | %install |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/powerchute} \ | |
59 | $RPM_BUILD_ROOT/etc/rc.d/init.d \ | |
58140a47 | 60 | $RPM_BUILD_ROOT%{_prefix}/X11R6/{bin,lib/X11/{app-defaults,uid}} |
90089323 JR |
61 | |
62 | install %{SOURCE1} . | |
0c9aae5c | 63 | install %{SOURCE7} . |
90089323 | 64 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsd |
651f8c08 | 65 | install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/X11R6/bin/xpowerchute |
90089323 JR |
66 | install %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/powerchute/Config.sh |
67 | install %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/powerchute/powerchute.ini_templ | |
651f8c08 | 68 | install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/powerchute.ini |
90089323 | 69 | |
a12d1a8b | 70 | ln -sf %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute |
90089323 JR |
71 | |
72 | install _upsd $RPM_BUILD_ROOT%{_sbindir}/upsd | |
73 | ||
74 | install _xpwrchute $RPM_BUILD_ROOT%{_libdir}/powerchute | |
75 | install addpage.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
76 | install apacheshut $RPM_BUILD_ROOT%{_libdir}/powerchute | |
77 | install bkupsd $RPM_BUILD_ROOT%{_libdir}/powerchute | |
78 | install dialpager.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
79 | install killbk.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
80 | install killpc.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
81 | install machine_id $RPM_BUILD_ROOT%{_libdir}/powerchute | |
82 | install mailer.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
83 | install notifier.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
84 | install pcshut.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
85 | install portcheck $RPM_BUILD_ROOT%{_libdir}/powerchute | |
86 | install ttycheck $RPM_BUILD_ROOT%{_libdir}/powerchute | |
87 | install ups_adjust $RPM_BUILD_ROOT%{_libdir}/powerchute | |
88 | install upsoff $RPM_BUILD_ROOT%{_libdir}/powerchute | |
89 | install upswrite $RPM_BUILD_ROOT%{_libdir}/powerchute | |
90 | install wall.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
91 | install what_os.sh $RPM_BUILD_ROOT%{_libdir}/powerchute | |
a12d1a8b | 92 | install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid |
90089323 | 93 | |
651f8c08 | 94 | install pwrchute.ad $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/app-defaults/pwrchute |
90089323 | 95 | |
a12d1a8b JB |
96 | ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute |
97 | ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute | |
90089323 | 98 | |
b550403b JB |
99 | %clean |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
90089323 | 102 | %pre |
3b1e2de7 JR |
103 | %groupadd -g 233 pwrchute |
104 | %useradd -u 233 -g 233 -d /usr/share/empty -s /bin/false -c "PowerChute Plus" pwrchute | |
90089323 JR |
105 | |
106 | %post | |
dbf0ce20 | 107 | /sbin/chkconfig --add upsd |
f1a01700 | 108 | %service upsd restart "UPSd server" |
90089323 JR |
109 | cd %{_libdir}/powerchute |
110 | ./machine_id | |
111 | echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus" | |
112 | echo "Remember to set the password for pwrchute account" | |
ad3a485b | 113 | |
90089323 | 114 | %preun |
dbf0ce20 | 115 | if [ "$1" = "0" ]; then |
f1a01700 | 116 | %service upsd stop |
dbf0ce20 | 117 | /sbin/chkconfig --del upsd |
118 | fi | |
90089323 JR |
119 | |
120 | %postun | |
dbf0ce20 | 121 | if [ "$1" = "0" ]; then |
68101f62 | 122 | %userremove pwrchute |
123 | %groupremove pwrchute | |
dbf0ce20 | 124 | fi |
90089323 | 125 | |
90089323 JR |
126 | %files |
127 | %defattr(644,root,root,755) | |
a12d1a8b | 128 | %doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf |
90089323 | 129 | %attr(754,root,root) /etc/rc.d/init.d/upsd |
9280cc28 | 130 | %attr(640,root,pwrchute) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/powerchute.ini |
90089323 | 131 | %attr(755,root,root) %{_sbindir}/upsd |
627687b4 | 132 | %dir %{_libdir}/powerchute |
90089323 JR |
133 | %attr(755,root,root) %{_libdir}/powerchute/Config.sh |
134 | %attr(755,root,root) %{_libdir}/powerchute/_xpwrchute | |
135 | %attr(755,root,root) %{_libdir}/powerchute/addpage.sh | |
136 | %attr(755,root,root) %{_libdir}/powerchute/apacheshut | |
137 | %attr(755,root,root) %{_libdir}/powerchute/bkupsd | |
138 | %attr(755,root,root) %{_libdir}/powerchute/dialpager.sh | |
139 | %attr(755,root,root) %{_libdir}/powerchute/killbk.sh | |
140 | %attr(755,root,root) %{_libdir}/powerchute/killpc.sh | |
141 | %attr(755,root,root) %{_libdir}/powerchute/machine_id | |
142 | %attr(755,root,root) %{_libdir}/powerchute/mailer.sh | |
143 | %attr(755,root,root) %{_libdir}/powerchute/notifier.sh | |
144 | %attr(755,root,root) %{_libdir}/powerchute/pcshut.sh | |
145 | %attr(755,root,root) %{_libdir}/powerchute/portcheck | |
146 | %attr(755,root,root) %{_libdir}/powerchute/ttycheck | |
147 | %attr(755,root,root) %{_libdir}/powerchute/ups_adjust | |
148 | %attr(755,root,root) %{_libdir}/powerchute/upsoff | |
149 | %attr(755,root,root) %{_libdir}/powerchute/upswrite | |
150 | %attr(755,root,root) %{_libdir}/powerchute/wall.sh | |
151 | %attr(755,root,root) %{_libdir}/powerchute/what_os.sh | |
152 | %{_libdir}/powerchute/powerchute.ini | |
153 | %{_libdir}/powerchute/powerchute.ini_templ | |
651f8c08 | 154 | %attr(755,root,root) %{_prefix}/X11R6/bin/xpowerchute |
155 | %{_prefix}/X11R6/lib/X11/app-defaults/* | |
156 | %{_prefix}/X11R6/lib/X11/uid/* | |
9280cc28 ER |
157 | %config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/upsd.pid |
158 | %config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/bkupsd.pid |