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