From 4569c80c9ffad89ee004605fb6bd768748c549b7ec34d2e70e0789be565b6080 Mon Sep 17 00:00:00 2001
From: OBS User buildservice-autocommit <null@suse.de>
Date: Sun, 3 Oct 2010 20:43:20 +0000
Subject: [PATCH] Updating link to change in openSUSE:Factory/acpid revision
 29.0

OBS-URL: https://build.opensuse.org/package/show/Base:System/acpid?expand=0&rev=1bebb5d4bb01995620016a4529a59b21
---
 acpi-0.09.tar.bz2         |  3 ---
 acpi_0.09.dif             | 56 ---------------------------------------
 acpid-1.0.10.tar.gz       |  3 ---
 acpid-2.0.5-forking.patch | 12 +++++++++
 acpid-2.0.6.tar.gz        |  3 +++
 acpid-makefile.patch      | 13 +++++++++
 acpid.changes             | 18 +++++++++++++
 acpid.service             | 17 ++++++++++++
 acpid.spec                | 45 +++++++++++++------------------
 rcacpid                   |  2 +-
 10 files changed, 83 insertions(+), 89 deletions(-)
 delete mode 100644 acpi-0.09.tar.bz2
 delete mode 100644 acpi_0.09.dif
 delete mode 100644 acpid-1.0.10.tar.gz
 create mode 100644 acpid-2.0.5-forking.patch
 create mode 100644 acpid-2.0.6.tar.gz
 create mode 100644 acpid-makefile.patch
 create mode 100644 acpid.service

