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