tp-smapi (0.40-9) debian-dir only changes

Summary

 debian/README.Debian                                   |   27 ++
 debian/README.source                                   |    2 
 debian/changelog                                       |  200 +++++++++++++++++
 debian/compat                                          |    1 
 debian/control                                         |   45 +++
 debian/control.modules.in                              |   20 +
 debian/copyright                                       |   28 ++
 debian/dkms.conf.in                                    |   12 +
 debian/gbp.conf                                        |    3 
 debian/patches/01_include-thinkpad_ec.h-directly.patch |   35 ++
 debian/patches/02_hdaps-orientation-update.patch       |   25 ++
 debian/patches/03_2.6.37-compatibility.patch           |   41 +++
 debian/patches/99_Makefile-for-Debian.patch            |   68 +++++
 debian/patches/series                                  |    4 
 debian/rules                                           |  109 +++++++++
 debian/rules.modules                                   |   91 +++++++
 debian/source/format                                   |    1 
 debian/sysfs.conf                                      |    7 
 debian/tp-smapi-dkms.postinst                          |   24 ++
 debian/tp-smapi-dkms.prerm                             |   15 +
 debian/tp-smapi-source.links                           |    1 
 debian/watch                                           |    2 
 22 files changed, 761 insertions(+)

    
download this patch

Patch contents