diff --git a/acpi-0.09.tar.bz2 b/acpi-0.09.tar.bz2
deleted file mode 100644
index 900dd8f..0000000
--- a/acpi-0.09.tar.bz2
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a08db372568d90c7a165d318b79fc364188cf50f80071b14cd8b3fb9abed4ea4
-size 72815
diff --git a/acpi_0.09.dif b/acpi_0.09.dif
deleted file mode 100644
index b9fcc5e..0000000
--- a/acpi_0.09.dif
+++ /dev/null
@@ -1,56 +0,0 @@
---- acpi-0.09.orig/acpi.1
-+++ acpi-0.09/acpi.1
-@@ -0,0 +1,52 @@
-+.TH "ACPI" "1" 
-+.SH "NAME" 
-+acpi - Shows battery status information
-+.SH "SYNOPSIS" 
-+.PP 
-+\fBacpi\fP [\fBoptions\fP] 
-+.SH "DESCRIPTION" 
-+.PP 
-+\fBacpi\fP 
-+Shows information from the /proc filesystem, such as battery status or
-+thermal information.
-+.PP 
-+This manual page was written for the \fBDebian\fP distribution 
-+because the original program does not have a manual page. 
-+.SH "OPTIONS" 
-+.IP "\fB-b | --battery\fP         " 10 
-+show battery information
-+.IP "\fB-B | --without-battery\fP " 10
-+suppress battery information
-+.IP "\fB-t |  --thermal\fP " 10
-+show thermal information
-+.IP "\fB-T | --without-thermal\fP " 10
-+suppress thermal information
-+.IP "\fB-a | --ac-adapter\fP " 10
-+show ac adapter information
-+.IP "\fB-A | --without-ac-adapter\fP " 10
-+suppress ac-adapter information
-+.IP "\fB-V | --everything\fP " 10
-+show every device, overrides above options
-+.IP "\fB-s | --show-empty\fP " 10
-+show non-operational devices
-+.IP "\fB-S | --hide-empty\fP " 10
-+hide non-operational devices
-+.IP "\fB-c | --celcius\fP " 10
-+use celcius as the temperature unit
-+.IP "\fB-f | --fahrenheit\fP " 10
-+use fahrenheit as the temperature unit
-+.IP "\fB-k | --kelvin\fP " 10
-+use kelvin as the temperature unit
-+.IP "\fB-d | --directory <dir>\fP " 10
-+path to ACPI info (/proc/acpi)
-+.IP "\fB-h | --help\fP " 10
-+display help and exit
-+.IP "\fB-v | --version\fP " 10
-+output version information and exit
-+
-+.SH "AUTHOR" 
-+.PP 
-+This manual page was written by Paul Telford <pxt@debian.org> for 
-+the \fBDebian\fP system (but may be used by others).  Permission is 
-+granted to copy, distribute and/or modify this document under 
-+the terms of the GNU GPL.
-
diff --git a/acpid-1.0.10.tar.gz b/acpid-1.0.10.tar.gz
deleted file mode 100644
index de63ed6..0000000
--- a/acpid-1.0.10.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:22703ce0dd7305aca01bc9ac741659c32b1593f1d6fde492df7f01067a534760
-size 93596
diff --git a/acpid-2.0.5-forking.patch b/acpid-2.0.5-forking.patch
new file mode 100644
index 0000000..afe8cdf
--- /dev/null
+++ b/acpid-2.0.5-forking.patch
@@ -0,0 +1,12 @@
+diff -up acpid-2.0.5/acpid.c.forking acpid-2.0.5/acpid.c
+--- acpid-2.0.5/acpid.c.forking	2010-03-28 15:54:23.000000000 +0200
++++ acpid-2.0.5/acpid.c	2010-09-10 13:38:06.207131183 +0200
+@@ -333,7 +333,7 @@ daemonize(void)
+ 	pid_t pid, sid;
+ 
+     /* already a daemon */
+-    if ( getppid() == 1 ) return 0;
++    //if ( getppid() == 1 ) return 0;
+ 
+ 	/* fork off the parent process */
+ 	pid = fork();
diff --git a/acpid-2.0.6.tar.gz b/acpid-2.0.6.tar.gz
new file mode 100644
index 0000000..766fc04
--- /dev/null
+++ b/acpid-2.0.6.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:89db450ab9c740f24fb8324f75efebf38096afa0f4c5cabc4072441659059a33
+size 74689
diff --git a/acpid-makefile.patch b/acpid-makefile.patch
new file mode 100644
index 0000000..2437553
--- /dev/null
+++ b/acpid-makefile.patch
@@ -0,0 +1,13 @@
+Index: Makefile
+===================================================================
+--- Makefile.orig
++++ Makefile
+@@ -49,7 +49,7 @@ install_docs:
+ 	for a in $(DOCS); do install -m 0644 $$a $(DESTDIR)/$(DOCDIR) ; done
+ 	cp -a samples $(DESTDIR)/$(DOCDIR)
+ 
+-install: $(PROGS) man install_docs
++install: $(PROGS) man
+ 	mkdir -p $(DESTDIR)/$(SBINDIR)
+ 	mkdir -p $(DESTDIR)/$(BINDIR)
+ 	install -m 0750 acpid $(DESTDIR)/$(SBINDIR)
diff --git a/acpid.changes b/acpid.changes
index da25507..4846267 100644
--- a/acpid.changes
+++ b/acpid.changes
@@ -1,3 +1,21 @@
+-------------------------------------------------------------------
+Sat Oct  2 19:49:08 UTC 2010 - aj@suse.de
+
+- Add systemd configuration.
+- Always fork, even if called from PID 1.
+
+-------------------------------------------------------------------
+Sat Oct  2 19:27:50 UTC 2010 - aj@suse.de
+
+- Update to version 2.0.6:
+  * cleanup of code and build infrastructure
+  * Support netlink and input layer
+
+-------------------------------------------------------------------
+Sat Oct  2 19:26:45 UTC 2010 - aj@suse.de
+
+- Split up acpi in its own package.
+
 -------------------------------------------------------------------
 Wed Sep  2 17:58:25 CEST 2009 - glin@novell.com  
    
diff --git a/acpid.service b/acpid.service
new file mode 100644
index 0000000..006c132
--- /dev/null
+++ b/acpid.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=ACPI Event Daemon
+After=syslog.target
+
+# This could probably benefit from socket activation, but honestly I think it
+# is time for acpid to go away, and hence I am not planning to spend the time
+# to add socket activation here. We use Type=forking to ensure that the
+# communication sockets are in place before boot proceeds with any service
+# needing this service. Would acpid support socket activation we could use
+# Type=simple here.
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/acpid 
+
+[Install]
+WantedBy=multi-user.target
diff --git a/acpid.spec b/acpid.spec
index 4482786..61f4274 100644
--- a/acpid.spec
+++ b/acpid.spec
@@ -1,7 +1,7 @@
 #
-# spec file for package acpid (Version 1.0.10)
+# spec file for package acpid (Version 2.0.6)
 #
-# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,17 +19,15 @@
 
 
 Name:           acpid
