]> git.pld-linux.org Git - packages/apcupsd.git/blob - apcupsd.spec
- don't use autoconf if you replace configure script anyway
[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.12.4
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:  669c833ec02a2bc29fa98f845e5f5de5
18 Source1:        %{name}.init
19 Source2:        %{name}.logrotate
20 Source3:        %{name}.sysconfig
21 Patch0:         %{name}-configure.patch
22 URL:            http://www.apcupsd.com/
23 %{?with_snmp:BuildRequires:     net-snmp-devel}
24 BuildRequires:  rpmbuild(macros) >= 1.268
25 Requires(post): fileutils
26 Requires(post,preun):   /sbin/chkconfig
27 Requires:       rc-scripts
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         _sysconfdir     /etc/apcupsd
31 %define         _cgidir         /home/services/httpd/cgi-bin
32
33 %description
34 UPS power management under Linux for APCC Products. It allows your
35 computer/server to run during power problems for a specified length of
36 time or the life of the batteries in your BackUPS, BackUPS Pro,
37 SmartUPS v/s, or SmartUPS, and then properly executes a controlled
38 shutdown during an extended power failure.
39
40 %description -l pl.UTF-8
41 Oprogramowanie do zarządzania energią dla UPS-ów APC. Pozwala
42 komputerowi działać po awarii zasilania przez określony czas lub czas
43 życia akumulatorów w BackUPS, BackUPS Pro, SmartUPS v/s, SmartUPS oraz
44 odpowiednio uruchamia kontrolowany shutdown przy dłuższej awarii
45 zasilania.
46
47 %package cgi 
48 Summary:        upsstats - Web-based UPS status viewer
49 Summary(pl.UTF-8):      upsstats - oparta na WWW przeglądarka stanu UPS-a
50 Group:          Applications/Networking
51 Requires:       webserver
52
53 %description cgi
54 upsstats.cgi builds a lightweight web page containing basic UPS status
55 information.
56
57 %description cgi -l pl.UTF-8
58 upsstats.cgi tworzy lekką stronę WWW zawierającą podstawowe informacje
59 o stanie UPS-a.
60
61 %prep
62 %setup -q
63 %patch0 -p1
64
65 %build
66 %configure \
67         --with-log-dir=%{_var}/log \
68         --with-stat-dir=%{_var}/lib/apcupsd \
69 %if %{with cgi}
70         --enable-cgi \
71         --with-cgi-bin=/home/services/httpd/cgi-bin \
72 %endif
73         %{?with_test:--enable-test} \
74 %if %{with net}
75         --enable-net \
76         --enable-master-slave \
77 %endif
78         %{?with_snmp:--enable-snmp} \
79         %{?with_usb:--enable-usb}
80
81 %{__make}
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85 install -d $RPM_BUILD_ROOT/etc/{apcupsd,logrotate.d,rc.d/init.d,sysconfig} \
86         $RPM_BUILD_ROOT/var/{log,lib/apcupsd}
87
88 %{__make} install \
89         DESTDIR=$RPM_BUILD_ROOT
90         
91 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
92 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
93 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
94
95 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
96 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
97
98 cat > $RPM_BUILD_ROOT/etc/rc.d/init.d/halt << EOF
99 #!/bin/sh
100 /etc/rc.d/init.d/apcupsd powerdown
101 EOF
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %post
107 /sbin/chkconfig --add apcupsd
108 %service apcupsd restart "apcupsd daemon"
109
110 %preun
111 if [ "$1" = "0" ]; then
112         %service apcupsd stop
113         /sbin/chkconfig --del apcupsd
114 fi
115
116 %files
117 %defattr(644,root,root,755)
118 %doc ChangeLog Developers
119 %attr(755,root,root) %{_sbindir}/*
120 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.conf
121 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/apcupsd
122 %attr(754,root,root) %{_sysconfdir}/apccontrol
123 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/changeme
124 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commfailure
125 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/commok
126 #%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
127 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/masterconnect
128 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mastertimeout
129 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
130 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
131 %if %{with cgi}
132 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
133 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
134 %{_sysconfdir}/apcupsd.css
135 %endif
136 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
137 %attr(754,root,root) /etc/rc.d/init.d/halt
138 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
139 %dir %{_sysconfdir}
140 %dir /var/lib/apcupsd
141 %attr(640,root,root) %ghost /var/log/apcupsd.events
142 %attr(640,root,root) %ghost /var/lib/apcupsd/apcupsd.status
143 %{_mandir}/man8/apcupsd.*
144
145 %files cgi
146 %defattr(644,root,root,755)
147 %attr(755,root,root) %{_cgidir}/*.cgi
This page took 0.086264 seconds and 4 git commands to generate.