]> git.pld-linux.org Git - packages/apcupsd.git/blobdiff - apcupsd.spec
- updated to 3.14.14, adjusted configure patch for current autotools
[packages/apcupsd.git] / apcupsd.spec
index 5409d5b225c5cb50eea580eaec5c446283467da6..2fa0fb6d0cd8287c4b63d59fba35f6cf03fc2dc9 100644 (file)
@@ -1,41 +1,50 @@
 #
 # Conditional build:
-%bcond_without cgi     # without CGI program support
-%bcond_without gapcmon # without gapcmon GUI
-%bcond_without net     # without network support
-%bcond_with    snmp    # with SNMP support
-%bcond_without test    # without TEST support
-%bcond_without usb     # without USB support
+%bcond_without cgi     # CGI program support
+%bcond_without gapcmon # gapcmon GUI
+%bcond_without net     # network support
+%bcond_with    snmp    # SNMP support
+%bcond_without test    # TEST support
+%bcond_without usb     # USB support
 
 Summary:       Power management software for APC UPS hardware
 Summary(pl.UTF-8):     Oprogramowanie do zarządzania energią dla UPS-ów APC
 Name:          apcupsd
-Version:       3.14.10
-Release:       3
+Version:       3.14.14
+Release:       1
 License:       GPL v2
 Group:         Networking/Daemons
-Source0:       http://downloads.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
-# Source0-md5: 5928822d855c5cf7ac29655e3e0b8c23
+Source0:       https://downloads.sourceforge.net/apcupsd/%{name}-%{version}.tar.gz
+# Source0-md5: cc8f5ced77f38906a274787acb9bc980
 Source1:       %{name}.init
 Source2:       %{name}.logrotate
 Source3:       %{name}.sysconfig
 Patch0:                %{name}-configure.patch
-Patch1:                %{name}-pcnet-seconds.patch
+Patch1:                control-config.patch
 Patch2:                format-security.patch
+Patch3:                shutdown.patch
+Patch4:                cxxld.patch
+Patch5:                systemd.patch
+Patch6:                fixgui.patch
+Patch7:                nodbg.patch
 URL:           http://www.apcupsd.com/
 %{?with_gapcmon:BuildRequires: GConf2-devel >= 2.0}
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: gd-devel
 %{?with_gapcmon:BuildRequires: gtk+2-devel >= 2:2.4.0}
+BuildRequires: libstdc++-devel
+BuildRequires: libwrap-devel
 BuildRequires: man-db
 %{?with_snmp:BuildRequires:    net-snmp-devel}
 BuildRequires: pkgconfig
-BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rpmbuild(macros) >= 1.647
 BuildRequires: util-linux
+Requires:      rc-scripts
+Requires:      systemd-units >= 0.38
 Requires(post):        fileutils
 Requires(post,preun):  /sbin/chkconfig
-Requires:      rc-scripts
+Requires(post,preun,postun):   systemd-units >= 38
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _sysconfdir     /etc/apcupsd
@@ -73,7 +82,8 @@ o stanie UPS-a.
 Summary:       Apcupsd GUI monitoring application
 Summary(pl.UTF-8):     Aplikacja GUI monitorowania Apcupsd
 Group:         X11/Applications
-URL:           http://gapcmon.sourceforge.net/
+URL:           https://gapcmon.sourceforge.net/
+Requires:      gtk+2 >= 2:2.4.0
 
 %description gapcmon
 GNOME/GTK+ based application which integrates into most desktop panels
@@ -91,30 +101,40 @@ serwera NIS. Status każdego UPS-a przedstawia ikona.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-for i in configure.in aclocal.m4 config.h.in; do install autoconf/$i .;done
-cp -f %{_datadir}/automake/config.sub autoconf
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
+for i in configure.in aclocal.m4 config.h.in; do
+       cp -pf autoconf/$i .
+done
+cp -pf %{_datadir}/automake/{config.guess,config.sub,install-sh,mkinstalldirs} autoconf
 %{__autoconf}
 %configure \
        APCUPSD_MAIL="/bin/mail" \
        SHUTDOWN="/sbin/shutdown" \
        WALL="%{_bindir}/wall" \
