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