/[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 2057245 - (show annotations) (download)
Sun Apr 14 05:59:29 2024 UTC (6 weeks, 1 day ago) by daviddavid
File size: 3940 byte(s)
- switch to systemd unit from initscripts

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 5
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 Source1: apcupsd.service
17 Source2: apcupsd-tmpfiles.conf
18 Source3: apcupsd-httpd.conf
19 Source4: apcupsd.logrotate
20 # From fedora
21 # fix crash in gui, rhbz#578276
22 Patch0: apcupsd-3.14.9-fixgui.patch
23 # Halt without powering off, rhbz#1442577
24 Patch1: apcupsd-3.14.4-shutdown.patch
25 # Fix format-security error so we can enable the checks
26 Patch2: apcupsd-format-security.patch
27 #
28 # from debian
29 Patch11: 06-fix-nologin.patch
30 Patch12: 08-fix-loglevels.patch
31 Patch14: 11-wall-on-umounted-usr.patch
32 Patch15: 13-spelling.patch
33 Patch16: 14-update-conf.patch
34
35 Requires(post): rpm-helper
36 Requires(preun):rpm-helper
37 Requires: tcp_wrappers
38 Requires: nail
39 BuildRequires: pkgconfig(gdlib)
40 BuildRequires: pkgconfig(libusb)
41 BuildRequires: pkgconfig(libusb-1.0)
42 BuildRequires: pkgconfig(netsnmp)
43 BuildRequires: pkgconfig(ncurses)
44 BuildRequires: tcp_wrappers-devel
45 BuildRequires: libstdc++-devel
46 BuildRequires: systemd
47
48 %description
49 UPS power management under Linux for APCC Products. It allows your
50 computer/server to run during power problems for a specified length of time or
51 the life of the batteries in your BackUPS, BackUPS Pro, SmartUPS v/s, or
52 SmartUPS, and then properly executes a controlled shutdown during an extended
53 power failure.
54
55 %prep
56 %autosetup -p1
57
58 # Override the provided platform makefile
59 printf 'install:\n\techo skipped\n' > platforms/mandrake/Makefile
60
61 # fix attribs
62 find examples -type f | xargs chmod 644
63
64 %build
65 export LC_CTYPE=en_US.UTF-8
66 %configure \
67 --sysconfdir=%{_sysconfdir}/apcupsd \
68 --enable-usb \
69 --enable-modbus-usb \
70 --enable-net \
71 --enable-cgi \
72 --enable-apcsmart \
73 --enable-dumb \
74 --enable-pcnet \
75 --enable-snmp \
76 --with-cgi-bin=%{_cgibin} \
77 --with-serial-dev= \
78 --with-upstype=usb \
79 --with-halpolicydir="" \
80 --with-upscable=usb \
81 --with-lock-dir=/run/lock \
82 --with-nisip=127.0.0.1 \
83 --with-pid-dir=%{_rundir} \
84 --with-libwrap
85
86 %make_build V=
87
88 %install
89 install -d %{buildroot}%{_cgibin}
90
91 %make_install
92 #cgibin=%%{buildroot}%%{_cgibin}
93
94 install -p -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/apcupsd.service
95 install -p -D -m0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf
96 install -p -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/httpd/conf.d/apcupsd.conf
97 install -p -D -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/apcupsd
98 install -m0644 platforms/etc/apcupsd.conf %{buildroot}%{_sysconfdir}/apcupsd/
99 install -m0755 platforms/apccontrol %{buildroot}%{_sysconfdir}/apcupsd/
100
101 for src in changeme commfailure commok onbattery offbattery; do
102 install -m0744 platforms/etc/$src %{buildroot}%{_sysconfdir}/apcupsd/$src
103 done
104
105 # cleanup
106 pushd doc/manual
107 rm -f *.rst publishdoc Makefile
108 popd
109
110 %post
111 %_tmpfilescreate %{name}
112 %_post_service apcupsd
113
114 %preun
115 %_preun_service apcupsd
116
117 %files
118 %license COPYING
119 %doc ChangeLog DISCLAIMER Developers ReleaseNotes examples doc/manual
120 %{_unitdir}/apcupsd.service
121 %dir %ghost %attr(0755, root, root) %{_rundir}/apcupsd
122 %{_tmpfilesdir}/%{name}.conf
123 %dir %{_sysconfdir}/apcupsd
124 %config(noreplace) %{_sysconfdir}/apcupsd/*
125 %config(noreplace) %{_sysconfdir}/logrotate.d/apcupsd
126 %config(noreplace) %{_sysconfdir}/httpd/conf.d/apcupsd.conf
127 %{_sbindir}/apcaccess
128 %{_sbindir}/apctest
129 %{_sbindir}/apcupsd
130 %{_sbindir}/smtp
131 %{_cgibin}/multimon.cgi
132 %{_cgibin}/upsfstats.cgi
133 %{_cgibin}/upsimage.cgi
134 %{_cgibin}/upsstats.cgi
135 %{_mandir}/man8/*
136 %{_mandir}/man5/apcupsd.conf.5*

  ViewVC Help
Powered by ViewVC 1.1.30