--- tp-smapi-0.40.orig/debian/compat
+++ tp-smapi-0.40/debian/compat
@@ -0,0 +1 @@
+5
--- tp-smapi-0.40.orig/debian/sysfs.conf
+++ tp-smapi-0.40/debian/sysfs.conf
@@ -0,0 +1,7 @@
+# Add the following to your /etc/sysfs.conf to use the battery change limits
+# (package sysfsutils needed)
+
+devices/platform/smapi/BAT0/start_charge_thresh=40
+devices/platform/smapi/BAT0/stop_charge_thresh=85
+devices/platform/smapi/BAT1/start_charge_thresh=70
+devices/platform/smapi/BAT1/stop_charge_thresh=90
--- tp-smapi-0.40.orig/debian/control
+++ tp-smapi-0.40/debian/control
@@ -0,0 +1,45 @@
+Source: tp-smapi
+Section: kernel
+Priority: optional
+Maintainer: Evgeni Golov <evgeni@debian.org>
+Build-Depends: debhelper (>= 5), quilt (>= 0.40)
+Build-Depends-Indep: bzip2
+Standards-Version: 3.9.1
+Homepage: http://tpctl.sourceforge.net/
+Vcs-Git: git://git.debian.org/git/users/evgeni/tp-smapi.git
+Vcs-Browser: http://git.debian.org/?p=users/evgeni/tp-smapi.git
+
+Package: tp-smapi-source
+Architecture: all
+Depends: debhelper (>= 5), module-assistant, ${misc:Depends}
+Suggests: sysfsutils
+Description: ThinkPad hardware/firmware access modules source
+ The tp_smapi kernel module exposes some features of the ThinkPad
+ hardware/firmware via a sysfs interface. Currently, the main implemented
+ functionality is control of battery charging and extended battery status.
+ The underlying hardware interfaces are SMAPI and direct access to the
+ embedded controller.
+ .
+ This package also brings the source for an improved version of HDAPS
+ which should work on newer ThinkPads too (the stock kernel version does
+ not).
+ .
+ This package contains the source to be built with module-assistant or
+ kernel-package.
+
+Package: tp-smapi-dkms
+Architecture: all
+Depends: dkms (>= 1.95), ${misc:Depends}
+Description: ThinkPad hardware/firmware access modules source - dkms version
+ The tp_smapi kernel module exposes some features of the ThinkPad
+ hardware/firmware via a sysfs interface. Currently, the main implemented
+ functionality is control of battery charging and extended battery status.
+ The underlying hardware interfaces are SMAPI and direct access to the
+ embedded controller.
+ .
+ This package also brings the source for an improved version of HDAPS
+ which should work on newer ThinkPads too (the stock kernel version does
+ not).
+ .
+ This package contains the source to be built with dkms.
+
--- tp-smapi-0.40.orig/debian/rules.modules
+++ tp-smapi-0.40/debian/rules.modules
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS ?= -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+# some default definitions, important!
+#
+# Name of the source package
+psource:=tp-smapi-source
+
+# The short upstream name, used for the module source directory
+sname:=tp-smapi
+
+### KERNEL SETUP
+### Setup the stuff needed for making kernel module packages
+### taken from /usr/share/kernel-package/sample.module.rules
+
+# prefix of the target package name
+PACKAGE=tp-smapi-modules
+# modifieable for experiments or debugging m-a
+MA_DIR ?= /usr/share/modass
+# load generic variable handling
+-include $(MA_DIR)/include/generic.make
+# load default rules, including kdist, kdist_image, ...
+-include $(MA_DIR)/include/common-rules.make
+
+# module assistant calculates all needed things for us and sets
+# following variables:
+# KSRC (kernel source directory), KVERS (kernel version string), KDREV
+# (revision of the Debian kernel-image package), CC (the correct
+# compiler), VERSION (the final package version string), PKGNAME (full
+# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
+
+# The kdist_configure target is called by make-kpkg modules_config and
+# by kdist* rules by dependency. It should configure the module so it is
+# ready for compilation (mostly useful for calling configure).
+# prep-deb-files from module-assistant creates the neccessary debian/ files
+kdist_configure: prep-deb-files
+
+# the kdist_clean target is called by make-kpkg modules_clean and from
+# kdist* rules. It is responsible for cleaning up any changes that have
+# been made by the other kdist_commands (except for the .deb files created)
+kdist_clean: clean
+	$(MAKE) $(MFLAGS) -f debian/rules clean
+#
+### end  KERNEL SETUP
+
+# the binary-modules rule is invoked by module-assistant while processing the
+# kdist* targets. It is called by module-assistant or make-kpkg and *not*
+# during a normal build
+binary-modules: prep-deb-files
+	dh_testroot
+	dh_clean -k
+
+	# Build the module
+	$(MAKE) modules KSRC=$(KSRC) KVER=$(KVERS) HDAPS=1
+
+	# Install the module
+	install -D -m 0644 thinkpad_ec.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra/thinkpad_ec.ko
+	install -D -m 0644 tp_smapi.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra/tp_smapi.ko
+	install -D -m 0644 hdaps.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/updates/hdaps.ko
+
+	dh_installdocs README
+	dh_installchangelogs CHANGES
+	dh_installexamples debian/sysfs.conf
+	dh_compress
+	dh_fixperms
+	dh_installmodules
+	dh_installdeb
+	dh_gencontrol -- -v$(VERSION)
+	dh_md5sums
+	dh_builddeb --destdir=$(DEB_DESTDIR)
+	dh_clean -k
+
+clean:
+	dh_testdir
+
+	# Cleaning package
+	$(MAKE) clean
+
+	dh_clean
+
+.PHONY: clean binary-modules kdist kdist_configure kdist_image kdist_clean
--- tp-smapi-0.40.orig/debian/dkms.conf.in
+++ tp-smapi-0.40/debian/dkms.conf.in
@@ -0,0 +1,12 @@
+PACKAGE_NAME="tp-smapi"
+PACKAGE_VERSION="__VERSION__"
+MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
+CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
+AUTOINSTALL=yes
+BUILT_MODULE_NAME[0]="thinkpad_ec"
+BUILT_MODULE_NAME[1]="tp_smapi"
+BUILT_MODULE_NAME[2]="hdaps"
+DEST_MODULE_LOCATION[0]=/extra
+DEST_MODULE_LOCATION[1]=/extra
+DEST_MODULE_LOCATION[2]=/updates
+
--- tp-smapi-0.40.orig/debian/changelog
+++ tp-smapi-0.40/debian/changelog
@@ -0,0 +1,200 @@
+tp-smapi (0.40-9) unstable; urgency=low
+
+  * debian/patches/03_2.6.37-compatibility.patch:
+    + Use DEFINE_SEMAPHORE instead of DECLARE_MUTEX in 2.6.37 and above.
+      Closes: #602367
+      Thanks: Tanaka Watanabe <hellhound.kerberos@gmail.com>
+
+ -- Evgeni Golov <evgeni@debian.org>  Sun, 12 Dec 2010 13:44:06 +0100
+
+tp-smapi (0.40-8) unstable; urgency=low
+
+  * debian/patches/02_X200-T500-support.patch:
+    + Rename to 02_hdaps-orientation-update.patch
+    + Update patch for X201s, T410 and T400s.
+  * debian/control:
+    + Standards-Version: 3.9.1.
+  * debian/source/format:
+    + 1.0 for now.
+
+ -- Evgeni Golov <evgeni@debian.org>  Sun, 01 Aug 2010 18:13:06 +0200
+
+tp-smapi (0.40-7) unstable; urgency=low
+
+  * debian/rules:
+    + Install README and CHANGES into /u/s/d/tp-smapi-dkms/
+      Closes: #562917
+    + We do not need CFLAGS here, remove them.
+  * debian/control:
+    + Add ${misc:Depends} to Depends of tp-smapi-source, thanks lintian.
+  * debian/tp-smapi-dkms.postinst:
+    + Rework building of the module, so it won't fail in the case the
+      correct kernel headers are not available.
+      Closes: #562871
+
+ -- Evgeni Golov <evgeni@debian.org>  Wed, 20 Jan 2010 09:23:26 +0100
+
+tp-smapi (0.40-6) unstable; urgency=low
+
+  * Add DKMS support.
+  * debian/control{,modules.in}:
+    + Standards-Version: 3.8.3.
+  * debian/patches/02_X200-T500-support.patch:
+    + Add invert=1 for T400 too.
+      Closes: #541641.
+  * debian/copyright:
+    + Update my e-mail address.
+
+ -- Evgeni Golov <evgeni@debian.org>  Fri, 25 Dec 2009 18:15:36 +0100
+
+tp-smapi (0.40-5) unstable; urgency=low
+
+  * Fix typo in X200/T500 patch.
+    Thanks Kiko Piris <menorqui@pirispons.net>
+    Closes: #533289
+
+ -- Evgeni Golov <evgeni@debian.org>  Tue, 16 Jun 2009 11:59:02 +0200
+
+tp-smapi (0.40-4) unstable; urgency=low
+
+  * debian/control{,modules.in}:
+    + Update my e-mail address.
+    + Move Vcs-* fields to my new home on Alioth.
+    + Remove DM-Upload-allowed.
+  * debian/patches/02_X200-T500-support.patch:
+    + Add invert quirks for X200 and T500 reported on Launchpad.
+      Closes LP: #374492 and LP: #370289.
+
+ -- Evgeni Golov <evgeni@debian.org>  Tue, 16 Jun 2009 01:26:50 +0200
+
+tp-smapi (0.40-3) unstable; urgency=low
+
+  * debian/control:
+    + Fix typo in Vcs-Browser field.
+    + Bump Standards-Version to 3.8.1.
+    + Move to kernel section.
+  * debian/control.modules.in:
+    + Bump Standards-Version to 3.8.1.
+    + Move to kernel section.
+  * debian/{control,rules,patches/}:
+    + Use quilt instead of dpatch.
+  * debian/patches/99_Makefile-for-Debian.patch:
+    + Don't try to be smart and detect ancient kernels, that breaks.
+      Closes: #521296
+  * debian/rules.modules:
+    + Install hdaps.ko in $(KVERS)/updates/, not $(KVERS)/kernel/updates/.
+      Closes: #522113
+  * debian/rules:
+    + Add README.Debian to tp-smapi.tar.bz2, so it will show up in the
+      built -modules package.
+      Closes: #498207
+  * debian/control{,.modules.in}:
+    + Update descriptions.
+  * debian/copyright:
+    + Update to machine-readable format, update dates etc.
+  * debian/control.moldules.in:
+    + Add Vcs-* headers too.
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Sun, 05 Apr 2009 01:07:56 +0200
+
+tp-smapi (0.40-2) unstable; urgency=low
+
+  * Upload to unstable.
+  * debian/control:
+    + Set DM-Upload-Allowed: yes.
+    + Add Vcs-* headers.
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Sun, 08 Mar 2009 12:06:01 +0100
+
+tp-smapi (0.40-1) experimental; urgency=low
+
+  * New upstream release.
+  * Refresh debian/patches/99_Makefile-for-Debian.dpatch.
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Tue, 16 Dec 2008 09:48:28 +0100
+
+tp-smapi (0.39-1) experimental; urgency=low
+
+  * New upstream release.
+  * Drop 02_fix_semaphore_h_include.dpatch, included upstream.
+  * Refresh 01_include-thinkpad_ec.h-directly.dpatch.
+  * Bump Standards-Version to 3.8.0.
+  * Add README.source.
+  * Move bzip2 from Build-Depends to Build-Depends-Indep.
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Tue, 30 Sep 2008 19:38:49 +0200
+
+tp-smapi (0.37-3) unstable; urgency=low
+
+  * New patch 02_fix_semaphore_h_include.dpatch
+    + Fixes the include of semaphore.h in newer kernels (Closes: #497990).
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Mon, 08 Sep 2008 15:19:45 +0200
+
+tp-smapi (0.37-2) unstable; urgency=low
+
+  * Update 99_Makefile-for-Debian.dpatch to not set CFLAGS (Closes: #476360)
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Wed, 16 Apr 2008 12:55:41 +0200
+
+tp-smapi (0.37-1) unstable; urgency=low
+
+  * New Upstream Version
+  * Drop 02_fix_2.6.25.dpatch, was merged upstream
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Sat, 29 Mar 2008 09:54:31 +0100
+
+tp-smapi (0.36-2) unstable; urgency=low
+
+  * Update 99_Makefile-for-Debian.dpatch
+    tp-smapi is now build-able via linux-modules-extra (Closes: 462952)
+  * Add 02_fix_2.6.25.dpatch
+    Fix build errors with 2.6.25 kernel
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Mon, 11 Feb 2008 16:12:50 +0100
+
+tp-smapi (0.36-1) unstable; urgency=low
+
+  * New upstream release
+    Fixes HDAPS on T/R 61 (Closes: #460060)
+    Adds correct HDAPS orientation for X61 (Closes: #461825)
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Mon, 28 Jan 2008 00:58:22 +0100
+
+tp-smapi (0.34-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Mon, 07 Jan 2008 08:32:37 +0100
+
+tp-smapi (0.33-1) unstable; urgency=low
+
+  * New upstream release
+  * Drop patches/02_Makefile-for-2.6.24.dpatch, upstream supports 2.6.24
+  * Bump to Standards-Version 3.7.3, no changes needed
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Fri, 28 Dec 2007 13:53:40 +0100
+
+tp-smapi (0.32-3) unstable; urgency=low
+
+  * added Homepage-field to debian/control
+  * moved examples/sysfs.conf from -source to -modules
+  * fixed a typo in the long description
+  * fixed the reference to GPL (it's GPL-2, not GPL-3 where GPL links to)
+  * removed an unused file in debian/patches
+  * use 'CFLAGS ?=', not just '='
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Wed, 5 Dec 2007 16:41:00 +0100
+
+tp-smapi (0.32-2) UNRELEASED; urgency=low
+
+  * some cleanups, thanks to Joe Nahmias
+  * make tp-smapi compile against kernels >= 2.6.24
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Tue, 4 Dec 2007 09:49:00 +0100
+
+tp-smapi (0.32-1) UNRELEASED; urgency=low
+
+  * Initial release (Closes: #398533)
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Mon, 6 Aug 2007 23:44:53 +0200
--- tp-smapi-0.40.orig/debian/tp-smapi-dkms.postinst
+++ tp-smapi-0.40/debian/tp-smapi-dkms.postinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+package=tp-smapi-dkms
+name=tp-smapi
+
+version=`dpkg-query -W -f='${Version}' "$package" \
+        |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`
+
+isadded=`dkms status -m "$name" -v "$version"`
+
+if [ "x${isadded}" = "x" ] ; then
+        dkms add -m "$name" -v "$version"
+fi
+
+if [ "$1" = 'configure' ] ; then
+        dkms build -m "$name" -v "$version" && dkms install -m "$name" -v "$version" || true
+fi
+
+#DEBHELPER#
+
+exit 0
+
--- tp-smapi-0.40.orig/debian/tp-smapi-dkms.prerm
+++ tp-smapi-0.40/debian/tp-smapi-dkms.prerm
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+package=tp-smapi-dkms
+name=tp-smapi
+
+version=`dpkg-query -W -f='${Version}' "$package" \
+        |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n"`
+
+dkms remove -m "$name" -v "$version" --all || true
+
+#DEBHELPER#
+
+exit 0
--- tp-smapi-0.40.orig/debian/copyright
+++ tp-smapi-0.40/debian/copyright
@@ -0,0 +1,28 @@
+Format-Specification:
+ http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=454
+Upstream-Name: tp_smapi
+Upstream-Maintainer: JShem Multinymous <multinymous@gmail.com>
+Upstream-Source: http://tpctl.sourceforge.net/
+
+Files: *
+Copyright: © 2006-2009 Shem Multinymous  <multinymous@gmail.com>
+License: GPL-2+
+
+Files: tp_smapi.c
+Copyright: © 2006-2009 Shem Multinymous  <multinymous@gmail.com>
+             SMAPI access code based on the mwave driver by Mike Sullivan
+License: GPL-2+
+
+Files: hdaps.c
+Copyright: © 2005 Robert Love <rml@novell.com>
+Copyright: © 2005 Jesper Juhl <jesper.juhl@gmail.com>
+Copyright: © 2006-2009 Shem Multinymous  <multinymous@gmail.com>
+License: GPL-2
+
+Files: debian/*
+Copyright: © 2006-2009 Evgeni Golov <evgeni@debian.org>
+License: GPL-2+
+
+License: GPL-2 | GPL-2+
+ On Debian systems, the complete text of the GNU General Public License
+ Version 2 can be found in the /usr/share/common-licenses/GPL-2 file.
--- tp-smapi-0.40.orig/debian/tp-smapi-source.links
+++ tp-smapi-0.40/debian/tp-smapi-source.links
@@ -0,0 +1 @@
+/usr/share/modass/packages/default.sh	/usr/share/modass/overrides/tp-smapi-source
--- tp-smapi-0.40.orig/debian/rules
+++ tp-smapi-0.40/debian/rules
@@ -0,0 +1,109 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include /usr/share/quilt/quilt.make
+
+# some default definitions, important!
+#
+# Name of the source package
+psource:=tp-smapi-source
+
+# Name of the dkms package
+pdkms:=tp-smapi-dkms
+
+# The short upstream name, used for the module source directory
+sname:=tp-smapi
+
+sversion:=$(shell dpkg-parsechangelog|grep "^Version:"|cut -d" " -f2|rev|cut -d- -f2-|rev|cut -d':' -f2)
+
+### KERNEL SETUP
+### Setup the stuff needed for making kernel module packages
+### taken from /usr/share/kernel-package/sample.module.rules
+
+# prefix of the target package name
+PACKAGE=tp-smapi-modules
+# modifieable for experiments or debugging m-a
+MA_DIR ?= /usr/share/modass
+# load generic variable handling
+-include $(MA_DIR)/include/generic.make
+# load default rules, including kdist, kdist_image, ...
+-include $(MA_DIR)/include/common-rules.make
+
+# module assistant calculates all needed things for us and sets
+# following variables:
+# KSRC (kernel source directory), KVERS (kernel version string), KDREV
+# (revision of the Debian kernel-image package), CC (the correct
+# compiler), VERSION (the final package version string), PKGNAME (full
+# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
+
+# The kdist_configure target is called by make-kpkg modules_config and
+# by kdist* rules by dependency. It should configure the module so it is
+# ready for compilation (mostly useful for calling configure).
+# prep-deb-files from module-assistant creates the neccessary debian/ files
+kdist_configure: prep-deb-files
+
+# the kdist_clean target is called by make-kpkg modules_clean and from
+# kdist* rules. It is responsible for cleaning up any changes that have
+# been made by the other kdist_commands (except for the .deb files created)
+kdist_clean: clean
+	$(MAKE) $(MFLAGS) -f debian/rules clean
+#
+### end  KERNEL SETUP
+
+build: $(QUILT_STAMPFN)
+
+clean: clean-patched unpatch
+clean-patched:
+	dh_testdir
+
+	dh_clean
+
+install: DH_OPTIONS=
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Create the directories to install the source into
+	dh_installdirs -p$(psource)  usr/src/modules/$(sname)/debian
+	dh_installdirs -p$(pdkms)  usr/src/$(sname)-$(sversion)
+
+	# Copy only the driver source to the proper locations
+	cp -a CHANGES README Makefile *.c *.h debian/$(psource)/usr/src/modules/$(sname)
+	cp -a Makefile *.c *.h debian/$(pdkms)/usr/src/$(sname)-$(sversion)
+
+	# Copy the needed debian/ pieces to the proper location
+	cp debian/*.modules.in* \
+		debian/$(psource)/usr/src/modules/$(sname)/debian
+	cp debian/sysfs.conf debian/control debian/changelog debian/copyright \
+		debian/README.Debian \
+		debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/
+	install -m 0755 debian/rules.modules debian/$(psource)/usr/src/modules/$(sname)/debian/rules
+	cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
+
+	# Prepare dkms.conf from the dkms.conf.in template
+	sed "s/__VERSION__/$(sversion)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(sname)-$(sversion)/dkms.conf
+
+	dh_install
+
+binary-arch: build install
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs -A README
+	dh_installchangelogs -A CHANGES
+	dh_install
+	dh_link
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install kdist kdist_configure kdist_image kdist_clean
--- tp-smapi-0.40.orig/debian/control.modules.in
+++ tp-smapi-0.40/debian/control.modules.in
@@ -0,0 +1,20 @@
+Source: tp-smapi
+Section: kernel
+Priority: optional
+Maintainer: Evgeni Golov <evgeni@debian.org>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.9.1
+Homepage: http://tpctl.sourceforge.net/
+Vcs-Git: git://git.debian.org/git/users/evgeni/tp-smapi.git
+Vcs-Browser: http://git.debian.org/?p=users/evgeni/tp-smapi.git
+
+Package: tp-smapi-modules-_KVERS_
+Architecture: any
+Depends: linux-modules-_KVERS_ | linux-image-_KVERS_
+Provides: tp-smapi-modules
+Suggests: sysfsutils
+Description: ThinkPad hardware/firmware access modules for Linux _KVERS_
+ This package provides the ThinkPad hardware/firmware access modules for
+ the Linux kernel version _KVERS_.
+ .
+ This package also contains the compiled HDAPS modules for _KVERS_.
--- tp-smapi-0.40.orig/debian/README.Debian
+++ tp-smapi-0.40/debian/README.Debian
@@ -0,0 +1,27 @@
+tp-smapi for Debian
+-------------------
+
+WARNING! You can not use stock kernel HDAPS at the same time with tp-smapi!
+         This package builds an improved version of HDAPS, and replace the
+         one in the kernel.
+
+If you have the stock kernel hdaps module loaded, unload it before loading
+tp-smapi, or you'll get errors.
+
+This package only works with kernels >= 2.6.19.
+
+The Debian tp-smapi-source package can be used in several ways,
+
+ - Using module-assistant(1) commands provided by the module-assistant Debian
+   package:
+
+	# module-assistant prepare tp-smapi
+	# module-assistant auto-install tp-smapi
+
+ - Using the make-kpkg(1) command provided by the kernel-package Debian
+   package. See the "modules_image" section of the make-kpkg(1) man page.
+
+ - Unpacking /usr/src/tp-smapi.tar.bz2, compiling and installing the module
+   on your own.
+
+ -- Evgeni Golov <sargentd@die-welt.net>  Fri, 08 Dec 2006 16:56:00 +0100
--- tp-smapi-0.40.orig/debian/gbp.conf
+++ tp-smapi-0.40/debian/gbp.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+pristine-tar = True
+builder=debuild -i\.git -I.git
--- tp-smapi-0.40.orig/debian/README.source
+++ tp-smapi-0.40/debian/README.source
@@ -0,0 +1,2 @@
+This package uses dpatch for patch management, for more information see
+the file /usr/share/doc/dpatch/README.source.gz in the dpatch package.
--- tp-smapi-0.40.orig/debian/watch
+++ tp-smapi-0.40/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://sf.net/tpctl/ tp_smapi-(.+)\.tgz
--- tp-smapi-0.40.orig/debian/patches/01_include-thinkpad_ec.h-directly.patch
+++ tp-smapi-0.40/debian/patches/01_include-thinkpad_ec.h-directly.patch
@@ -0,0 +1,35 @@
+Author: Evgeni Golov <sargentd@die-welt.net>
+Description: include thinkpad_ec.h directly, not via linux/thinkpad_ec.h
+--- tp-smapi.orig/hdaps.c
++++ tp-smapi/hdaps.c
+@@ -34,7 +34,7 @@
+ #include <linux/timer.h>
+ #include <linux/dmi.h>
+ #include <linux/jiffies.h>
+-#include <linux/thinkpad_ec.h>
++#include "thinkpad_ec.h"
+ #include <linux/pci_ids.h>
+ #include <linux/version.h>
+ 
+--- tp-smapi.orig/thinkpad_ec.c
++++ tp-smapi/thinkpad_ec.c
+@@ -34,7 +34,7 @@
+ #include <linux/dmi.h>
+ #include <linux/ioport.h>
+ #include <linux/delay.h>
+-#include <linux/thinkpad_ec.h>
++#include "thinkpad_ec.h"
+ #include <linux/jiffies.h>
+ #include <asm/io.h>
+ 
+--- tp-smapi.orig/tp_smapi.c
++++ tp-smapi/tp_smapi.c
+@@ -42,7 +42,7 @@
+ #include <linux/mc146818rtc.h>	/* CMOS defines */
+ #include <linux/delay.h>
+ #include <linux/version.h>
+-#include <linux/thinkpad_ec.h>
++#include "thinkpad_ec.h"
+ #include <linux/platform_device.h>
+ #include <asm/uaccess.h>
+ #include <asm/io.h>
--- tp-smapi-0.40.orig/debian/patches/03_2.6.37-compatibility.patch
+++ tp-smapi-0.40/debian/patches/03_2.6.37-compatibility.patch
@@ -0,0 +1,41 @@
+From: Tanaka Watanabe <hellhound.kerberos@gmail.com>
+Date: Thu, 4 Nov 2010 18:06:39 +0900
+Subject: use DEFINE_SEMAPHORE in 2.6.37+
+License: GPL-2+
+Bug-Debian: http://bugs.debian.org/602367
+
+Building tp_smapi against 2.6.37 fails because 'DECLARE_MUTEX'
+has been removed in 4882720b267b7b1d1b0ce08334b205f0329d4615
+in torvalds/linux-2.6.git. Use DEFINE_SEMAPHORE instead.
+
+diff --git a/thinkpad_ec.c b/thinkpad_ec.c
+--- a/thinkpad_ec.c
++++ b/thinkpad_ec.c
+@@ -88,7 +88,11 @@ static u64 prefetch_jiffies;
+ #define TPC_PREFETCH_JUNK   (INITIAL_JIFFIES+1)   /*   Ignore prefetch */
+
+ /* Locking: */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+ static DECLARE_MUTEX(thinkpad_ec_mutex);
++#else
++static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
++#endif
+
+ /* Kludge in case the ACPI DSDT reserves the ports we need. */
+ static int force_io;    /* Willing to do IO to ports we couldn't reserve? */
+diff --git a/tp_smapi.c b/tp_smapi.c
+--- a/tp_smapi.c
++++ b/tp_smapi.c
+@@ -109,7 +109,11 @@ static struct { u8 rc; char *msg; int re
+ #define SMAPI_PORT2 0x4F           /* fixed port, meaning unclear */
+ static unsigned short smapi_port;  /* APM control port, normally 0xB2 */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+ static DECLARE_MUTEX(smapi_mutex);
++#else
++static DEFINE_SEMAPHORE(smapi_mutex);
++#endif
+
+ /**
+  * find_smapi_port - read SMAPI port from NVRAM
+
--- tp-smapi-0.40.orig/debian/patches/series
+++ tp-smapi-0.40/debian/patches/series
@@ -0,0 +1,4 @@
+01_include-thinkpad_ec.h-directly.patch
+02_hdaps-orientation-update.patch
+03_2.6.37-compatibility.patch
+99_Makefile-for-Debian.patch
--- tp-smapi-0.40.orig/debian/patches/99_Makefile-for-Debian.patch
+++ tp-smapi-0.40/debian/patches/99_Makefile-for-Debian.patch
@@ -0,0 +1,68 @@
+Author: Evgeni Golov <sargentd@die-welt.net>
+Description: make the Makefile work better with debian kernel-package
+Index: tp-smapi/Makefile
+===================================================================
+--- tp-smapi.orig/Makefile	2009-03-26 16:46:02.000000000 +0100
++++ tp-smapi/Makefile	2009-03-26 17:44:46.000000000 +0100
+@@ -1,12 +1,13 @@
+ ifndef TP_MODULES
+ # This part runs as a normal, top-level Makefile:
+ X:=$(shell false)
+-KVER        := $(shell uname -r)
++PWD         := $(shell pwd)
++#KVER        := $(shell uname -r)
+ KBASE       := /lib/modules/$(KVER)
+-KSRC        := $(KBASE)/source
+-KBUILD      := $(KBASE)/build
++KSRC        ?= $(PWD)
++#KBUILD      := $(KBASE)/build
++KBUILD      := $(KSRC)
+ MOD_DIR     := $(KBASE)/kernel
+-PWD         := $(shell pwd)
+ IDIR        := include/linux
+ TP_DIR      := drivers/misc
+ TP_MODULES  := thinkpad_ec.o tp_smapi.o
+@@ -25,18 +26,24 @@
+ THINKPAD_EC_PARAM := 
+ endif
+ 
++ifneq ($(KERNELRELEASE),)
++	TP_MODULES  += hdaps.o
++	obj-m  := $(TP_MODULES)
++else
++endif
+ DEBUG := 0
+ 
+-ifneq ($(shell [ -f $(KBUILD)/include/linux/aio_abi.h ] && echo 1),1)
+-$(warning Building tp_smapi requires Linux kernel 2.6.19 or newer, and matching kernel headers.)
+-$(warning You may need to override the following Make variables:)
+-$(warning .   KVER=$(KVER))
+-$(warning .   KBUILD=$(KBUILD))
+-$(warning .   MOD_DIR=$(MOD_DIR))
+-$(warning For "make patch", you may also need the full kernel sources, and may need to override:)
+-$(warning .   KSRC=$(KSRC))
+-$(error Missing kernel headers)
+-endif
++# We have 2.6.26 in stable - don't care for 2.6.19
++#ifneq ($(shell [ -f $(KBUILD)/include/linux/aio_abi.h ] && echo 1),1)
++#$(warning Building tp_smapi requires Linux kernel 2.6.19 or newer, and matching kernel headers.)
++#$(warning You may need to override the following Make variables:)
++#$(warning .   KVER=$(KVER))
++#$(warning .   KBUILD=$(KBUILD))
++#$(warning .   MOD_DIR=$(MOD_DIR))
++#$(warning For "make patch", you may also need the full kernel sources, and may need to override:)
++#$(warning .   KSRC=$(KSRC))
++#$(error Missing kernel headers)
++#endif
+ 
+ .PHONY: default clean modules load unload install patch check_hdaps mk-hdaps.diff
+ export TP_MODULES
+@@ -94,7 +101,7 @@
+ #####################################################################
+ # Generate a stand-alone kernel patch
+ 
+-TP_VER := ${shell sed -ne 's/^\#define TP_VERSION \"\(.*\)\"/\1/gp' tp_smapi.c}
++#TP_VER := ${shell sed -ne 's/^\#define TP_VERSION \"\(.*\)\"/\1/gp' tp_smapi.c}
+ ORG    := a
+ NEW    := b
+ PATCH  := tp_smapi-$(TP_VER)-for-$(KVER).patch
--- tp-smapi-0.40.orig/debian/patches/02_hdaps-orientation-update.patch
+++ tp-smapi-0.40/debian/patches/02_hdaps-orientation-update.patch
@@ -0,0 +1,25 @@
+From: Evgeni Golov <evgeni@debian.org>
+Date: 2009-06-15 20:54:14 +0200
+Subject: Add T500 and X200 invert quirks
+License: GPL-2+
+
+Based on patch by Jouston Huang 
+from https://bugs.launchpad.net/ubuntu/+source/tp-smapi/+bug/370289
+
+Index: tp-smapi/hdaps.c
+===================================================================
+--- tp-smapi.orig/hdaps.c	2010-06-20 11:25:26.344528405 +0200
++++ tp-smapi/hdaps.c	2010-06-20 11:25:40.604572528 +0200
+@@ -750,6 +750,12 @@
+ 	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60s", HDAPS_ORIENT_INVERT_Y),
+ 	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X60", HDAPS_ORIENT_SWAP | HDAPS_ORIENT_INVERT_X),
+ 	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61", HDAPS_ORIENT_SWAP | HDAPS_ORIENT_INVERT_X),
++	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T400s", HDAPS_ORIENT_INVERT_X),
++	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T400", HDAPS_ORIENT_INVERT_XY),
++	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T410", HDAPS_ORIENT_INVERT_XY),
++	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad T500", HDAPS_ORIENT_INVERT_XY),
++	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X200", HDAPS_ORIENT_SWAP | HDAPS_ORIENT_INVERT_X | HDAPS_ORIENT_INVERT_Y),
++	HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X201s", HDAPS_ORIENT_SWAP | HDAPS_ORIENT_INVERT_XY),
+ 	{ .ident = NULL }
+ };
+ 
--- tp-smapi-0.40.orig/debian/source/format
+++ tp-smapi-0.40/debian/source/format
@@ -0,0 +1 @@
+1.0