summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhavner2006-08-13 19:45:34 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commit3f2a8f3fa411401d101a5e7d00026d6a7de35b6b (patch)
treeffd8627b70f48cd02a61cfeba440b52671df13eb
parent7902305ea4ce66a737ea53232070d22953697933 (diff)
downloadkernel-misc-tp_smapi-3f2a8f3fa411401d101a5e7d00026d6a7de35b6b.zip
kernel-misc-tp_smapi-3f2a8f3fa411401d101a5e7d00026d6a7de35b6b.tar.gz
- builds & other changes to finish this spec
Changed files: kernel-misc-tp_smapi.spec -> 1.3
-rw-r--r--kernel-misc-tp_smapi.spec75
1 files changed, 46 insertions, 29 deletions
diff --git a/kernel-misc-tp_smapi.spec b/kernel-misc-tp_smapi.spec
index 44e1af9..39ea393 100644
--- a/kernel-misc-tp_smapi.spec
+++ b/kernel-misc-tp_smapi.spec
@@ -1,32 +1,32 @@
-# TODO:
-# - make it build
-# - wouldn't it be better to replace this spec with a kernel patch ?
-##
+#
+# TODO (kernel):
+# add dmi-decode-and-save-oem-string-information.patch
+# remove hdaps patch (as its provided here and updated more often i think)
+#
# Conditional build:
%bcond_without dist_kernel # allow non-distribution kernel
%bcond_without smp # don't build SMP module
%bcond_with verbose # verbose build (V=1)
-%if %{without kernel}
-%undefine with_dist_kernel
-%endif
-
-#
-# main package.
-#
%define _rel 0.1
Summary: sysfs interface to access ThinkPad's SMAPI functionality
Summary(pl): Interfejs sysfs do funkcjonalności SMAPI ThinkPadów
-Name: kernel-misc-tp_smapi
-Version: 0.19
+Name: kernel%{_alt_kernel}-misc-tp_smapi
+Version: 0.27
Release: %{_rel}
-License: GPL
+License: GPL v2
Group: Applications
Source0: http://dl.sourceforge.net/tpctl/tp_smapi-%{version}.tgz
-# Source0-md5: fdb192b59e05bb826c4ca05a39b42649
+# Source0-md5: ca653a14bed809462066aca842776108
URL: http://tpctl.sourceforge.net/
-%{?with_dist_kernel:BuildRequires: kernel-module-build >= 3:2.6.14}
+%if %{with dist_kernel}
+BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.14}
+%requires_releq_kernel_up
+Requires(postun): %releq_kernel_up
+%endif
BuildRequires: rpmbuild(macros) >= 1.286
+Requires(post,postun): /sbin/depmod
+ExclusiveArch: %{ix86}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -39,7 +39,7 @@ Interfejs sysfs do funkcjonalności SMAPI ThinkPadów.
Ten pakiet zawiera moduł jądra Linuksa.
-%package -n kernel-smp-misc-tp_smapi
+%package -n kernel%{_alt_kernel}-smp-misc-tp_smapi
Summary: Linux SMP driver for tp_smapi
Summary(pl): Sterownik dla Linuksa SMP do tp_smapi
Release: %{_rel}@%{_kernel_ver_str}
@@ -49,19 +49,25 @@ Requires(post,postun): /sbin/depmod
%requires_releq_kernel_smp
Requires(postun): %releq_kernel_smp
%endif
+Requires(post,postun): /sbin/depmod
-%description -n kernel-smp-misc-tp_smapi
+%description -n kernel%{_alt_kernel}-smp-misc-tp_smapi
sysfs interface to access ThinkPad's SMAPI functionality.
This package contains Linux SMP module.
-%description -n kernel-smp-misc-tp_smapi -l pl
+%description -n kernel%{_alt_kernel}-smp-misc-tp_smapi -l pl
Interfejs sysfs do funkcjonalności SMAPI ThinkPadów.
Ten pakiet zawiera moduł jądra Linuksa SMP.
%prep
%setup -q -n tp_smapi-%{version}
+echo "obj-m := thinkpad_ec.o tp_smapi.o hdaps.o" > Makefile
+# following NEEDS to be removed and kernel patched with
+# dmi-decode-and-save-oem-string-information.patch from tp_smapi sources
+# DONT use this driver if [ "`dmidecode | grep 'IBM ThinkPad Embedded Controller'`" == "" ]
+echo '#define DMI_EC_OEM_STRING_KLUDGE "IBM ThinkPad Embedded Controller"' > dmi_ec_oem_string.h
%build
# kernel module(s)
@@ -73,6 +79,7 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}
ln -sf %{_kernelsrcdir}/config-$cfg o/.config
ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
+ ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} o/include/asm
%if %{with dist_kernel}
%{__make} -C %{_kernelsrcdir} O=$PWD/o prepare scripts
%else
@@ -83,16 +90,14 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}
#
# patching/creating makefile(s) (optional)
#
- %{__make} -C %{_kernelsrcdir} \
- TP_VER="%{version}" \
- CFLAGS="%{rpmcflags} -Iinclude/" \
+ %{__make} -C %{_kernelsrcdir} clean \
RCS_FIND_IGNORE="-name '*.ko' -o" \
SYSSRC=%{_kernelsrcdir} \
SYSOUT=$PWD/o \
M=$PWD O=$PWD/o \
%{?with_verbose:V=1}
%{__make} -C %{_kernelsrcdir} modules \
- CFLAGS="%{rpmcflags} -Iinclude/" \
+ CFLAGS="%{rpmcflags} -I$PWD/include -I$PWD/o/include/asm/mach-default" \
CC="%{__cc}" CPP="%{__cpp}" \
SYSSRC=%{_kernelsrcdir} \
SYSOUT=$PWD/o \
@@ -100,6 +105,8 @@ for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}
%{?with_verbose:V=1}
mv tp_smapi{,-$cfg}.ko
+ mv thinkpad_ec{,-$cfg}.ko
+ mv hdaps{,-$cfg}.ko
done
%install
@@ -108,32 +115,42 @@ rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
install tp_smapi-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/tp_smapi.ko
+install thinkpad_ec-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
+ $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/thinkpad_ec.ko
+install hdaps-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
+ $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/hdaps.ko
%if %{with smp} && %{with dist_kernel}
install tp_smapi-smp.ko \
$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/tp_smapi.ko
+install thinkpad_ec-smp.ko \
+ $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/thinkpad_ec.ko
+install hdpaps-smp.ko \
+ $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/hdaps.ko
%endif
%clean
rm -rf $RPM_BUILD_ROOT
-%post -n kernel-misc-tp_smapi
+%post
%depmod %{_kernel_ver}
-%postun -n kernel-misc-tp_smapi
+%postun
%depmod %{_kernel_ver}
-%post -n kernel-smp-misc-tp_smapi
+%post -n kernel%{_alt_kernel}-smp-misc-tp_smapi
%depmod %{_kernel_ver}smp
-%postun -n kernel-smp-misc-tp_smapi
+%postun -n kernel%{_alt_kernel}-smp-misc-tp_smapi
%depmod %{_kernel_ver}smp
-%files -n kernel-misc-tp_smapi
+%files -n kernel%{_alt_kernel}-misc-tp_smapi
%defattr(644,root,root,755)
+%doc CHANGES README
/lib/modules/%{_kernel_ver}/misc/*.ko*
%if %{with smp} && %{with dist_kernel}
-%files -n kernel-smp-misc-tp_smapi
+%files -n kernel%{_alt_kernel}-smp-misc-tp_smapi
%defattr(644,root,root,755)
+%doc CHANGES README
/lib/modules/%{_kernel_ver}smp/misc/*.ko*
%endif