]> git.pld-linux.org Git - packages/PowerChutePlus.git/blame_incremental - PowerChutePlus.spec
- user/groupmod in pre
[packages/PowerChutePlus.git] / PowerChutePlus.spec
... / ...
CommitLineData
1Summary: UPS management software for APC UPS models
2Summary(pl.UTF-8): Oprogramowanie do obsługi UPS-ów APC
3Name: PowerChutePlus
4Version: 4.5.3
5Release: 2
6License: (c) 1999 APC, inc.
7Group: Applications/System
8Source0: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pcplus_453_caldera.tar
9# Source0-md5: 5eb99efd5561694b9f692aa713bd974d
10Source1: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/453/pc453ug.pdf
11# Source1-md5: 0c2a621adcad8fdcb6064ed3cb042711
12Source2: upsd.init
13Source3: %{name}-xpowerchute.sh
14Source4: %{name}-Config.sh
15Source5: %{name}-powerchute.ini
16Source6: %{name}-powerchute.ini_templ
17Source7: ftp://ftp.apcc.com/apc/public/software/unix/linux/pcplus/settings.pdf
18# Source7-md5: c69abad141a836fd12ced0cc39049dc6
19Patch0: %{name}-fix-sh.patch
20BuildRequires: rpmbuild(macros) >= 1.268
21Requires(post,preun): /sbin/chkconfig
22Requires(postun): /usr/sbin/groupdel
23Requires(postun): /usr/sbin/userdel
24Requires(pre): /bin/id
25Requires(pre): /usr/bin/getgid
26Requires(pre): /usr/sbin/groupadd
27Requires(pre): /usr/sbin/groupmod
28Requires(pre): /usr/sbin/useradd
29Requires(pre): /usr/sbin/usermod
30Requires: rc-scripts
31Provides: group(pwrchute)
32Provides: user(pwrchute)
33ExclusiveArch: %{ix86}
34BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36%description
37This program allows users to safely shut down their system in response
38to power failures and other power events. It also allows users to
39configure and manage UPS models.
40
41Please note that %{_libdir}/powerchute/Config.sh should be run in order
42to configure PowerChute plus.
43
44%description -l pl.UTF-8
45Ten program pozwala użytkownikom bezpiecznie wyłączyć system w
46przypadku awarii zasilania. Pozwala także na skonfigurowanie UPS.
47
48Uwaga: aby skonfigurować PowerChute Plus należy uruchomić
49/usr/lib/powerchute/Config.sh .
50
51%prep
52%setup -q -c
53for i in BI_LINUX CI_LINUX COMMON FI_LINUX HELP; do
54 tar xf $i
55done
56%patch0 -p1
57
58%install
59rm -rf $RPM_BUILD_ROOT
60install -d $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/powerchute} \
61 $RPM_BUILD_ROOT/etc/rc.d/init.d \
62 $RPM_BUILD_ROOT%{_prefix}/X11R6/{bin,lib/X11/{app-defaults,uid}}
63
64install %{SOURCE1} .
65install %{SOURCE7} .
66install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/upsd
67install %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/X11R6/bin/xpowerchute
68install %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/powerchute/Config.sh
69install %{SOURCE6} $RPM_BUILD_ROOT%{_libdir}/powerchute/powerchute.ini_templ
70install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/powerchute.ini
71
72ln -sf %{_sysconfdir}/powerchute.ini $RPM_BUILD_ROOT%{_libdir}/powerchute
73
74install _upsd $RPM_BUILD_ROOT%{_sbindir}/upsd
75
76install _xpwrchute $RPM_BUILD_ROOT%{_libdir}/powerchute
77install addpage.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
78install apacheshut $RPM_BUILD_ROOT%{_libdir}/powerchute
79install bkupsd $RPM_BUILD_ROOT%{_libdir}/powerchute
80install dialpager.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
81install killbk.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
82install killpc.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
83install machine_id $RPM_BUILD_ROOT%{_libdir}/powerchute
84install mailer.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
85install notifier.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
86install pcshut.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
87install portcheck $RPM_BUILD_ROOT%{_libdir}/powerchute
88install ttycheck $RPM_BUILD_ROOT%{_libdir}/powerchute
89install ups_adjust $RPM_BUILD_ROOT%{_libdir}/powerchute
90install upsoff $RPM_BUILD_ROOT%{_libdir}/powerchute
91install upswrite $RPM_BUILD_ROOT%{_libdir}/powerchute
92install wall.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
93install what_os.sh $RPM_BUILD_ROOT%{_libdir}/powerchute
94install pwrchute.uid $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/uid
95
96install pwrchute.ad $RPM_BUILD_ROOT%{_prefix}/X11R6/lib/X11/app-defaults/pwrchute
97
98ln -sf /var/run/upsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
99ln -sf /var/run/bkupsd.pid $RPM_BUILD_ROOT%{_libdir}/powerchute
100
101%clean
102rm -rf $RPM_BUILD_ROOT
103
104%pre
105# move to trigger?
106if [ -n "`/usr/bin/getgid pwrchute`" ] && [ "`/usr/bin/getgid pwrchute`" = 233 ]; then
107 /usr/sbin/groupmod -g 233 pwrchute
108 chgrp pwrchute %{_sysconfdir}/powerchute.ini
109 /usr/sbin/usermod -u 233 -g 233 pwrchute
110fi
111%groupadd -g 233 pwrchute
112%useradd -u 233 -g 233 -d /usr/share/empty -s /bin/false -c "PowerChute Plus" pwrchute
113
114%post
115/sbin/chkconfig --add upsd
116%service upsd restart "UPSd server"
117cd %{_libdir}/powerchute
118./machine_id
119echo "You should run %{_libdir}/powerchute/Config.sh to configure PowerChute plus"
120echo "Remember to set the password for pwrchute account"
121
122%preun
123if [ "$1" = "0" ]; then
124 %service upsd stop
125 /sbin/chkconfig --del upsd
126fi
127
128%postun
129if [ "$1" = "0" ]; then
130 %userremove pwrchute
131 %groupremove pwrchute
132fi
133
134%files
135%defattr(644,root,root,755)
136%doc help/* apachesh.pdf language.txt readme_apache pc453ug.pdf settings.pdf
137%attr(754,root,root) /etc/rc.d/init.d/upsd
138%attr(640,root,pwrchute) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/powerchute.ini
139%attr(755,root,root) %{_sbindir}/upsd
140%dir %{_libdir}/powerchute
141%attr(755,root,root) %{_libdir}/powerchute/Config.sh
142%attr(755,root,root) %{_libdir}/powerchute/_xpwrchute
143%attr(755,root,root) %{_libdir}/powerchute/addpage.sh
144%attr(755,root,root) %{_libdir}/powerchute/apacheshut
145%attr(755,root,root) %{_libdir}/powerchute/bkupsd
146%attr(755,root,root) %{_libdir}/powerchute/dialpager.sh
147%attr(755,root,root) %{_libdir}/powerchute/killbk.sh
148%attr(755,root,root) %{_libdir}/powerchute/killpc.sh
149%attr(755,root,root) %{_libdir}/powerchute/machine_id
150%attr(755,root,root) %{_libdir}/powerchute/mailer.sh
151%attr(755,root,root) %{_libdir}/powerchute/notifier.sh
152%attr(755,root,root) %{_libdir}/powerchute/pcshut.sh
153%attr(755,root,root) %{_libdir}/powerchute/portcheck
154%attr(755,root,root) %{_libdir}/powerchute/ttycheck
155%attr(755,root,root) %{_libdir}/powerchute/ups_adjust
156%attr(755,root,root) %{_libdir}/powerchute/upsoff
157%attr(755,root,root) %{_libdir}/powerchute/upswrite
158%attr(755,root,root) %{_libdir}/powerchute/wall.sh
159%attr(755,root,root) %{_libdir}/powerchute/what_os.sh
160%{_libdir}/powerchute/powerchute.ini
161%{_libdir}/powerchute/powerchute.ini_templ
162%attr(755,root,root) %{_prefix}/X11R6/bin/xpowerchute
163%{_prefix}/X11R6/lib/X11/app-defaults/*
164%{_prefix}/X11R6/lib/X11/uid/*
165%config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/upsd.pid
166%config(noreplace) %verify(not md5 mtime size) %{_libdir}/powerchute/bkupsd.pid
This page took 0.02236 seconds and 4 git commands to generate.