]> git.pld-linux.org Git - SPECS.git/blob - kernel-misc-thinkpad.spec
SPECS updated Sun 1 Aug 20:13:02 CEST 2021
[SPECS.git] / kernel-misc-thinkpad.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_without  smp             # don't build SMP module
5 %bcond_with     verbose         # verbose build (V=1)
6
7 %define         _name thinkpad
8 %define         _rel 1
9 Summary:        Linux drivers for ThinkPad laptops
10 Summary(pl.UTF-8):      Sterowniki dla Linuksa do laptopów ThinkPad
11 Name:           kernel%{_alt_kernel}-misc-thinkpad
12 Version:        6.0
13 Release:        %{_rel}@%{_kernel_ver_str}
14 License:        GPL v2
15 Group:          Base/Kernel
16 Source0:        http://dl.sourceforge.net/tpctl/%{_name}_%{version}.tar.gz
17 # Source0-md5:  d6549f4fe51f594a20d1498f06def010
18 URL:            http://tpctl.sourceforge.net/
19 BuildRequires:  rpmbuild(macros) >= 1.308
20 %if %{with dist_kernel}
21 BuildRequires:  kernel%{_alt_kernel}-module-build >= 3:2.6.14}
22 %requires_releq_kernel_up
23 Requires(postun):       %releq_kernel_up
24 %endif
25 Requires(post,postun):  /sbin/depmod
26 ExclusiveArch:  %{ix86}
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 These are drivers for ThinkPad laptops for Linux.
31
32 This package contains Linux modules.
33
34 %description -l pl.UTF-8
35 Sterowniki dla Linuksa do laptopów ThinkPad.
36
37 Ten pakiet zawiera moduły jądra Linuksa.
38
39 %package -n kernel%{_alt_kernel}-smp-misc-thinkpad
40 Summary:        Linux SMP drivers for ThinkPad laptops
41 Summary(pl.UTF-8):      Sterowniki dla Linuksa SMP do laptotów ThinkPad
42 Group:          Base/Kernel
43 Requires(post,postun):  /sbin/depmod
44 %if %{with dist_kernel}
45 %requires_releq_kernel_smp
46 Requires(postun):       %releq_kernel_smp
47 %endif
48 Requires(post,postun):  /sbin/depmod
49
50 %description -n kernel%{_alt_kernel}-smp-misc-thinkpad
51 These are drivers for ThinkPad laptops for Linux.
52
53 This package contains Linux SMP modules.
54
55 %description -n kernel%{_alt_kernel}-smp-misc-thinkpad -l pl.UTF-8
56 Sterowniki dla Linuksa do laptopów ThinkPad.
57
58 Ten pakiet zawiera moduły jądra Linuksa SMP.
59
60 %prep
61 %setup -q -n %{_name}-%{version}
62
63 %build
64 _PWD=`pwd`
65 cd 2.6/drivers
66 # kernel module(s)
67 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
68         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
69                 exit 1
70         fi
71         install -d o/include/linux
72         ln -sf %{_kernelsrcdir}/config-$cfg o/.config
73         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg o/Module.symvers
74         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
75         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} o/include/asm
76 %if %{with dist_kernel}
77         %{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
78 %else
79         install -d o/include/config
80         touch o/include/config/MARKER
81         ln -sf %{_kernelsrcdir}/scripts o/scripts
82 %endif
83 #
84 #       patching/creating makefile(s) (optional)
85 #
86         %{__make} -C %{_kernelsrcdir} clean \
87                 RCS_FIND_IGNORE="-name '*.ko' -o -name '*.s' -o" \
88                 SYSSRC=%{_kernelsrcdir} \
89                 SYSOUT=$PWD/o \
90                 M=$PWD O=$PWD/o \
91                 %{?with_verbose:V=1}
92         %{__make} -C %{_kernelsrcdir} modules \
93                 EXTRA_CFLAGS="-I$PWD/../include -DLINUX" \
94                 CC="%{__cc}" CPP="%{__cpp}" \
95                 SYSSRC=%{_kernelsrcdir} \
96                 SYSOUT=$PWD/o \
97                 M=$PWD O=$PWD/o \
98                 %{?with_verbose:V=1}
99
100         mv thinkpad{,-$cfg}.ko
101         mv smapi{,-$cfg}.ko
102         mv superio{,-$cfg}.ko
103         mv rtcmosram{,-$cfg}.ko
104 done
105 cd $_PWD
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT%{_mandir}/man4
110 install man/thinkpad.4 $RPM_BUILD_ROOT%{_mandir}/man4
111
112 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc/thinkpad
113 install 2.6/drivers/thinkpad-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
114         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/thinkpad/thinkpad.ko
115 install 2.6/drivers/smapi-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
116         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/thinkpad/smapi.ko
117 install 2.6/drivers/superio-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
118         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/thinkpad/superio.ko
119 install 2.6/drivers/rtcmosram-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
120         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/thinkpad/rtcmosram.ko
121 %if %{with smp} && %{with dist_kernel}
122 install 2.6/driver/thinkpad-smp.ko \
123         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/thinkpad/thinkpad.ko
124 install 2.6/driver/smapi-smp.ko \
125         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/thinkpad/smapi.ko
126 install 2.6/driver/superio-smp.ko \
127         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/thinkpad/superio.ko
128 install 2.6/driver/rtcmosram-smp.ko \
129         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/thinkpad/rtcmosram.ko
130 %endif
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %post
136 %depmod %{_kernel_ver}
137
138 %postun
139 %depmod %{_kernel_ver}
140
141 %post   -n kernel%{_alt_kernel}-smp-misc-thinkpad
142 %depmod %{_kernel_ver}smp
143
144 %postun -n kernel%{_alt_kernel}-smp-misc-thinkpad
145 %depmod %{_kernel_ver}smp
146
147 %files
148 %defattr(644,root,root,755)
149 %doc AUTHORS ChangeLog README SUPPORTED-MODELS TECHNOTES
150 /lib/modules/%{_kernel_ver}/misc/thinkpad
151 %{_mandir}/man4/thinkpad.4*
152
153 %if %{with smp} && %{with dist_kernel}
154 %files -n kernel%{_alt_kernel}-smp-misc-thinkpad
155 %defattr(644,root,root,755)
156 %doc AUTHORS ChangeLog README SUPPORTED-MODELS TECHNOTES
157 /lib/modules/%{_kernel_ver}smp/misc/thinkpad
158 # i know it would get double packed when up & smp installed, but rpm handles this
159 %{_mandir}/man4/thinkpad.4*
160 %endif
This page took 0.064195 seconds and 3 git commands to generate.