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