-Url:            http://acpid.sourceforge.net/
-Version:        1.0.10
-Release:        3
-%define       acpi_version 0.09
-License:        GPL v2 or later
+Url:            http://tedfelix.com/linux/acpid-netlink.html
+Version:        2.0.6
+Release:        1
+License:        GPLv2+
 Group:          System/Daemons
 AutoReqProv:    on
 PreReq:         %insserv_prereq %fillup_prereq
 Summary:        Executes Actions at ACPI Events
 Source:         %{name}-%{version}.tar.gz
-Source1:        acpi-%{acpi_version}.tar.bz2
 Source2:        rcacpid
 Source3:        README.SuSE
 Source4:        thinkpad_acpi.modprobe
@@ -37,7 +35,9 @@ Source5:        events.power_button
 Source9:        events.thinkpad
 Source6:        thinkpad_handler
 Source7:        power_button
-Patch1:         acpi_%{acpi_version}.dif
+Source8:        acpid.service
+Patch1:         acpid-makefile.patch
+Patch2:         acpid-2.0.5-forking.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 ExclusiveArch:  %ix86 x86_64 ia64
 
@@ -56,23 +56,19 @@ Authors:
     Andrew Grover <andrew.grover@intel.com>
     Tim Hockin <thockin@sun.com>
     Cajus Pollmeier <pollmeier@gonicus.de>
+    Ted Felix <ted@tedfelix.com>
 
 %prep
-%setup -b 0 -a 1
-%patch1
-pushd acpi-%{acpi_version}
-popd
+%setup -q
+%patch1 -p0
+%patch2 -p1
 cp %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{S:7} %{S:9} .
 
 %build
-pushd acpi-%{acpi_version}
-ln -sf /usr/share/automake*/install-sh install-sh
-./configure
-make CFLAGS="$RPM_OPT_FLAGS"
-popd
+make OPT="$RPM_OPT_FLAGS" %{?_smp_mflags}
 
 %install
-make install INSTPREFIX=%{buildroot} SBINDIR=%{buildroot}/sbin
+make install DESTDIR=$RPM_BUILD_ROOT SBINDIR=/sbin
 install -Dm 744 rcacpid %{buildroot}/etc/init.d/acpid
 install -Dm 644 thinkpad_acpi.modprobe %{buildroot}/etc/modprobe.d/50-thinkpad_acpi.conf
 install -Dm 744 thinkpad_handler %{buildroot}/usr/lib/acpid/thinkpad_handler
@@ -81,11 +77,9 @@ mkdir -p %{buildroot}/usr/sbin
 ln -sf ../../etc/init.d/acpid %{buildroot}/usr/sbin/rcacpid
 install -Dm 644 events.power_button %{buildroot}/etc/acpi/events/power_button
 install -Dm 644 events.thinkpad %{buildroot}/etc/acpi/events/thinkpad
-pushd acpi-%{acpi_version}
-ln -sf /usr/share/automake*/mkinstalldirs mkinstalldirs
-make prefix=%{buildroot}/usr install
-install -Dm 644 acpi.1 %{buildroot}/%{_mandir}/man1/acpi.1
-popd
+mkdir -p $RPM_BUILD_ROOT/lib/systemd/system
+install -m 644 %{SOURCE8} $RPM_BUILD_ROOT/lib/systemd/system
+
 # for the rpmlint fascists
 mv samples examples 
 # keep the logfile
@@ -115,14 +109,13 @@ rm -rf %{buildroot}
 /usr/lib/acpid
 /etc/init.d/acpid
 /etc/modprobe.d/50-thinkpad_acpi.conf
+/lib/systemd/system/%{name}.service
 /usr/sbin/rcacpid
 /sbin/acpid
 /usr/bin/acpi_listen
 %doc README.SuSE README Changelog examples
 /usr/share/man/man8/acpid.8.gz
 /usr/share/man/man8/acpi_listen.8.gz
-/usr/bin/acpi
-/usr/share/man/man1/acpi.1.gz
 %ghost %config(noreplace,missingok) %_var/log/acpid
 
 %changelog
diff --git a/rcacpid b/rcacpid
index 1b8e5de..9e3ac1e 100644
--- a/rcacpid
+++ b/rcacpid
@@ -1,5 +1,5 @@
 #! /bin/bash
-# Copyright (c) 2002-2009 SuSE Linux AG, Nuernberg, Germany.
+# Copyright (c) 2002-2010 SUSE Linux Products GmbH, Nuernberg, Germany.
 # All rights reserved.
 #
 # Authors: Christian Zoz <zoz@suse.de>