SPECS: kernel-desktop.spec - finish %install part

glen glen at pld-linux.org
Sat Mar 1 16:06:23 CET 2008


Author: glen                         Date: Sat Mar  1 15:06:23 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- finish %install part

---- Files affected:
SPECS:
   kernel-desktop.spec (1.168 -> 1.169) 

---- Diffs:

================================================================
Index: SPECS/kernel-desktop.spec
diff -u SPECS/kernel-desktop.spec:1.168 SPECS/kernel-desktop.spec:1.169
--- SPECS/kernel-desktop.spec:1.168	Sat Mar  1 14:47:41 2008
+++ SPECS/kernel-desktop.spec	Sat Mar  1 16:06:18 2008
@@ -690,6 +690,9 @@
 %patch106 -p1
 %endif
 
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
+
 %build
 cat > multiarch.make <<'EOF'
 # generated by %{name}.spec
@@ -823,78 +826,83 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/boot,%{_kernelsrcdir}}
-
-umask 022
-l=
-# test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
-if cp -al COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
-	l=l
-	rm -f $RPM_BUILD_ROOT/COPYING
-fi
-
-install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
+# touch for noarch build (exclude list)
+install -d $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
+touch $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/{utsrelease,version,autoconf-dist}.h
 
-KERNEL_BUILD_DIR=$(pwd)
-
-install System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
-%ifarch %{ix86} %{x8664}
-install arch/%{_target_base_arch}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
-%endif
-
-%ifarch ppc
-install vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
-%else
-install vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
-%endif
-
-# Install modules
-%{__make} %{MakeOpts} modules_install \
+%{__make} %{MakeOpts} %{!?with_verbose:-s} modules_install \
+	-C %{objdir} \
 	%{?with_verbose:V=1} \
 	DEPMOD=%{DepMod} \
 	INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
 	KERNELRELEASE=%{kernel_release}
 
-%if "%{_target_base_arch}" != "%{_arch}"
-	touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
-%else
-	echo "CHECKING DEPENDENCIES FOR KERNEL MODULES"
-	/sbin/depmod --basedir $RPM_BUILD_ROOT -ae \
-		-F $RPM_BUILD_ROOT/boot/System.map-%{kernel_release} -r %{kernel_release} \
-		&& echo "OK" || echo "FAILED"
+mkdir $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc
+rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
+touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
+
+# /boot
+install -d $RPM_BUILD_ROOT/boot
+cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
+install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
+%ifarch %{ix86} %{x8664}
+cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
+%endif
+%ifarch ppc ppc64
+install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
+%endif
+%ifarch alpha sparc sparc64
+	%{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
+	cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
+%ifarch sparc
+	elftoaout %{objdir}/arch/sparc/boot/image -o %{objdir}/vmlinux.aout
+	install %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
+%endif
+%ifarch sparc64
+	elftoaout %{objdir}/arch/sparc64/boot/image -o %{objdir}/vmlinux.aout
+	install %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
+%endif
 %endif
 
-rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/build
-ln -sf %{_kernelsrcdir} $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/build
-install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{cluster,misc}
+# for initrd
+touch $RPM_BUILD_ROOT/boot/initrd-%{kernel_release}.gz
 
-find . -maxdepth 1 -name "." -exec cp -a$l "{}" "$RPM_BUILD_ROOT%{_kernelsrcdir}/" ";"
+%if "%{_target_base_arch}" != "%{_arch}"
+touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
+%endif
 
-install Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}/Module.symvers-dist
-install include/linux/autoconf.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf-dist.h
-install .config $RPM_BUILD_ROOT%{_kernelsrcdir}/config-dist
+# /etc/modrobe.d
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
 
-cd $RPM_BUILD_ROOT%{_kernelsrcdir}
-%{__make} %{MakeOpts} mrproper
+# /usr/src/linux
+# maybe package these to -module-build, then -headers could be noarch
+cp -a %{objdir}/Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}/Module.symvers-dist
+cp -aL %{objdir}/.config $RPM_BUILD_ROOT%{_kernelsrcdir}/config-dist
+cp -a %{objdir}/include/linux/autoconf.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf-dist.h
+cp -a %{objdir}/include/linux/{utsrelease,version}.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
 
-find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+# test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
+if cp -al %{srcdir}/COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
+	l=l
+	rm -f $RPM_BUILD_ROOT/COPYING
+fi
+cp -a$l %{srcdir}/* $RPM_BUILD_ROOT%{_kernelsrcdir}
 
-install $KERNEL_BUILD_DIR/include/linux/{version.h,utsrelease.h} include/linux
-install %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf.h
-install %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
+install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
+cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf.h
 
 # collect module-build files and directories
-%{__perl} %{SOURCE5} %{_kernelsrcdir} $KERNEL_BUILD_DIR
-
-# ghost initrd not to leave images around when pkg is uninstalled
-touch $RPM_BUILD_ROOT/boot/initrd-%{kernel_release}.gz
+# Usage: kernel-module-build.pl $rpmdir $fileoutdir
+fileoutdir=$(pwd)
+cd $RPM_BUILD_ROOT%{_kernelsrcdir}
+%{objdir}/scripts/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir
+cd -
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %preun
-rm -f /lib/modules/%{kernel_release}/modules.*
 if [ -x /sbin/new-kernel-pkg ]; then
 	/sbin/new-kernel-pkg --remove %{kernel_release}
 fi
@@ -974,6 +982,15 @@
 	fi
 fi
 
+%triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
+ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
+ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
+
+%triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
+if [ "$1" = 0 ]; then
+	rm -f /lib/modules/%{kernel_release}/{build,source}
+fi
+
 %files
 %defattr(644,root,root,755)
 /boot/vmlinuz-%{kernel_release}
@@ -989,7 +1006,6 @@
 /lib/modules/%{kernel_release}/kernel/kernel
 /lib/modules/%{kernel_release}/kernel/lib
 /lib/modules/%{kernel_release}/kernel/net
-/lib/modules/%{kernel_release}/kernel/security
 %dir /lib/modules/%{kernel_release}/kernel/sound
 /lib/modules/%{kernel_release}/kernel/sound/soundcore.*
 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/*/*-alsa.ko*
@@ -1005,8 +1021,9 @@
 %exclude /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
 %exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
-/lib/modules/%{kernel_release}/build
 %ghost /lib/modules/%{kernel_release}/modules.*
+%ghost /lib/modules/%{kernel_release}/build
+%ghost /lib/modules/%{kernel_release}/source
 %dir %{_sysconfdir}/modprobe.d/%{kernel_release}
 
 %ifarch alpha %{ix86} %{x8664} sparc sparc64
@@ -1121,6 +1138,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.169  2008-03-01 15:06:18  glen
+- finish %install part
+
 Revision 1.168  2008-03-01 13:47:41  glen
 - %prep, %build from kernel-vanilla build system
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/kernel-desktop.spec?r1=1.168&r2=1.169&f=u



More information about the pld-cvs-commit mailing list