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