]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
- fixed md5
[packages/apcupsd.git] / apcupsd.spec
1 # TODO: /usr/share/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi
2 #
3 # Conditional build:
4 %bcond_without  cgi     # without CGI program support
5 %bcond_without  gapcmon # without gapcmon GUI
6 %bcond_without  net     # without network support
7 %bcond_with     snmp    # with SNMP support
8 %bcond_without  test    # without TEST support
9 %bcond_without  usb     # without USB support
10 #
11 Summary:        Power management software for APC UPS hardware
12 Summary(pl.UTF-8):      Oprogramowanie do zarządzania energią dla UPS-ów APC
13 Name:           apcupsd
14 Version:        3.14.8
15 Release:        1
16 License:        GPL v2
17 Group:          Networking/Daemons
18 Source0:        http://dl.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
19 # Source0-md5:  cd17f0a903dc2220e55ed54e242359d2
20 Source1:        %{name}.init
21 Source2:        %{name}.logrotate
22 Source3:        %{name}.sysconfig
23 Patch0:         %{name}-configure.patch
24 Patch1:         %{name}-pcnet-seconds.patch
25 URL:            http://www.apcupsd.com/
26 %{?with_gapcmon:BuildRequires:  GConf2-devel >= 2.0}
27 BuildRequires:  autoconf
28 BuildRequires:  automake
29 BuildRequires:  gd-devel
30 %{?with_gapcmon:BuildRequires:  gtk+2-devel >= 2:2.4.0}
31 BuildRequires:  man
32 %{?with_snmp:BuildRequires:     net-snmp-devel}
33 BuildRequires:  pkgconfig
34 BuildRequires:  rpmbuild(macros) >= 1.268
35 BuildRequires:  util-linux-ng
36 Requires(post): fileutils
37 Requires(post,preun):   /sbin/chkconfig
38 Requires:       rc-scripts
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %define         _sysconfdir     /etc/apcupsd
42 %define         _cgidir         /home/services/httpd/cgi-bin
43
44 %description
45 UPS power management under Linux for APCC Products. It allows your
46 computer/server to run during power problems for a specified length of
47 time or the life of the batteries in your BackUPS, BackUPS Pro,
48 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
49 shutdown during an extended power failure.
50
51 %description -l pl.UTF-8
52 Oprogramowanie do zarządzania energią dla UPS-ów APC. Pozwala
53 komputerowi działać po awarii zasilania przez określony czas lub czas
54 życia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
55 odpowiednio uruchamia kontrolowany shutdown przy dłuższej awarii
56 zasilania.
57
58 %package cgi
59 Summary:        upsstats - Web-based UPS status viewer
60 Summary(pl.UTF-8):      upsstats - oparta na WWW przeglądarka stanu UPS-a
61 Group:          Applications/Networking
62 Requires:       webserver
63
64 %description cgi
65 upsstats.cgi builds a lightweight web page containing basic UPS status
66 information.
67
68 %description cgi -l pl.UTF-8
69 upsstats.cgi tworzy lekką stronę WWW zawierającą podstawowe informacje
70 o stanie UPS-a.
71
72 %package gapcmon
73 Summary:        Apcupsd GUI monitoring application
74 Summary(pl.UTF-8):      Aplikacja GUI monitorowania Apcupsd
75 Group:          X11/Applications
76
77 %description gapcmon
78 GNOME/GTK+ based application which integrates into most desktop panels
79 (not just GNOME). It monitors one or more Apcupsd instances using
80 Apcupsd's NIS networking server. The status of each UPS is shown with
81 a icon.
82
83 %description gapcmon -l pl.UTF-8
84 Oparta na GNOME/GTK+ aplikacja, która integruje się z panelami (nie
85 tylko Gnome). Monitoruje jedną bądź kilka instancji Apcupsd za pomocą
86 serwera NIS. Status każdego UPS-a przedstawia ikona.
87
88 %prep
89 %setup -q
90 %patch0 -p1
91 %patch1 -p1
92 for i in configure.in aclocal.m4 config.h.in; do install autoconf/$i .;done
93 cp -f %{_datadir}/automake/config.sub autoconf
94
95 %build
96 %{__autoconf}
97 %configure \
98         APCUPSD_MAIL="/bin/mail" \
99         SHUTDOWN="/sbin/shutdown" \
100         WALL="%{_bindir}/wall" \
101         --with-log-dir=%{_var}/log \
102         --with-stat-dir=%{_var}/lib/apcupsd \
103 %if %{with cgi}
104         --enable-cgi \
105         --with-cgi-bin=/home/services/httpd/cgi-bin \
106 %endif
107         %{?with_test:--enable-test} \
108 %if %{with net}
109         --enable-net \
110 %endif
111         %{?with_gapcmon:--enable-gapcmon} \
112         %{?with_snmp:--enable-snmp} \
113         %{?with_usb:--enable-usb}
114
115 %{__make}
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
120         $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
121
122 %{__make} install \
123         DESTDIR=$RPM_BUILD_ROOT
124
125 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
126 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
127 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
128
129 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
130 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
131
132 cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
133 #!/bin/sh
134 /etc/rc.d/init.d/apcupsd powerdown
135 EOF
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %post
141 /sbin/chkconfig --add apcupsd
142 %service apcupsd restart "apcupsd daemon"
143
144 %preun
145 if [ "$1" = "0" ]; then
146         %service apcupsd stop
147         /sbin/chkconfig --del apcupsd
148 fi
149
150 %files
151 %defattr(644,root,root,755)
152 %doc ChangeLog Developers
153 %attr(755,root,root) %{_sbindir}/apcaccess
154 %attr(755,root,root) %{_sbindir}/apctest
155 %attr(755,root,root) %{_sbindir}/apcupsd
156 %attr(755,root,root) %{_sbindir}/smtp
157 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
158 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
159 %attr(754,root,root) %{_sysconfdir}/apccontrol
160 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/changeme
161 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commfailure
162 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commok
163 #%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
164 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
165 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
166 %if %{with cgi}
167 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
168 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
169 %{_sysconfdir}/apcupsd.css
170 %endif
171 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
172 %attr(754,root,root) /etc/rc.d/init.d/halt
173 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
174 %dir %{_sysconfdir}
175 %dir /var/lib/apcupsd
176 %attr(640,root,root) %ghost /var/log/apcupsd.events
177 %attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
178 %{_mandir}/man*/*
179
180
181 %if %{with cgi}
182 %files cgi
183 %defattr(644,root,root,755)
184 %attr(755,root,root) %{_cgidir}/*.cgi
185 %endif
186
187 %if %{with gapcmon}
188 %files gapcmon
189 %defattr(644,root,root,755)
190 %attr(755,root,root) %{_bindir}/gapcmon
191 %{_desktopdir}/gapcmon.desktop
192 %{_pixmapsdir}/*.png
193 %endif
This page took 0.082158 seconds and 3 git commands to generate.