--- tp-smapi-0.41.orig/debian/tp-smapi-source.links +++ tp-smapi-0.41/debian/tp-smapi-source.links @@ -0,0 +1 @@ +/usr/share/modass/packages/default.sh /usr/share/modass/overrides/tp-smapi-source --- tp-smapi-0.41.orig/debian/compat +++ tp-smapi-0.41/debian/compat @@ -0,0 +1 @@ +5 --- tp-smapi-0.41.orig/debian/watch +++ tp-smapi-0.41/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/tpctl/ tp_smapi-(.+)\.tgz --- tp-smapi-0.41.orig/debian/sysfs.conf +++ tp-smapi-0.41/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.41.orig/debian/rules +++ tp-smapi-0.41/debian/rules @@ -0,0 +1,110 @@ +#!/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 debian/README.Debian + dh_installchangelogs -A CHANGES + dh_installexamples -A debian/sysfs.conf + 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.41.orig/debian/tp-smapi-dkms.postinst +++ tp-smapi-0.41/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.41.orig/debian/README.source +++ tp-smapi-0.41/debian/README.source @@ -0,0 +1,5 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +Please see /usr/share/doc/quilt/README.source for a full documentation. --- tp-smapi-0.41.orig/debian/tp-smapi-dkms.prerm +++ tp-smapi-0.41/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.41.orig/debian/dkms.conf.in +++ tp-smapi-0.41/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.41.orig/debian/changelog +++ tp-smapi-0.41/debian/changelog @@ -0,0 +1,218 @@ +tp-smapi (0.41-1) unstable; urgency=low + + * New "upstream" release. + + Droping all patches but the debian specific one. + + Supports Sandy Bridge ThinkPads. Closes: #628829, #635650 + * README.source should point to quilt doc (since 0.40-3!) + * Install README.Debian in the dkms package too, thanks rhalina! + * Standards-Version: 3.9.2 + * Install the sysfs.conf example in -dkms and -source too. + + -- Evgeni Golov Fri, 29 Jul 2011 12:33:50 +0200 + +tp-smapi (0.40-10) UNRELEASED; urgency=low + + * Update 02_hdaps-orientation-update.patch for X201 and X201t. + + -- Evgeni Golov Fri, 04 Feb 2011 10:12:13 +0100 + +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 + + -- Evgeni Golov 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 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 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 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 + Closes: #533289 + + -- Evgeni Golov 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 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 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 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 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 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 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 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 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 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 Mon, 28 Jan 2008 00:58:22 +0100 + +tp-smapi (0.34-1) unstable; urgency=low + + * New upstream release + + -- Evgeni Golov 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 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 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 Tue, 4 Dec 2007 09:49:00 +0100 + +tp-smapi (0.32-1) UNRELEASED; urgency=low + + * Initial release (Closes: #398533) + + -- Evgeni Golov Mon, 6 Aug 2007 23:44:53 +0200 --- tp-smapi-0.41.orig/debian/gbp.conf +++ tp-smapi-0.41/debian/gbp.conf @@ -0,0 +1,3 @@ +[DEFAULT] +pristine-tar = True +builder=debuild -i\.git -I.git --- tp-smapi-0.41.orig/debian/control.modules.in +++ tp-smapi-0.41/debian/control.modules.in @@ -0,0 +1,20 @@ +Source: tp-smapi +Section: kernel +Priority: optional +Maintainer: Evgeni Golov +Build-Depends: debhelper (>= 5) +Standards-Version: 3.9.2 +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.41.orig/debian/rules.modules +++ tp-smapi-0.41/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.41.orig/debian/control +++ tp-smapi-0.41/debian/control @@ -0,0 +1,45 @@ +Source: tp-smapi +Section: kernel +Priority: optional +Maintainer: Evgeni Golov +Build-Depends: debhelper (>= 5), quilt (>= 0.40) +Build-Depends-Indep: bzip2 +Standards-Version: 3.9.2 +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.41.orig/debian/README.Debian +++ tp-smapi-0.41/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 Fri, 08 Dec 2006 16:56:00 +0100 --- tp-smapi-0.41.orig/debian/copyright +++ tp-smapi-0.41/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 +Upstream-Source: http://tpctl.sourceforge.net/ + +Files: * +Copyright: © 2006-2009 Shem Multinymous +License: GPL-2+ + +Files: tp_smapi.c +Copyright: © 2006-2009 Shem Multinymous + SMAPI access code based on the mwave driver by Mike Sullivan +License: GPL-2+ + +Files: hdaps.c +Copyright: © 2005 Robert Love +Copyright: © 2005 Jesper Juhl +Copyright: © 2006-2009 Shem Multinymous +License: GPL-2 + +Files: debian/* +Copyright: © 2006-2009 Evgeni Golov +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.41.orig/debian/patches/99_Makefile-for-Debian.patch +++ tp-smapi-0.41/debian/patches/99_Makefile-for-Debian.patch @@ -0,0 +1,46 @@ +Author: Evgeni Golov +Description: make the Makefile work better with debian kernel-package +Index: tp-smapi/Makefile +=================================================================== +--- tp-smapi.orig/Makefile 2011-07-28 19:10:45.000000000 +0200 ++++ tp-smapi/Makefile 2011-07-28 19:18:07.936579754 +0200 +@@ -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,6 +26,12 @@ + THINKPAD_EC_PARAM := + endif + ++ifneq ($(KERNELRELEASE),) ++ TP_MODULES += hdaps.o ++ obj-m := $(TP_MODULES) ++else ++endif ++ + DEBUG := 0 + + .PHONY: default clean modules load unload install patch check_hdaps mk-hdaps.diff +@@ -83,7 +90,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.41.orig/debian/patches/series +++ tp-smapi-0.41/debian/patches/series @@ -0,0 +1 @@ +99_Makefile-for-Debian.patch --- tp-smapi-0.41.orig/debian/source/format +++ tp-smapi-0.41/debian/source/format @@ -0,0 +1 @@ +1.0