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