--- 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)/kernel/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/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/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 Fri, 08 Dec 2006 16:56:00 +0100 --- tp-smapi-0.40.orig/debian/control.modules.in +++ tp-smapi-0.40/debian/control.modules.in @@ -0,0 +1,17 @@ +Source: tp-smapi +Section: utils +Priority: optional +Maintainer: Evgeni Golov +Build-Depends: debhelper (>= 5) +Standards-Version: 3.7.3 +Homepage: http://tpctl.sourceforge.net/ + +Package: tp-smapi-modules-_KVERS_ +Architecture: any +Depends: linux-modules-_KVERS_ | linux-image-_KVERS_ +Provides: tp-smapi-modules +Suggests: sysfsutils +Description: tp_smapi modules for Linux (kernel _KVERS_) + This package contains the compiled kernel modules for _KVERS_ + . + This package also contains the compiled HDAPS modules for _KVERS_ --- tp-smapi-0.40.orig/debian/rules +++ tp-smapi-0.40/debian/rules @@ -0,0 +1,105 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/dpatch/dpatch.make + +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 + +build: patch-stamp + +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 + + # Copy only the driver source to the proper location + cp -a CHANGES README Makefile *.c *.h debian/$(psource)/usr/src/modules/$(sname) + # 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/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 + + dh_install + +binary-arch: build install + +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs README + dh_installchangelogs 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 +++ tp-smapi-0.40/debian/control @@ -0,0 +1,23 @@ +Source: tp-smapi +Section: misc +Priority: optional +Maintainer: Evgeni Golov +Build-Depends: debhelper (>= 5), dpatch +Build-Depends-Indep: bzip2 +Standards-Version: 3.8.0 +Homepage: http://tpctl.sourceforge.net/ + +Package: tp-smapi-source +Architecture: all +Depends: debhelper (>= 5), module-assistant +Suggests: sysfsutils +Description: Source for the tp_smapi kernel modules + 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) --- 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/changelog +++ tp-smapi-0.40/debian/changelog @@ -0,0 +1,92 @@ +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.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/copyright +++ tp-smapi-0.40/debian/copyright @@ -0,0 +1,76 @@ +This package was debianized by Evgeni Golov on +Fri, 08 Dec 2006 16:56:00 +0100. + +It was downloaded from . + +Upstream Author: Shem Multinymous + +Licence (except hdaps.c and tp_smapi.c): + + Copyright (c) 2006 by Shem Multinymous + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL-2 file. + +Licence (tp_smapi.c): + + Copyright (c) 2006 by Shem Multinymous + SMAPI access code based on the mwave driver by Mike Sullivan + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL-2 file. + +Licence (hdaps.c): + + Copyright (C) 2005 Robert Love + Copyright (C) 2005 Jesper Juhl + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License v2 as published + by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL-2 file. + +The Debian packaging is (C) 2006-2007, Evgeni Golov +and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- tp-smapi-0.40.orig/debian/compat +++ tp-smapi-0.40/debian/compat @@ -0,0 +1 @@ +5 --- tp-smapi-0.40.orig/debian/patches/99_Makefile-for-Debian.dpatch +++ tp-smapi-0.40/debian/patches/99_Makefile-for-Debian.dpatch @@ -0,0 +1,48 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 99_Makefile-for-Debian.dpatch by Evgeni Golov +## +## DP: make the Makefile work better with debian kernel-package + +@DPATCH@ + +--- tp-smapi_0.40.orig/Makefile 2008-12-16 09:45:04.000000000 +0100 ++++ tp-smapi_0.40/Makefile 2008-12-16 09:45:21.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,6 +26,11 @@ + 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) +@@ -94,7 +100,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/01_include-thinkpad_ec.h-directly.dpatch +++ tp-smapi-0.40/debian/patches/01_include-thinkpad_ec.h-directly.dpatch @@ -0,0 +1,43 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_include-thinkpad_ec.h-directly.dpatch by Evgeni Golov +## +## DP: include thinkpad_ec.h directly, not via linux/thinkpad_ec.h + +@DPATCH@ + +diff -Nrwu tp_smapi-0.39.orig/hdaps.c tp_smapi-0.39/hdaps.c +--- tp_smapi-0.39.orig/hdaps.c 2008-09-27 19:55:45.000000000 +0200 ++++ tp_smapi-0.39/hdaps.c 2008-09-30 18:35:34.000000000 +0200 +@@ -34,7 +34,7 @@ + #include + #include + #include +-#include ++#include "thinkpad_ec.h" + #include + #include + +diff -Nrwu tp_smapi-0.39.orig/thinkpad_ec.c tp_smapi-0.39/thinkpad_ec.c +--- tp_smapi-0.39.orig/thinkpad_ec.c 2008-09-27 19:55:45.000000000 +0200 ++++ tp_smapi-0.39/thinkpad_ec.c 2008-09-30 18:35:58.000000000 +0200 +@@ -34,7 +34,7 @@ + #include + #include + #include +-#include ++#include "thinkpad_ec.h" + #include + #include + +diff -Nrwu tp_smapi-0.39.orig/tp_smapi.c tp_smapi-0.39/tp_smapi.c +--- tp_smapi-0.39.orig/tp_smapi.c 2008-09-27 19:55:45.000000000 +0200 ++++ tp_smapi-0.39/tp_smapi.c 2008-09-30 18:35:45.000000000 +0200 +@@ -42,7 +42,7 @@ + #include /* CMOS defines */ + #include + #include +-#include ++#include "thinkpad_ec.h" + #include + #include + #include --- tp-smapi-0.40.orig/debian/patches/00list +++ tp-smapi-0.40/debian/patches/00list @@ -0,0 +1,2 @@ +01_include-thinkpad_ec.h-directly.dpatch +99_Makefile-for-Debian.dpatch