1 |
%define _cgibin /var/www/cgi-bin |
2 |
%define _sbindir /sbin |
3 |
|
4 |
Summary: Power management software for APC UPS hardware |
5 |
Name: apcupsd |
6 |
Version: 3.14.10 |
7 |
Release: %mkrel 7 |
8 |
License: GPLv2 |
9 |
Group: System/Servers |
10 |
URL: http://sourceforge.net/projects/apcupsd/ |
11 |
Source0: http://mesh.dl.sourceforge.net/sourceforge/apcupsd/%{name}-%{version}.tar.gz |
12 |
Patch1: apcupsd-3.10.16-staleusb.patch |
13 |
Patch2: apcupsd-3.14.4-mdv_conf.diff |
14 |
Patch3: apcupsd-3.14.10-link.patch |
15 |
Patch4: apcupsd-3.14.10-lockdir.patch |
16 |
Requires(post): rpm-helper |
17 |
Requires(preun):rpm-helper |
18 |
Requires: tcp_wrappers |
19 |
Requires: nail |
20 |
BuildRequires: gd-devel |
21 |
BuildRequires: ncurses-devel |
22 |
BuildRequires: tcp_wrappers-devel |
23 |
BuildRequires: libstdc++-devel |
24 |
|
25 |
%description |
26 |
UPS power management under Linux for APCC Products. It allows your |
27 |
computer/server to run during power problems for a specified length of time or |
28 |
the life of the batteries in your BackUPS, BackUPS Pro, SmartUPS v/s, or |
29 |
SmartUPS, and then properly executes a controlled shutdown during an extended |
30 |
power failure. |
31 |
|
32 |
%prep |
33 |
|
34 |
%setup -q |
35 |
%patch1 -p1 -b .usbstale |
36 |
%patch2 -p0 -b .mdv_conf |
37 |
%patch3 -p0 -b .link |
38 |
%patch4 -p1 -b .lock |
39 |
|
40 |
# fix attribs |
41 |
find examples -type f | xargs chmod 644 |
42 |
|
43 |
%build |
44 |
%serverbuild |
45 |
|
46 |
%configure2_5x \ |
47 |
--sysconfdir=%{_sysconfdir}/apcupsd \ |
48 |
--enable-usb \ |
49 |
--enable-net \ |
50 |
--enable-master-slave \ |
51 |
--enable-pthreads \ |
52 |
--enable-cgi \ |
53 |
--with-cgi-bin=%{_cgibin} \ |
54 |
--with-serial-dev= \ |
55 |
--with-upstype=usb \ |
56 |
--with-upscable=usb \ |
57 |
--with-nisip=127.0.0.1 \ |
58 |
--with-libwrap |
59 |
|
60 |
%make VERBOSE=1 |
61 |
|
62 |
%install |
63 |
rm -rf %{buildroot} |
64 |
|
65 |
install -d %{buildroot}%{_initrddir} |
66 |
install -d %{buildroot}%{_cgibin} |
67 |
|
68 |
%makeinstall_std |
69 |
#cgibin=%{buildroot}%{_cgibin} |
70 |
|
71 |
install -m0644 platforms/etc/apcupsd.conf %{buildroot}%{_sysconfdir}/apcupsd/ |
72 |
install -m0755 platforms/apccontrol %{buildroot}%{_sysconfdir}/apcupsd/ |
73 |
install -m0755 platforms/mandrake/apcupsd %{buildroot}%{_initrddir}/ |
74 |
|
75 |
for src in changeme commfailure commok onbattery offbattery; do |
76 |
install -m0744 platforms/etc/$src %{buildroot}%{_sysconfdir}/apcupsd/$src |
77 |
done |
78 |
|
79 |
# cleanup |
80 |
pushd doc/manual |
81 |
rm -f *.rst publishdoc Makefile |
82 |
popd |
83 |
|
84 |
%post |
85 |
%_post_service apcupsd |
86 |
|
87 |
%preun |
88 |
%_preun_service apcupsd |
89 |
|
90 |
%clean |
91 |
rm -rf %{buildroot} |
92 |
|
93 |
%files |
94 |
%defattr(-,root,root) |
95 |
%doc ChangeLog DISCLAIMER Developers ReleaseNotes examples doc/manual |
96 |
%{_initrddir}/apcupsd |
97 |
%dir %{_sysconfdir}/apcupsd |
98 |
%config(noreplace) %{_sysconfdir}/apcupsd/* |
99 |
%{_sbindir}/apcaccess |
100 |
%{_sbindir}/apctest |
101 |
%{_sbindir}/apcupsd |
102 |
%{_sbindir}/smtp |
103 |
%{_cgibin}/multimon.cgi |
104 |
%{_cgibin}/upsfstats.cgi |
105 |
%{_cgibin}/upsimage.cgi |
106 |
%{_cgibin}/upsstats.cgi |
107 |
%{_mandir}/man8/* |
108 |
%{_mandir}/man5/apcupsd.conf.5* |
109 |
|
110 |
|