/[packages]/cauldron/apcupsd/current/SPECS/apcupsd.spec
ViewVC logotype

Contents of /cauldron/apcupsd/current/SPECS/apcupsd.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1901612 - (show annotations) (download)
Wed Nov 2 14:11:09 2022 UTC (17 months, 3 weeks ago) by ghibo
File size: 3267 byte(s)
Add libusb to BR
1 %define _cgibin /var/www/cgi-bin
2 %define _sbindir /sbin
3
4 # A change in RPM 4.15 causes the make_build macro to misbuild this package.
5 # See https://github.com/rpm-software-management/rpm/issues/798
6 %global _make_verbose %nil
7
8 Summary: Power management software for APC UPS hardware
9 Name: apcupsd
10 Version: 3.14.14
11 Release: %mkrel 4
12 License: GPLv2
13 Group: System/Servers
14 URL: https://sourceforge.net/projects/apcupsd/
15 Source0: https://downloads.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
16 # From fedora
17 # fix crash in gui, rhbz#578276
18 Patch0: apcupsd-3.14.9-fixgui.patch
19 # Halt without powering off, rhbz#1442577
20 Patch1: apcupsd-3.14.4-shutdown.patch
21 # Fix format-security error so we can enable the checks
22 Patch2: apcupsd-format-security.patch
23 #
24 # from debian
25 Patch11: 06-fix-nologin.patch
26 Patch12: 08-fix-loglevels.patch
27 Patch14: 11-wall-on-umounted-usr.patch
28 Patch15: 13-spelling.patch
29 Patch16: 14-update-conf.patch
30
31 Requires(post): rpm-helper
32 Requires(preun):rpm-helper
33 Requires: tcp_wrappers
34 Requires: nail
35 BuildRequires: pkgconfig(gdlib)
36 BuildRequires: pkgconfig(libusb)
37 BuildRequires: pkgconfig(libusb-1.0)
38 BuildRequires: pkgconfig(ncurses)
39 BuildRequires: tcp_wrappers-devel
40 BuildRequires: libstdc++-devel
41
42 %description
43 UPS power management under Linux for APCC Products. It allows your
44 computer/server to run during power problems for a specified length of time or
45 the life of the batteries in your BackUPS, BackUPS Pro, SmartUPS v/s, or
46 SmartUPS, and then properly executes a controlled shutdown during an extended
47 power failure.
48
49 %prep
50 %autosetup -p1
51
52 # Override the provided platform makefile
53 printf 'install:\n\techo skipped\n' > platforms/redhat/Makefile
54
55 # fix attribs
56 find examples -type f | xargs chmod 644
57
58 %build
59 %serverbuild
60
61 export LC_CTYPE=en_US.UTF-8
62 %configure \
63 --sysconfdir=%{_sysconfdir}/apcupsd \
64 --enable-usb \
65 --enable-modbus-usb \
66 --enable-net \
67 --enable-master-slave \
68 --enable-pthreads \
69 --enable-cgi \
70 --with-cgi-bin=%{_cgibin} \
71 --with-serial-dev= \
72 --with-upstype=usb \
73 --with-halpolicydir="" \
74 --with-upscable=usb \
75 --with-lock-dir=/run/lock \
76 --with-nisip=127.0.0.1 \
77 --with-libwrap
78
79 %make_build
80
81 %install
82 install -d %{buildroot}%{_initrddir}
83 install -d %{buildroot}%{_cgibin}
84
85 %make_install
86 #cgibin=%{buildroot}%{_cgibin}
87
88 install -m0644 platforms/etc/apcupsd.conf %{buildroot}%{_sysconfdir}/apcupsd/
89 install -m0755 platforms/apccontrol %{buildroot}%{_sysconfdir}/apcupsd/
90 install -m0755 platforms/mandrake/apcupsd %{buildroot}%{_initrddir}/
91
92 for src in changeme commfailure commok onbattery offbattery; do
93 install -m0744 platforms/etc/$src %{buildroot}%{_sysconfdir}/apcupsd/$src
94 done
95
96 # cleanup
97 pushd doc/manual
98 rm -f *.rst publishdoc Makefile
99 popd
100
101 %post
102 %_post_service apcupsd
103
104 %preun
105 %_preun_service apcupsd
106
107 %files
108 %doc ChangeLog DISCLAIMER Developers ReleaseNotes examples doc/manual
109 %{_initrddir}/apcupsd
110 %dir %{_sysconfdir}/apcupsd
111 %config(noreplace) %{_sysconfdir}/apcupsd/*
112 %{_sbindir}/apcaccess
113 %{_sbindir}/apctest
114 %{_sbindir}/apcupsd
115 %{_sbindir}/smtp
116 %{_cgibin}/multimon.cgi
117 %{_cgibin}/upsfstats.cgi
118 %{_cgibin}/upsimage.cgi
119 %{_cgibin}/upsstats.cgi
120 %{_mandir}/man8/*
121 %{_mandir}/man5/apcupsd.conf.5*
122
123

  ViewVC Help
Powered by ViewVC 1.1.30