]> git.pld-linux.org Git - packages/PowerChutePlus.git/blame - PowerChutePlus.spec
- should groupmod if NOT equal, I think
[packages/PowerChutePlus.git] / PowerChutePlus.spec
CommitLineData
90089323 1Summary: UPS management software for APC UPS models
225f8890 2Summary(pl.UTF-8): Oprogramowanie do obsługi UPS-ów APC
90089323 3Name: PowerChutePlus
0c9aae5c 4Version: 4.5.3
3b1e2de7 5Release: 2
d94c6a9a 6License: (c) 1999 APC, inc.
651f8c08 7Group: Applications/System
0c9aae5c 8Source0: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pcplus_453_caldera.tar
2a790a2e 9# Source0-md5: 5eb99efd5561694b9f692aa713bd974d
0c9aae5c 10Source1: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pc453ug.pdf
2a790a2e 11# Source1-md5: 0c2a621adcad8fdcb6064ed3cb042711
90089323 12Source2: upsd.init
651f8c08 13Source3: %{name}-xpowerchute.sh
14Source4: %{name}-Config.sh
15Source5: %{name}-powerchute.ini
16Source6: %{name}-powerchute.ini_templ
0c9aae5c 17Source7: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/settings.pdf
2a790a2e 18# Source7-md5: c69abad141a836fd12ced0cc39049dc6
651f8c08 19Patch0: %{name}-fix-sh.patch
f1a01700 20BuildRequires: rpmbuild(macros) >= 1.268
a12d1a8b 21Requires(post,preun): /sbin/chkconfig
a12d1a8b 22Requires(postun): /usr/sbin/groupdel
049c5fe3 23Requires(postun): /usr/sbin/userdel
f1a01700
ER
24Requires(pre): /bin/id
25Requires(pre): /usr/bin/getgid
26Requires(pre): /usr/sbin/groupadd
6940bacc 27Requires(pre): /usr/sbin/groupmod
f1a01700 28Requires(pre): /usr/sbin/useradd
6940bacc 29Requires(pre): /usr/sbin/usermod
f1a01700 30Requires: rc-scripts
68101f62 31Provides: group(pwrchute)
32Provides: user(pwrchute)
90089323
JR
33ExclusiveArch: %{ix86}
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36%description
37This program allows users to safely shut down their system in response
38to power failures and other power events. It also allows users to
39configure and manage UPS models.
40
f1a01700 41Please note that %{_libdir}/powerchute/Config.sh should be run in order
90089323
JR
42to configure PowerChute plus.
43
200ad5a2
JR
44%description -l pl.UTF-8
45Ten program pozwala użytkownikom bezpiecznie wyłączyć system w
46przypadku awarii zasilania. Pozwala także na skonfigurowanie UPS.
58140a47 47
200ad5a2 48Uwaga: 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 53for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP; do
90089323
JR
54 tar xf $i
55done
56%patch0 -p1
57
90089323
JR
58%install
59rm -rf $RPM_BUILD_ROOT
60install -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
64install %{SOURCE1} .
0c9aae5c 65install %{SOURCE7} .
90089323 66install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsd
651f8c08 67install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/X11R6/bin/xpowerchute
90089323
JR
68install %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/powerchute/Config.sh
69install %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/powerchute/powerchute.ini_templ
651f8c08 70install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/powerchute.ini
90089323 71
a12d1a8b 72ln -sf %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute
90089323
JR
73
74install _upsd $RPM_BUILD_ROOT%{_sbindir}/upsd
75
76install _xpwrchute $RPM_BUILD_ROOT%{_libdir}/powerchute
77install addpage.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
78install apacheshut $RPM_BUILD_ROOT%{_libdir}/powerchute
79install bkupsd $RPM_BUILD_ROOT%{_libdir}/powerchute
80install dialpager.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
81install killbk.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
82install killpc.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
83install machine_id $RPM_BUILD_ROOT%{_libdir}/powerchute
84install mailer.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
85install notifier.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
86install pcshut.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
87install portcheck $RPM_BUILD_ROOT%{_libdir}/powerchute
88install ttycheck $RPM_BUILD_ROOT%{_libdir}/powerchute
89install ups_adjust $RPM_BUILD_ROOT%{_libdir}/powerchute
90install upsoff $RPM_BUILD_ROOT%{_libdir}/powerchute
91install upswrite $RPM_BUILD_ROOT%{_libdir}/powerchute
92install wall.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
93install what_os.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
a12d1a8b 94install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid
90089323 95
651f8c08 96install pwrchute.ad $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/app-defaults/pwrchute
90089323 97
a12d1a8b
JB
98ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
99ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
90089323 100
b550403b
JB
101%clean
102rm -rf $RPM_BUILD_ROOT
103
90089323 104%pre
6940bacc 105# move to trigger?
8cac2121 106if [ -n "`/usr/bin/getgid pwrchute 2>/dev/null`" ] && [ "`/usr/bin/getgid pwrchute`" != 233 ]; then
6940bacc
JR
107 /usr/sbin/groupmod -g 233 pwrchute
108 chgrp pwrchute %{_sysconfdir}/powerchute.ini
109 /usr/sbin/usermod -u 233 -g 233 pwrchute
110fi
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
117cd %{_libdir}/powerchute
118./machine_id
119echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus"
120echo "Remember to set the password for pwrchute account"
ad3a485b 121
90089323 122%preun
dbf0ce20 123if [ "$1" = "0" ]; then
f1a01700 124 %service upsd stop
dbf0ce20 125 /sbin/chkconfig --del upsd
126fi
90089323
JR
127
128%postun
dbf0ce20 129if [ "$1" = "0" ]; then
68101f62 130 %userremove pwrchute
131 %groupremove pwrchute
dbf0ce20 132fi
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
This page took 0.06383 seconds and 4 git commands to generate.