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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2057245 - (hide annotations) (download)
Sun Apr 14 05:59:29 2024 UTC (9 days, 19 hours ago) by daviddavid
File size: 3940 byte(s)
- switch to systemd unit from initscripts

1 mikala 99236 %define _cgibin /var/www/cgi-bin
2     %define _sbindir /sbin
3    
4 ghibo 1901609 # 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 mikala 99236 Summary: Power management software for APC UPS hardware
9     Name: apcupsd
10 luigiwalser 1020628 Version: 3.14.14
11 daviddavid 2057245 Release: %mkrel 5
12 mikala 99236 License: GPLv2
13     Group: System/Servers
14 danf 1563260 URL: https://sourceforge.net/projects/apcupsd/
15 danf 1786211 Source0: https://downloads.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
16 daviddavid 2057245 Source1: apcupsd.service
17     Source2: apcupsd-tmpfiles.conf
18     Source3: apcupsd-httpd.conf
19     Source4: apcupsd.logrotate
20 ghibo 1901609 # 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 mikala 99236 Requires(post): rpm-helper
36     Requires(preun):rpm-helper
37     Requires: tcp_wrappers
38     Requires: nail
39 ovitters 1143957 BuildRequires: pkgconfig(gdlib)
40 ghibo 1901612 BuildRequires: pkgconfig(libusb)
41 ghibo 1901610 BuildRequires: pkgconfig(libusb-1.0)
42 daviddavid 2057245 BuildRequires: pkgconfig(netsnmp)
43 ovitters 1143957 BuildRequires: pkgconfig(ncurses)
44 mikala 99236 BuildRequires: tcp_wrappers-devel
45 luigiwalser 202316 BuildRequires: libstdc++-devel
46 daviddavid 2057245 BuildRequires: systemd
47 mikala 99236
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 ghibo 1901609 %autosetup -p1
57 mikala 99236
58 ghibo 1901609 # Override the provided platform makefile
59 daviddavid 2057245 printf 'install:\n\techo skipped\n' > platforms/mandrake/Makefile
60 ghibo 1901609
61 mikala 99236 # fix attribs
62     find examples -type f | xargs chmod 644
63    
64     %build
65 luigiwalser 1020628 export LC_CTYPE=en_US.UTF-8
66 wally 1478303 %configure \
67 mikala 99236 --sysconfdir=%{_sysconfdir}/apcupsd \
68     --enable-usb \
69 ghibo 1901609 --enable-modbus-usb \
70 mikala 99236 --enable-net \
71     --enable-cgi \
72 daviddavid 2057245 --enable-apcsmart \
73     --enable-dumb \
74     --enable-pcnet \
75     --enable-snmp \
76 mikala 99236 --with-cgi-bin=%{_cgibin} \
77     --with-serial-dev= \
78     --with-upstype=usb \
79 luigiwalser 670323 --with-halpolicydir="" \
80 mikala 99236 --with-upscable=usb \
81 luigiwalser 670323 --with-lock-dir=/run/lock \
82 mikala 99236 --with-nisip=127.0.0.1 \
83 daviddavid 2057245 --with-pid-dir=%{_rundir} \
84 mikala 99236 --with-libwrap
85    
86 daviddavid 2057245 %make_build V=
87 mikala 99236
88     %install
89     install -d %{buildroot}%{_cgibin}
90    
91 wally 1470885 %make_install
92 daviddavid 2057245 #cgibin=%%{buildroot}%%{_cgibin}
93 mikala 99236
94 daviddavid 2057245 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 mikala 99236 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 daviddavid 2057245 %_tmpfilescreate %{name}
112 mikala 99236 %_post_service apcupsd
113    
114     %preun
115     %_preun_service apcupsd
116    
117 luigiwalser 202314 %files
118 daviddavid 2057245 %license COPYING
119 mikala 99236 %doc ChangeLog DISCLAIMER Developers ReleaseNotes examples doc/manual
120 daviddavid 2057245 %{_unitdir}/apcupsd.service
121     %dir %ghost %attr(0755, root, root) %{_rundir}/apcupsd
122     %{_tmpfilesdir}/%{name}.conf
123 mikala 99236 %dir %{_sysconfdir}/apcupsd
124     %config(noreplace) %{_sysconfdir}/apcupsd/*
125 daviddavid 2057245 %config(noreplace) %{_sysconfdir}/logrotate.d/apcupsd
126     %config(noreplace) %{_sysconfdir}/httpd/conf.d/apcupsd.conf
127 mikala 99236 %{_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