%define name apcupsd %define version 3.14.2 %define release %mkrel 3 %define _cgibin /var/www/cgi-bin %define _sysconfdir /etc/apcupsd %define _sbindir /sbin Summary: Power management software for APC UPS hardware Name: %{name} Version: %{version} Release: %{release} Source0: http://mesh.dl.sourceforge.net/sourceforge/apcupsd/%{name}-%{version}.tar.bz2 Patch0: %{name}-3.12.2-usbhiddev.patch Patch1: %{name}-3.10.16-staleusb.patch License: GPL URL: http://sourceforge.net/projects/apcupsd/ Group: System/Servers Requires: initscripts >= 6.27-5mdk Requires(post): rpm-helper Requires(preun):rpm-helper BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRequires: ncurses-devel gd-devel %description UPS power management under Linux for APCC Products. It allows your computer/server to run during power problems for a specified length of time or the life of the batteries in your BackUPS, BackUPS Pro, SmartUPS v/s, or SmartUPS, and then properly executes a controlled shutdown during an extended power failure. %prep %setup -q %patch0 -p1 -b .usbhid %patch1 -p1 -b .usbstale %build %serverbuild %configure2_5x --enable-usb \ --enable-net \ --enable-master-slave \ --enable-powerflute \ --enable-pthreads \ --enable-cgi \ --with-cgi-bin=%{_cgibin} \ --enable-nls \ --with-serial-dev= \ --with-upstype=usb \ --with-upscable=usb \ --with-nisip=127.0.0.1 # %%make doesn't work make %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d \ $RPM_BUILD_ROOT%{_cgibin} #perl -pi -e 's|/etc|\$\$RPM_BUILD_ROOT/etc|g' platforms/mandrake/Makefile.in perl -pi -e 's|\@/sbin/chkconfig|\#\@/sbin/chkconfig|' platforms/mandrake/Makefile.in %makeinstall cgibin=$RPM_BUILD_ROOT%{_cgibin} install -m 644 ./platforms/etc/apcupsd.conf $RPM_BUILD_ROOT/etc/apcupsd/ install -m 755 ./platforms/apccontrol $RPM_BUILD_ROOT/etc/apcupsd/ install -m 755 ./platforms/mandrake/apcupsd $RPM_BUILD_ROOT/etc/rc.d/init.d for src in changeme commfailure commok \ onbattery offbattery; do \ install -m 744 ./platforms/etc/$src $RPM_BUILD_ROOT/etc/apcupsd/$src done %find_lang %{name} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %post %_post_service apcupsd %preun %_preun_service apcupsd %files -f %{name}.lang %defattr(-,root,root) %dir /etc/apcupsd %config(noreplace) /etc/apcupsd/* %config(noreplace) /etc/rc.d/init.d/apcupsd %{_sbindir}/* %{_mandir}/man8/* %{_cgibin}/* %doc ChangeLog doc/ examples/ %changelog * Mon Jun 16 2008 Thierry Vignaud <tvignaud@mandriva.com> 3.14.2-3mdv2009.0 + Revision: 220350 - rebuild - kill re-definition of %%buildroot on Pixel's request + Olivier Blin <oblin@mandriva.com> - restore BuildRoot * Sat Nov 17 2007 Funda Wang <fundawang@mandriva.org> 3.14.2-2mdv2008.1 + Revision: 109197 - rebuild for new lzma * Thu Nov 01 2007 Giuseppe Ghibò <ghibo@mandriva.com> 3.14.2-1mdv2008.1 + Revision: 104359 - Release 3.14.2. - Release 3.14.1. * Fri Feb 09 2007 Giuseppe Ghibò <ghibo@mandriva.com> 3.13.12-1mdv2007.0 + Revision: 118664 - Import apcupsd * Thu Feb 08 2007 Giuseppe Ghibò <ghibo@mandriva.com> 3.13.12-1mdkv2007.1 - Release 3.13.12. * Tue Sep 19 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 3.12.3-2mdv2007.0 - Rebuild * Wed Jul 26 2006 Emmanuel Andry <eandry@mandriva.org> 3.12.3-1mdv2007.0 - Release 3.12.3 * Tue Apr 04 2006 Giuseppe Ghibò <ghibo@mandriva.com> 3.12.2-1mdk - Release 3.12.2. * Fri Dec 23 2005 Giuseppe Ghibò <ghibo@mandriva.com> 3.10-18-5mdk - added missed /etc/apcupsd/apccontrol. * Sun Oct 16 2005 Giuseppe Ghibò <ghibo@mandriva.org> 3.10.18-4mdk - added missed default config file (apcupsd.conf). * Fri Aug 12 2005 Nicolas Lécureuil <neoclust@mandriva.org> 3.10.18-3mdk - fix rpmlint errors (PreReq) * Thu Aug 11 2005 Nicolas Lécureuil <neoclust@mandriva.org> 3.10.18-2mdk - fix rpmlint errors (PreReq) * Sun Jul 24 2005 Giuseppe Ghibò <ghibo@mandriva.com> 3.10.18-1mdk - Release 3.10.18. - Rebuilt Patch0. * Thu Dec 30 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.10.16-2mdk - Added Patch0 to fix USB default device under UDEV. - Added Patch1 to support cleaning for usb stale lock files when default device is used. * Tue Nov 09 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.10.16-1mdk - 3.10.16. * Mon Aug 09 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.10.15-1mdk - Release 3.10.14. - Dropped Patch0, merged upstream. * Tue Aug 03 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.10.14-2mdk - Added Patch0 to avoid segfault during EEPROM configuring. * Tue Aug 03 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.10.14-1mdk - Dropped Patch0, Patch1, merged upstream. - Release 3.10.14. * Fri Jul 30 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 3.10.13-3mdk - fix problem with lock files (Giuseppe Ghibo) * Thu Jul 29 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 3.10.13-2mdk - fix build (P0 from Pascal Terjan) - fix unowned dir - cosmetics - drop docs there's no need for - add prereq on rpm-helper * Sat May 22 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 3.10.13-1mdk - 3.10.13.