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