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