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