Hello,

find a patch attached.

Regards
   Klaus
-- 
Klaus Ethgen                                       http://www.ethgen.ch/
pub  4096R/4E20AF1C 2011-05-16            Klaus Ethgen <[email protected]>
Fingerprint: 85D4 CA42 952C 949B 1753  62B3 79D0 B06F 4E20 AF1C
>From ef7da7f1308edd5f86ead946504b113205527252 Mon Sep 17 00:00:00 2001
From: Klaus Ethgen <[email protected]>
Date: Fri, 28 Oct 2016 12:08:39 +0100
Subject: [PATCH] Revert "do not build tp-smapi-source anymore"

This reverts commit 10e412bd72cebb3048742c3184b174c026441624.

Signed-off-by: Klaus Ethgen <[email protected]>
---
 debian/control               | 18 +++++++++
 debian/control.modules.in    | 20 ++++++++++
 debian/rules                 | 11 ++++++
 debian/rules.modules         | 91 ++++++++++++++++++++++++++++++++++++++++++++
 debian/tp-smapi-source.links |  1 +
 5 files changed, 141 insertions(+)
 create mode 100644 debian/control.modules.in
 create mode 100644 debian/rules.modules
 create mode 100644 debian/tp-smapi-source.links

diff --git a/debian/control b/debian/control
index a7f34b7..4752d83 100644
--- a/debian/control
+++ b/debian/control
@@ -9,6 +9,24 @@ Homepage: https://github.com/evgeni/tp_smapi/
 Vcs-Git: https://anonscm.debian.org/git/users/evgeni/tp-smapi.git
 Vcs-Browser: https://anonscm.debian.org/git/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: ${misc:Depends}
diff --git a/debian/control.modules.in b/debian/control.modules.in
new file mode 100644
index 0000000..6dbc114
--- /dev/null
+++ b/debian/control.modules.in
@@ -0,0 +1,20 @@
+Source: tp-smapi
+Section: kernel
+Priority: optional
+Maintainer: Evgeni Golov <[email protected]>
+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_.
diff --git a/debian/rules b/debian/rules
index 06c6eaa..a36a3fb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,4 +15,15 @@ override_dh_auto_build:
 
 override_dh_auto_install:
 	mkdir -p $(CURDIR)/debian/tp-smapi-dkms/usr/src/tp_smapi-$(DEB_VERSION_UPSTREAM)
+	mkdir -p $(CURDIR)/debian/tp-smapi-source/usr/src/modules/tp-smapi/debian
 	cp -a Makefile *.c *.h debian/tp-smapi-dkms/usr/src/tp_smapi-$(DEB_VERSION_UPSTREAM)
+	cp -a CHANGES README Makefile *.c *.h debian/tp-smapi-source/usr/src/modules/tp-smapi
+
+	# Copy the needed debian/ pieces to the proper location
+	cp debian/*.modules.in* \
+		debian/tp-smapi-source/usr/src/modules/tp-smapi/debian
+	cp debian/sysfs.conf debian/control debian/changelog debian/copyright \
+		debian/README.Debian \
+		debian/compat debian/tp-smapi-source/usr/src/modules/tp-smapi/debian/
+	install -m 0755 debian/rules.modules debian/tp-smapi-source/usr/src/modules/tp-smapi/debian/rules
+	cd debian/tp-smapi-source/usr/src && tar --mtime="$(BUILD_DATE)" -c modules | bzip2 -9 > tp-smapi.tar.bz2 && rm -rf modules
diff --git a/debian/rules.modules b/debian/rules.modules
new file mode 100644
index 0000000..b9d21e4
--- /dev/null
+++ b/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
diff --git a/debian/tp-smapi-source.links b/debian/tp-smapi-source.links
new file mode 100644
index 0000000..f272f62
--- /dev/null
+++ b/debian/tp-smapi-source.links
@@ -0,0 +1 @@
+/usr/share/modass/packages/default.sh	/usr/share/modass/overrides/tp-smapi-source
-- 
2.10.1

Attachment: signature.asc
Description: PGP signature

Reply via email to