]> git.pld-linux.org Git - packages/apcupsd.git/commitdiff
- raw version.
authorkloczek <kloczek@pld-linux.org>
Sat, 27 Nov 1999 13:04:03 +0000 (13:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apcupsd.spec -> 1.3

apcupsd.spec

index 8e27aa31e61fd38dd1c679e862c1ce16e9c5de21..9f933affb124bfd1681f13ad0de7156fa4ce5020 100644 (file)
@@ -1,19 +1,21 @@
-Summary:       APC UPS Daemon.
-Summary(pl):   APC UPS demon.
-Name:          apcupsd
-Version:       3.5.8
-Release:       1
-Copyright:     GPL
-Group:         Daemons
-Group(pl):     Demony  
-Source:                http://www.brisse.dk/site/apcupsd/download/%{name}-%{version}.src.tar.gz
-Patch0:                apcups-initscript.patch
-Patch1:                apcups-Makefile.fix
-Patch2:                apcups-inetd.patch
-BuildRoot:     /tmp/%{name}-root
-
-%define        _prefix /
-%define        _mandir /usr/share/man
+Name: apcupsd
+Version: 3.5.8
+Release: 2
+Copyright: GPL v2
+Group: System Environment/Daemons
+Url: http://www.brisse.dk/site/apcupsd/
+Packager: Bert de Bruijn <bob@ccl.kuleuven.ac.be>
+Source: http://www.brisse.dk/site/apcupsd/download/%{name}-%{version}.src.tar.gz
+Patch0: apcups-initscript.patch
+Patch1: apcups-makefile.patch
+Summary: power management software for APC UPS hardware
+BuildRoot: /var/tmp/%{name}-root
+Prefix: /usr
+Prefix: /etc
+Prefix: /sbin
+Prefix: /bin
+Prefix: /var
+#Icon: apcupsd-logo.xpm
 
 %description
 UPS power management under Linux for APCC Products.
 
 %description
 UPS power management under Linux for APCC Products.
@@ -23,56 +25,84 @@ in your BackUPS, BackUPS Pro, SmartUPS v/s, or SmartUPS, and
 then properly executes a controlled shutdown during an
 extended power failure.
 
 then properly executes a controlled shutdown during an
 extended power failure.
 
-%description -l pl
-
 %prep
 %prep
-%setup -q -n %{name}-%{version}.src
+%setup -n %{name}-%{version}.src
 %patch0 -p1
 %patch0 -p1
-%patch1 -p0
-%patch2 -p1
+%patch1 -p1
 
 %build
 
 %build
-make linux \
-       MANPREFIX=$RPM_BUILD_ROOT%{_mandir} \
-       CFLAGS="$RPM_OPT_FLAGS -I./include"
+mv Makefile Makefile.orig
+cat Makefile.orig \
+ | sed "s,^PREFIX    =,PREFIX    = ${RPM_BUILD_ROOT},"  \
+ | sed "s,^MANPREFIX = /usr,MANPREFIX = ${RPM_BUILD_ROOT}/usr," \
+ > Makefile
+make linux
 
 %install
 
 %install
-
-install -d $RPM_BUILD_ROOT{%{_sysconfdir}/rc.d/init.d,%{_bindir},%{_sbindir},%{_mandir}/man8,/var/log}
-
-install installs/apcupsd.conf $RPM_BUILD_ROOT%{_sysconfdir}
-
-install -s apcupsd-linux $RPM_BUILD_ROOT%{_sbindir}/apcupsd
-install -s apcaccess-linux $RPM_BUILD_ROOT%{_bindir}/apcaccess
-
-install installs/powersc $RPM_BUILD_ROOT%{_sbindir}
-
-install docs/apcupsd.man8 $RPM_BUILD_ROOT%{_mandir}/man8/apcupsd.8
-
-install apcupsd ${RPM_BUILD_ROOT}/etc/rc.d/init.d/apcupsd
-
+# Some issues :
+# - why doesn't the Makefile know that it should install *-linux ??
+# - make install tries to stop apcupsd. That's not necessary (buildroot) (hany: not issue anymore)
+
+mkdir -p ${RPM_BUILD_ROOT}/{sbin,bin,etc/rc.d/init.d,usr/man/man8,var/log}
+NAME="-linux" make install
+# hany: why this? we're just building. not installing
+#[ -x /sbin/powersc ] && /sbin/powersc RESTARTME
+gzip -9 -f ${RPM_BUILD_ROOT}/usr/man/*/*.?
+cp -f installs/apcupsd.conf ${RPM_BUILD_ROOT}/etc
+cp -f installs/apcups.rhs ${RPM_BUILD_ROOT}/etc/rc.d/init.d/apcups
 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
 touch ${RPM_BUILD_ROOT}/etc/apcupsd.status
 
 touch ${RPM_BUILD_ROOT}/var/log/apcupsd.log
 touch ${RPM_BUILD_ROOT}/etc/apcupsd.status
 
-gzip -9fn $RPM_BUILD_ROOT%{_mandir}/man8/*
-
 %clean
 rm -rf ${RPM_BUILD_ROOT}
 
 %post
 %clean
 rm -rf ${RPM_BUILD_ROOT}
 
 %post
-/sbin/chkconfig --add apcupsd
+/sbin/ldconfig
+/sbin/chkconfig --add apcups
+if !(grep /sbin/powersc /etc/rc.d/init.d/halt > /dev/null); then
+cp -f /etc/rc.d/init.d/halt /etc/rc.d/init.d/halt.rpmorig
+sed -e '/# Now halt or reboot./i\' \
+     -e '\
+# See if this is a powerfail situation.\
+if [ -f /etc/powerfail ]; then\
+  echo "APCUPSD to the Rescue!"\
+  echo\
+  /sbin/powersc KILL\
+  echo\
+  sleep 120\
+  exit 1\
+fi\
+' /etc/rc.d/init.d/halt.rpmorig > /etc/rc.d/init.d/halt
+
+fi
+echo Check the documentation to see whether /etc/rc.d/init.d/halt has a
+echo correct invocation of /sbin/powersc .
 
 %preun
 
 %preun
-/sbin/chkconfig --del apcupsd
+chkconfig --del apcups
 
 %files
 
 %files
-%defattr(644, root, root,755)
-%doc README.NEW Changelog port.gif Statement.APCC
-%attr(644, root, root) %{_mandir}/man8/apcupsd.8.gz
-%attr(755, root, bin)  %{_sbindir}/apcupsd
-%attr(755, root, root) %{_bindir}/apcaccess
-%attr(755, root, bin)  %config %{_sbindir}/powersc
-%config(noreplace) /etc/apcupsd.conf
-%config /etc/rc.d/init.d/apcupsd
+%defattr(-, root, root)
+%attr(-, root, root) %doc README.NEW Changelog port.gif Statement.APCC
+%attr(-, root, root) %doc %{name}-%{version}.src.lsm
+%attr(-, root, root) %doc readmes/*
+%attr(-, root, root) %doc docs/apcupsd.docs
+%attr(-, root, root) %doc installs/halt.rhs installs/apcups.rhs installs/powersc
+%attr(644, root, man) /usr/man/man8/apcupsd.8.gz
+%attr(755, root, bin)  /sbin/apcupsd
+%attr(755, root, root) /bin/apcaccess
+%attr(755, root, bin)  %config /sbin/powersc
+%attr(640, root, root) %config(noreplace) /etc/apcupsd.conf
+%attr(755, root, root) %config /etc/rc.d/init.d/apcups
 %ghost /var/log/apcupsd.log
 %ghost /etc/apcupsd.status
 %ghost /var/log/apcupsd.log
 %ghost /etc/apcupsd.status
+
+%changelog
+* Fri Aug  6 1999 Peter Hanecak <hanecak@megaloman.sk>
+- build process cleaned (so non-root users can do that smoothly)
+- build-root changed
+- %defattr
+
+* Sun Jun  6 1999 Bert de Bruijn <bob@ccl.kuleuven.ac.be>
+- new spec file, first rpm release since source release under GPL ?
+- use sed in %build to force buildroot.
This page took 0.050227 seconds and 4 git commands to generate.