]> git.pld-linux.org Git - projects/template-specs.git/blob - kernel-module.spec
- BR += kernel-module-build.
[projects/template-specs.git] / kernel-module.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # allow non-distribution kernel
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_without  smp             # don't build SMP module
6 %bcond_without  userspace       # don't build userspace module
7 %bcond_with     verbose         # verbose build (V=1)
8
9 #
10 # main package.
11 #
12 BuildRequires:  kernel-module-build >= 2.6.7
13
14 # kernel subpackages.
15
16 %package -n kernel-...
17 Summary:        Linux driver for ...
18 Summary(pl):    Sterownik dla Linuksa do ...
19 Release:        %{_rel}@%{_kernel_ver_str}
20 Group:          Base/Kernel
21 BuildRequires:  rpmbuild(macros) >= 1.153
22 %if %{with dist_kernel}
23 BuildRequires:  kernel-module-build >= 2.6.7
24 %requires_releq_kernel_up
25 %endif
26 Requires(post,postun):  /sbin/depmod
27
28 %description -n kernel-smp-...
29 This is driver for ... for Linux.
30
31 This package contains Linux module.
32
33 %description -n kernel-smp-... -l pl
34 Sterownik dla Linuksa do ...
35
36 Ten pakiet zawiera modu³ j±dra Linuksa.
37
38 %package -n kernel-smp-...
39 Summary:        Linux SMP driver for ...
40 Summary(pl):    Sterownik dla Linuksa SMP do ...
41 Release:        %{_rel}@%{_kernel_ver_str}
42 Group:          Base/Kernel
43 BuildRequires:  rpmbuild(macros) >= 1.153
44 %if %{with dist_kernel}
45 BuildRequires:  kernel-module-build >= 2.6.7
46 %requires_releq_kernel_smp
47 %endif
48 Requires(post,postun):  /sbin/depmod
49
50 %description -n kernel-smp-...
51 This is driver for ... for Linux.
52
53 This package contains Linux SMP module.
54
55 %description -n kernel-smp-... -l pl
56 Sterownik dla Linuksa do ...
57
58 Ten pakiet zawiera modu³ j±dra Linuksa SMP.
59
60 %build
61 %if %{with userspace}
62
63
64 %endif
65
66 %if %{with kernel}
67 # kernel module(s)
68 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
69     if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
70         exit 1
71     fi
72     rm -rf include
73     install -d include/{linux,config}
74     ln -sf %{_kernelsrcdir}/config-$cfg .config
75     ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
76     ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
77     touch include/config/MARKER
78 #
79 #       patching/creating makefile(s) (optional)
80 #
81     %{__make} -C %{_kernelsrcdir} clean modules \
82         RCS_FIND_IGNORE="-name '*.ko' -o" \
83         M=$PWD O=$PWD \
84         %{?with_verbose:V=1}
85     mv $mod_name{,-$cfg}.ko
86 done
87 %endif
88
89 %install
90 rm -rf $RPM_BUILD_ROOT
91
92 %if %{with userspace}
93
94
95 %endif
96
97 %if %{with kernel}
98 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/$dir
99 install $mod_name-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
100         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/$dir/$mod_name.ko
101 %if %{with smp} && %{with dist_kernel}
102 install $mod_name-smp.ko \
103         $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/$dir/$mod_name.ko
104 %endif
105 %endif
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %post
111 %depmod %{_kernel_ver}
112
113 %postun
114 %depmod %{_kernel_ver}
115
116 %post -n kernel-smp-...
117 %depmod %{_kernel_ver}
118
119 %postun -n kernel-smp-...
120 %depmod %{_kernel_ver}
121
122 %if %{with kernel}
123 %files -n kernel-...
124 %defattr(644,root,root,755)
125 /lib/modules/%{_kernel_ver}/$dir/*.ko*
126
127 %if %{with smp} && %{with dist_kernel}
128 %files -n kernel-smp-...
129 %defattr(644,root,root,755)
130 /lib/modules/%{_kernel_ver}smp/$dir/*.ko*
131 %endif
132 %endif
133
134 %if %{with userspace}
135 %files ...
136 %defattr(644,root,root,755)
137
138 %endif
This page took 0.126255 seconds and 4 git commands to generate.