+       --with-libwrap \
        --with-log-dir=%{_var}/log \
        --with-stat-dir=%{_var}/lib/apcupsd \
+       --enable-apcsmart \
 %if %{with cgi}
        --enable-cgi \
        --with-cgi-bin=/home/services/httpd/cgi-bin \
 %endif
-       %{?with_test:--enable-test} \
-%if %{with net}
-       --enable-net \
-%endif
+       --enable-dumb \
        %{?with_gapcmon:--enable-gapcmon} \
+       %{?with_net:--enable-net} \
+       --enable-pcnet \
        %{?with_snmp:--enable-snmp} \
+       %{?with_test:--enable-test} \
        %{?with_usb:--enable-usb}
 
-%{__make}
+%{__make} \
+       VERBOSE=2
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -128,6 +148,10 @@ install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/apcupsd
 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/apcupsd
 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/apcupsd
 
+# systemd support
+install -p -D apcupsd.service $RPM_BUILD_ROOT%{systemdunitdir}/apcupsd.service
+install -p -D apcupsd_shutdown $RPM_BUILD_ROOT%{systemdunitdir}-shutdown/apcupsd_shutdown
+
 touch $RPM_BUILD_ROOT/var/log/apcupsd.events
 touch $RPM_BUILD_ROOT/var/lib/apcupsd/apcupsd.status
 
@@ -145,16 +169,21 @@ rm -rf $RPM_BUILD_ROOT
 %post
 /sbin/chkconfig --add apcupsd
 %service apcupsd restart "apcupsd daemon"
+%systemd_post %{name}.service
 
 %preun
 if [ "$1" = "0" ]; then
        %service apcupsd stop
        /sbin/chkconfig --del apcupsd
 fi
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
 
 %files
 %defattr(644,root,root,755)
-%doc ChangeLog Developers
+%doc ChangeLog Developers ReleaseNotes
 %attr(755,root,root) %{_sbindir}/apcaccess
 %attr(755,root,root) %{_sbindir}/apctest
 %attr(755,root,root) %{_sbindir}/apcupsd
@@ -168,13 +197,10 @@ fi
 #%attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mainsback
 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/onbattery
 %attr(754,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/offbattery
-%if %{with cgi}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
-%{_sysconfdir}/apcupsd.css
-%endif
 %attr(754,root,root) /etc/rc.d/init.d/apcupsd
 %attr(754,root,root) /etc/rc.d/init.d/halt
+%{systemdunitdir}/%{name}.service
+%attr(755,root,root) %{systemdunitdir}-shutdown/apcupsd_shutdown
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/apcupsd
 %dir %{_sysconfdir}
 %dir /var/lib/apcupsd
@@ -189,7 +215,13 @@ fi
 %if %{with cgi}
 %files cgi
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_cgidir}/*.cgi
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/hosts.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/multimon.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apcupsd.css
+%attr(755,root,root) %{_cgidir}/multimon.cgi
+%attr(755,root,root) %{_cgidir}/upsfstats.cgi
+%attr(755,root,root) %{_cgidir}/upsimage.cgi
+%attr(755,root,root) %{_cgidir}/upsstats.cgi
 %endif
 
 %if %{with gapcmon}
@@ -197,5 +229,10 @@ fi
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/gapcmon
 %{_desktopdir}/gapcmon.desktop
-%{_pixmapsdir}/*.png
+%{_pixmapsdir}/apcupsd.png
+%{_pixmapsdir}/charging.png
+%{_pixmapsdir}/gapc_prefs.png
+%{_pixmapsdir}/onbatt.png
+%{_pixmapsdir}/online.png
+%{_pixmapsdir}/unplugged.png
 %endif
This page took 0.066422 seconds and 4 git commands to generate.