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