diff --git a/README.md b/README.md index 9a781cd..d412097 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ # apmd +APMD is a set of programs for controlling the Advanced Power Management daemon and utilities found in most modern laptop computers. +APMD can watch your notebook's battery and warn users when the battery is low. +APMD is also capable of shutting down the PCMCIA sockets before a suspend. + +Install the apmd package if you need to control the APM system on your laptop. + diff --git a/apmd-3.2.0.x11includes.patch b/apmd-3.2.0.x11includes.patch new file mode 100644 index 0000000..0c970b1 --- /dev/null +++ b/apmd-3.2.0.x11includes.patch @@ -0,0 +1,11 @@ +diff -ru apmd-3.2.0.orig.orig/Makefile apmd-3.2.0.orig/Makefile +--- apmd-3.2.0.orig.orig/Makefile 2003-07-17 11:48:45.000000000 +0200 ++++ apmd-3.2.0.orig/Makefile 2003-07-17 11:49:05.000000000 +0200 +@@ -46,6 +46,7 @@ + CFLAGS=-O -g + XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include \ + -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \ ++ -I/usr/X11R6/include \ + -DVERSION=\"$(VERSION)\" \ + -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\" + LDFLAGS= diff --git a/apmd-3.2.2-libtool_tag.patch b/apmd-3.2.2-libtool_tag.patch new file mode 100644 index 0000000..55b87d1 --- /dev/null +++ b/apmd-3.2.2-libtool_tag.patch @@ -0,0 +1,12 @@ +diff -Nru apmd-3.2.2.orig.orig/Makefile apmd-3.2.2.orig/Makefile +--- apmd-3.2.2.orig.orig/Makefile 2007-05-21 22:41:50.000000000 +0200 ++++ apmd-3.2.2.orig/Makefile 2007-05-21 22:42:08.000000000 +0200 +@@ -59,7 +59,7 @@ + #CFLAGS=-O3 -m486 -fomit-frame-pointer + #LDFLAGS=-s + +-LIBTOOL=libtool --quiet ++LIBTOOL=libtool --quiet --tag=CC + LT_COMPILE = $(LIBTOOL) --mode=compile $(CC) + LT_LINK = $(LIBTOOL) --mode=link $(CC) + LT_INSTALL = $(LIBTOOL) --mode=install install diff --git a/apmd-glibc-2.2.5.patch b/apmd-glibc-2.2.5.patch new file mode 100644 index 0000000..dc0c00f --- /dev/null +++ b/apmd-glibc-2.2.5.patch @@ -0,0 +1,21 @@ +diff -ruN apmd.orig/apmsleep.c apmd/apmsleep.c +--- apmd.orig/apmsleep.c 2002-08-21 14:59:25.000000000 +0200 ++++ apmd/apmsleep.c 2002-08-21 15:00:46.000000000 +0200 +@@ -43,14 +43,16 @@ + */ + + #include ++#include + #include + + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,2,0) +-#include ++#include + #endif + + #include + #include ++#include + #include + #include + #include diff --git a/apmd-initscript b/apmd-initscript new file mode 100644 index 0000000..5861052 --- /dev/null +++ b/apmd-initscript @@ -0,0 +1,89 @@ +#!/bin/bash +# +# /etc/rc.d/init.d/apm +# +# Starts the apm daemon +# +# chkconfig: 345 44 56 +# description: Listen and dispatch APM events from the kernel +# processname: apmd + +# Source function library. +. /etc/rc.d/init.d/functions + +if [ -f /etc/sysconfig/apm ]; then + source /etc/sysconfig/apm +fi + +DAEMON=apm +PROGNAME=${DAEMON}d +test -x /usr/sbin/$PROGNAME || exit 0 + +RETVAL=0 + +# +# See how we were called. +# + +start() { + # Check if it is already running + if [[ ! -f /var/lock/subsys/$PROGNAME && ! -e /proc/acpi && -e /proc/apm ]]; then + echo -n "Starting $DAEMON daemon: " + daemon /usr/sbin/$PROGNAME + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$PROGNAME + echo + fi + return $RETVAL +} + +stop() { + if [[ ! -f /var/lock/subsys/$PROGNAME ]]; then + echo -n "Stopping $DAEMON daemon: " + killproc /usr/sbin/$PROGNAME + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROGNAME + echo + fi + return $RETVAL +} + + +restart() { + stop + start +} + +reload() { + trap "" SIGHUP + killall -HUP $PROGNAME +} + +case "$1" in +start) + start + ;; +stop) + stop + ;; +reload) + reload + ;; +restart) + restart + ;; +condrestart) + if [ -f /var/lock/subsys/$PROGNAME ]; then + restart + fi + ;; +status) + status $PROGNAME + ;; +*) + INITNAME=`basename $0` + echo "Usage: $INITNAME {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL diff --git a/apmd-kernel-2.4.patch b/apmd-kernel-2.4.patch new file mode 100644 index 0000000..7bfd2bd --- /dev/null +++ b/apmd-kernel-2.4.patch @@ -0,0 +1,19 @@ +diff -ruN apmd.orig/apmsleep.c apmd/apmsleep.c +--- apmd.orig/apmsleep.c 2002-08-21 12:05:09.000000000 +0200 ++++ apmd/apmsleep.c 2002-08-21 12:06:38.000000000 +0200 +@@ -49,7 +49,6 @@ + #include + #endif + +-#include + #include + #include + #include +@@ -61,6 +60,7 @@ + #include + #include + #include ++#include + + static char rcsid[]="$Id: apmsleep.c,v 1.1 1999/08/02 20:08:08 apenwarr Exp $"; + static char rcsrev[] = "$Revision: 1.1 $"; diff --git a/apmd.spec b/apmd.spec new file mode 100644 index 0000000..fc32240 --- /dev/null +++ b/apmd.spec @@ -0,0 +1,131 @@ +Name: apmd +Version: 3.2.2 +Release: 5mamba +Summary: Advanced Power Management (APM) BIOS utilities for laptops. +Group: System/Kernel and Hardware +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.worldvisions.ca/~apenwarr/apmd/ +Source: http://http.us.debian.org/debian/pool/main/a/apmd/apmd_%{version}.orig.tar.gz +Source1: apmd-initscript +Patch1: %{name}-kernel-2.4.patch.bz2 +Patch2: %{name}-glibc-2.2.5.patch.bz2 +Patch3: %{name}-3.2.0.x11includes.patch +Patch4: %{name}-3.2.2-libtool_tag.patch +License: GPL +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +APMD is a set of programs for controlling the Advanced Power Management daemon and utilities found in most modern laptop computers. +APMD can watch your notebook's battery and warn users when the battery is low. +APMD is also capable of shutting down the PCMCIA sockets before a suspend. + +Install the apmd package if you need to control the APM system on your laptop. + +%package -n libapm +Summary: Advanced Power Management (APM) library +Group: System/Libraries + +%description -n libapm +APMD is a set of programs for controlling the Advanced Power Management daemon and utilities found in most modern laptop computers. +APMD can watch your notebook's battery and warn users when the battery is low. +APMD is also capable of shutting down the PCMCIA sockets before a suspend. +Install the apmd package if you need to control the APM system on your laptop. +This package contains the libraries. + +%package -n libapm-devel +Summary: Development package for apdm +Group: Development/Libraries +Requires: libapm = %{version}-%{release} + +%description -n libapm-devel +APMD is a set of programs for controlling the Advanced Power Management daemon and utilities found in most modern laptop computers. +APMD can watch your notebook's battery and warn users when the battery is low. +APMD is also capable of shutting down the PCMCIA sockets before a suspend. +Install the apmd package if you need to control the APM system on your laptop. +This is the development package. + +%prep +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%setup -q -n apmd-%{version}.orig +#%patch1 -p1 +#%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + +%build +make prefix=%{_prefix} + +%install +make install DESTDIR=%{buildroot} +mkdir -p %{buildroot}%{_initrddir} +cp %{SOURCE1} %{buildroot}%{_initrddir}/apmd + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +if [ $1 -eq 1 ]; then +# new install + chkconfig --add apmd +fi +exit 0 + +%preun +if [ $1 -eq 0 ]; then +# erase + chkconfig --del apmd + %{_initrddir}/apmd stop +fi +exit 0 + +%postun +if [ $1 -eq 1 ]; then +# update + %{_initrddir}/apmd restart +fi +exit 0 + +%files +%defattr(-,root,root) +%{_bindir}/apm +%{_bindir}/apmsleep +%{_bindir}/on_ac_power +%{_bindir}/xapm +%{_sbindir}/apmd +%attr(755,root,root) %{_initrddir}/apmd + +%files -n libapm +%defattr(-,root,root) +%{_libdir}/libapm.so.* + +%files -n libapm-devel +%defattr(-,root,root) +%{_libdir}/libapm.a +%{_libdir}/libapm.la +%{_libdir}/libapm.so +%{_includedir}/apm.h + +%changelog +* Thu Jul 11 2013 Automatic Build System 3.2.2-5mamba +- automatic rebuild by autodist + +* Sat May 09 2009 Automatic Build System 3.2.2-4mamba +- automatic rebuild by autodist + +* Mon May 21 2007 Silvan Calarco 3.2.2-3mamba +- added patch for recent libtool support +- added subpackages libapm and libapm-devel, removed apm-devel +- group and specfile fixes + +* Mon Nov 29 2004 Silvan Calarco 3.2.2-2qilnx +- don't start service on new install + +* Thu Nov 11 2004 Silvan Calarco 3.2.2-1qilnx +- new version build +- start service if acpi is not present and apm is + +* Thu Jul 17 2003 Silvan Calarco 3.2.0-1qilnx +- first build for apmd