hello_mod.spec
来自「coldfire MCF5445X基于unix平台的BSP」· SPEC 代码 · 共 57 行
SPEC
57 行
%define base %(echo %{_prefix} | sed -e s,/usr.*$,,)%define pfx /opt/freescale/rootfs/%{_target_cpu}%define __os_install_post %{nil}Summary : Hello World module test packageName : hello_modVersion : 1.2Release : 1License : Public Domain, not copyrightedVendor : FreescalePackager : Stuart HughesGroup : Applications/TestSource : %{name}-%{version}.tar.gzBuildRoot : %{_tmppath}/%{name}Prefix : %{pfx}%Description%{summary}Notes:You need to have a built unpacked kernel source tree availablevia $RPM_BUILD_DIR/linux.We build spoofed, so gcc == the cross compilerYou can override: KERNELDIR, ARCH by passing these on the make command line%Prep%setup%Buildif [ ! -f $RPM_BUILD_DIR/linux/Makefile ]then cat <<TXTYou need a built unpacked kernel source tree in:$RPM_BUILD_DIR/linux/Makefileto build kernel modulesTXT exit 1fimake%Installrm -rf $RPM_BUILD_ROOTKVER="`perl -e '$/ = ""; $_ = <>; m,VERSION\s*=\s*(\d)\s*PATCHLEVEL\s*=\s*(\d+)\s*SUBLEVEL\s*=\s*(\d+)\s*EXTRAVERSION[ \t]*=[ \t]*(\S*),m; print "$1.$2.$3$4"' $RPM_BUILD_DIR/linux/Makefile`"mkdir -p $RPM_BUILD_ROOT/%{pfx}/%{base}/lib/modules/$KVER/misc/cp *.ko $RPM_BUILD_ROOT/%{pfx}/%{base}/lib/modules/$KVER/misc/%Cleanrm -rf $RPM_BUILD_ROOT%Files%defattr(-,root,root)%{pfx}/*
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?