SPECS: cdemu.spec - use %build_kernel_modules and %install_kernel_...

sparky sparky at pld-linux.org
Thu Nov 23 22:25:10 CET 2006


Author: sparky                       Date: Thu Nov 23 21:25:10 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use %build_kernel_modules and %install_kernel_modules
- %{_alt_kernel} support
- eeeh, one more Makefile written in
  i'd-write-more-complicated-but-i-don't-know-gnu-make-well-enough style,
  overwritten with sa simple as possible one

---- Files affected:
SPECS:
   cdemu.spec (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SPECS/cdemu.spec
diff -u SPECS/cdemu.spec:1.9 SPECS/cdemu.spec:1.10
--- SPECS/cdemu.spec:1.9	Wed Nov 22 20:38:15 2006
+++ SPECS/cdemu.spec	Thu Nov 23 22:25:05 2006
@@ -23,8 +23,8 @@
 BuildRequires:	python-devel
 %endif
 %if %{with kernel}
-%{?with_dist_kernel:BuildRequires:	kernel-module-build >= 3:2.6.7}
-BuildRequires:	rpmbuild(macros) >= 1.153
+%{?with_dist_kernel:BuildRequires:	kernel%{_alt_kernel}-module-build >= 3:2.6.7}
+BuildRequires:	rpmbuild(macros) >= 1.330
 %endif
 Requires:	cdemu(kernel)
 Requires:	dev >= 2.9.0-16
@@ -52,7 +52,7 @@
 
 Ten pakiet zawiera narzędzia użytkownika dla %{name}.
 
-%package -n kernel-misc-%{name}
+%package -n kernel%{_alt_kernel}-misc-%{name}
 Summary:	Linux driver for %{name}
 Summary(pl):	Sterownik dla Linuksa do %{name}
 Release:	%{_rel}@%{_kernel_ver_str}
@@ -64,17 +64,17 @@
 %endif
 Provides:	cdemu(kernel)
 
-%description -n kernel-misc-%{name}
+%description -n kernel%{_alt_kernel}-misc-%{name}
 This is driver for %{name} for Linux.
 
 This package contains Linux module.
 
-%description -n kernel-misc-%{name} -l pl
+%description -n kernel%{_alt_kernel}-misc-%{name} -l pl
 Sterownik dla Linuksa do %{name}.
 
 Ten pakiet zawiera moduł jądra Linuksa.
 
-%package -n kernel-smp-misc-%{name}
+%package -n kernel%{_alt_kernel}-smp-misc-%{name}
 Summary:	Linux SMP driver for %{name}
 Summary(pl):	Sterownik dla Linuksa SMP do %{name}
 Release:	%{_rel}@%{_kernel_ver_str}
@@ -86,50 +86,25 @@
 %endif
 Provides:	cdemu(kernel)
 
-%description -n kernel-smp-misc-%{name}
+%description -n kernel%{_alt_kernel}-smp-misc-%{name}
 This is driver for %{name} for Linux.
 
 This package contains Linux SMP module.
 
-%description -n kernel-smp-misc-%{name} -l pl
+%description -n kernel%{_alt_kernel}-smp-misc-%{name} -l pl
 Sterownik dla Linuksa do %{name}.
 
 Ten pakiet zawiera moduł jądra Linuksa SMP.
 
 %prep
 %setup -q
+cat > Makefile <<'EOF'
+obj-m := cdemu.o
+cdemu-objs := cdemu_core.o cdemu_mod.o cdemu_proc.o
+EOF
 
 %build
-%if %{with kernel}
-for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
-	if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
-		exit 1
-	fi
-	rm -rf include
-	install -d o/include/linux
-	ln -sf %{_kernelsrcdir}/config-$cfg o/.config
-	ln -sf %{_kernelsrcdir}/Module.symvers.h o/Module.symvers
-	ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h o/include/linux/autoconf.h
-%if %{with dist_kernel}
-	%{__make} -j1 -C %{_kernelsrcdir} O=$PWD/o prepare scripts
-%else
-	install -d o/include/config
-	touch o/include/config/MARKER
-	ln -sf %{_kernelsrcdir}/scripts o/scripts
-%endif
-
-	%{__make} -C %{_kernelsrcdir} clean \
-		RCS_FIND_IGNORE="-name '*.ko' -o" \
-		M=$PWD O=$PWD/o MK_INC=$PWD \
-		%{?with_verbose:V=1}
-	%{__make} -C %{_kernelsrcdir} modules \
-		CC="%{__cc}" CPP="%{__cpp}" \
-		M=$PWD O=$PWD/o MK_INC=$PWD \
-		%{?with_verbose:V=1}
-
-	mv cdemu{,-$cfg}.ko
-done
-%endif
+%build_kernel_modules -m cdemu
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -145,39 +120,33 @@
 %endif
 
 %if %{with kernel}
-install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
-install cdemu-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \
-	$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/cdemu.ko
-%if %{with smp} && %{with dist_kernel}
-install cdemu-smp.ko \
-	$RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/cdemu.ko
-%endif
+%install_kernel_modules -m cdemu -d misc
 %endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post	-n kernel-misc-%{name}
+%post	-n kernel%{_alt_kernel}-misc-%{name}
 %depmod %{_kernel_ver}
 
-%postun	-n kernel-misc-%{name}
+%postun	-n kernel%{_alt_kernel}-misc-%{name}
 %depmod %{_kernel_ver}
 
-%post	-n kernel-smp-misc-%{name}
+%post	-n kernel%{_alt_kernel}-smp-misc-%{name}
 %depmod %{_kernel_ver}smp
 
-%postun	-n kernel-smp-misc-%{name}
+%postun	-n kernel%{_alt_kernel}-smp-misc-%{name}
 %depmod %{_kernel_ver}smp
 
 %if %{with kernel}
-%files -n kernel-misc-%{name}
+%files -n kernel%{_alt_kernel}-misc-%{name}
 %defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/misc/*.ko*
+/lib/modules/%{_kernel_ver}/misc/cdemu.ko*
 
 %if %{with smp} && %{with dist_kernel}
-%files -n kernel-smp-misc-%{name}
+%files -n kernel%{_alt_kernel}-smp-misc-%{name}
 %defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}smp/misc/*.ko*
+/lib/modules/%{_kernel_ver}smp/misc/cdemu.ko*
 %endif
 %endif
 
@@ -195,6 +164,13 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.10  2006/11/23 21:25:05  sparky
+- use %build_kernel_modules and %install_kernel_modules
+- %{_alt_kernel} support
+- eeeh, one more Makefile written in
+  i'd-write-more-complicated-but-i-don't-know-gnu-make-well-enough style,
+  overwritten with sa simple as possible one
+
 Revision 1.9  2006/11/22 19:38:15  czarny
 - up to 0.8
 - some kernel building changed, according to kernel-net-r8180-sa2400 (moved stuff to o dirrectory)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/cdemu.spec?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list