]> git.pld-linux.org Git - packages/PowerChutePlus.git/blob - PowerChutePlus.spec
- more specific Requires
[packages/PowerChutePlus.git] / PowerChutePlus.spec
1 Summary:        UPS management software for APC UPS models
2 Summary(pl):    Oprogramowanie do obs³ugi UPS-ów APC
3 Name:           PowerChutePlus
4 Version:        4.5.3
5 Release:        1
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
12 Source2:        upsd.init
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 PreReq:         rc-scripts
21 Requires(pre):  /usr/bin/getgid
22 Requires(pre):  /bin/id
23 Requires(pre):  /usr/sbin/groupadd
24 Requires(pre):  /usr/sbin/useradd
25 Requires(post,preun):   /sbin/chkconfig
26 Requires(postun):       /usr/sbin/userdel
27 Requires(postun):       /usr/sbin/groupdel
28 ExclusiveOS:    linux
29 ExclusiveArch:  %{ix86}
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 This program allows users to safely shut down their system in response
34 to power failures and other power events. It also allows users to
35 configure and manage UPS models.
36
37 Please note that /usr/lib/powerchute/Config.sh should be run in order
38 to configure PowerChute plus.
39
40 %description -l pl
41 Ten program pozwala u¿ytkownikom bezpiecznie wy³±czyæ system w
42 przypadku awarii zasilania. Pozwala tak¿e na skonfigurowanie UPS.
43
44 Uwaga: aby skonfigurowaæ PowerChute Plus nale¿y uruchomiæ
45 /usr/lib/powerchute/Config.sh .
46
47 %prep
48 %setup -q -c
49 for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP ; do
50         tar xf $i
51 done
52 %patch0 -p1
53
54 %build
55 # No build, binary package
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/powerchute} \
60         $RPM_BUILD_ROOT/etc/rc.d/init.d \
61         $RPM_BUILD_ROOT%{_prefix}/X11R6/{bin,lib/X11/{app-defaults,uid}}
62
63 install %{SOURCE1} .
64 install %{SOURCE7} .
65 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsd
66 install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/X11R6/bin/xpowerchute
67 install %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/powerchute/Config.sh
68 install %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/powerchute/powerchute.ini_templ
69 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/powerchute.ini
70
71 ln -sf %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute
72
73 install _upsd $RPM_BUILD_ROOT%{_sbindir}/upsd
74
75 install _xpwrchute $RPM_BUILD_ROOT%{_libdir}/powerchute
76 install addpage.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
77 install apacheshut $RPM_BUILD_ROOT%{_libdir}/powerchute
78 install bkupsd $RPM_BUILD_ROOT%{_libdir}/powerchute
79 install dialpager.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
80 install killbk.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
81 install killpc.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
82 install machine_id $RPM_BUILD_ROOT%{_libdir}/powerchute
83 install mailer.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
84 install notifier.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
85 install pcshut.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
86 install portcheck $RPM_BUILD_ROOT%{_libdir}/powerchute
87 install ttycheck $RPM_BUILD_ROOT%{_libdir}/powerchute
88 install ups_adjust $RPM_BUILD_ROOT%{_libdir}/powerchute
89 install upsoff $RPM_BUILD_ROOT%{_libdir}/powerchute
90 install upswrite $RPM_BUILD_ROOT%{_libdir}/powerchute
91 install wall.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
92 install what_os.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
93 install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid
94
95 install pwrchute.ad $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/app-defaults/pwrchute
96
97 ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
98 ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %pre
104 if [ -n "`getgid pwrchute`" ]; then
105         if [ "`getgid pwrchute`" != "68" ]; then
106                 echo "Error: group pwrchute doesn't have gid=68. Correct this before installing PowerChutePlus." 1>&2
107                 exit 1
108         fi
109 else
110         /usr/sbin/groupadd -g 68 pwrchute
111 fi
112 if [ -n "`id -u pwrchute 2>/dev/null`" ]; then
113         if [ "`id -u pwrchute`" != "68" ]; then
114                 echo "Error: user pwrchute doesn't have uid=68. Correct this before installing PowerChutePlus." 1>&2
115                 exit 1
116         fi
117 else
118         /usr/sbin/useradd -u 68 -g 68 -d /dev/null -s /bin/false -c "PowerChute Plus" pwrchute
119 fi
120
121 %post
122 /sbin/chkconfig --add upsd
123 if [ -f /var/lock/subsys/upsd ]; then
124         /etc/rc.d/init.d/upsd restart 1>&2
125 else
126         echo "Type \"/etc/rc.d/init.d/upsd start\" to start UPSd server" 1>&2
127 fi
128 cd %{_libdir}/powerchute
129 ./machine_id
130 echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus"
131 echo "Remember to set the password for pwrchute account"
132         
133 %preun
134 if [ "$1" = "0" ]; then
135         if [ -f /var/lock/subsys/upsd ]; then
136                 /etc/rc.d/init.d/upsd stop 1>&2
137         fi
138         /sbin/chkconfig --del upsd
139 fi
140
141 %postun
142 if [ "$1" = "0" ]; then
143         /usr/sbin/userdel pwrchute
144         /usr/sbin/groupdel pwrchute
145 fi
146
147 %files
148 %defattr(644,root,root,755)
149 %doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf
150 %attr(754,root,root) /etc/rc.d/init.d/upsd
151 %attr(640,root,pwrchute) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/powerchute.ini
152 %attr(755,root,root) %{_sbindir}/upsd
153 %attr(755,root,root) %{_libdir}/powerchute/Config.sh
154 %attr(755,root,root) %{_libdir}/powerchute/_xpwrchute
155 %attr(755,root,root) %{_libdir}/powerchute/addpage.sh
156 %attr(755,root,root) %{_libdir}/powerchute/apacheshut
157 %attr(755,root,root) %{_libdir}/powerchute/bkupsd
158 %attr(755,root,root) %{_libdir}/powerchute/dialpager.sh
159 %attr(755,root,root) %{_libdir}/powerchute/killbk.sh
160 %attr(755,root,root) %{_libdir}/powerchute/killpc.sh
161 %attr(755,root,root) %{_libdir}/powerchute/machine_id
162 %attr(755,root,root) %{_libdir}/powerchute/mailer.sh
163 %attr(755,root,root) %{_libdir}/powerchute/notifier.sh
164 %attr(755,root,root) %{_libdir}/powerchute/pcshut.sh
165 %attr(755,root,root) %{_libdir}/powerchute/portcheck
166 %attr(755,root,root) %{_libdir}/powerchute/ttycheck
167 %attr(755,root,root) %{_libdir}/powerchute/ups_adjust
168 %attr(755,root,root) %{_libdir}/powerchute/upsoff
169 %attr(755,root,root) %{_libdir}/powerchute/upswrite
170 %attr(755,root,root) %{_libdir}/powerchute/wall.sh
171 %attr(755,root,root) %{_libdir}/powerchute/what_os.sh
172 %{_libdir}/powerchute/powerchute.ini
173 %{_libdir}/powerchute/powerchute.ini_templ
174 %attr(755,root,root) %{_prefix}/X11R6/bin/xpowerchute
175 %{_prefix}/X11R6/lib/X11/app-defaults/*
176 %{_prefix}/X11R6/lib/X11/uid/*
177 %config(noreplace) %verify(not size mtime md5) %{_libdir}/powerchute/upsd.pid
178 %config(noreplace) %verify(not size mtime md5) %{_libdir}/powerchute/bkupsd.pid
This page took 0.063366 seconds and 4 git commands to generate.