$ date +%W 42
rpmbuild with rpmrc
RPM_DIR=`pwd`/rpm
echo "%_topdir $RPM_DIR" > rpmmacros
echo "macrofiles: /usr/lib/rpm/macros:/usr/lib/rpm/%{_target}/macros:/usr/lib/rpm/redhat/macros:/etc/rpm/macros.*:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros:rpmmacros" > rpmrc
mkdir -p $RPM_DIR/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
rpmbuild --rcfile rpmrc --rebuild some.source.rpm
rpmbuild --rcfile rpmrc --define 'dist .el5' -without java -without python \
--target=x86_64 -ba rpm/SPECS/protobuf.spec
or redefine topdir as
rpmbuild --define "_topdir /home/user/rpmdir" --define 'dist .el5' \ -without java -without python --target=x86_64 -ba rpm/SPECS/protobuf.spec
use one thread to build for easy debugging
$ cat ~/.rpmmacros %_smp_mflags -j1
RPM Spec File
Show Spec Macros
rpm --showrc
rpm --eval %{_tmppath}
rpm --eval %{_libdir}
Variables
${LINUX_VERSION} # shell environment var
%{LINUX_VERSION} # marco var
%define LINUX_VERSION ${LINUX_VERSION} # ${LINUX_VERSION} not evaluated
%define LINUX_VERSION $(echo ${LINUX_VERSION}) # evaluated ${LINUX_VERSION}= 2.6.32.1
More Macros
http://www.rpm.org/wiki/PackagerDocs/MacrosTCP Shutdown and Close
http://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable
Building Kernel Modules
% sudo yum install kernel-devel % make -C /lib/modules/$(uname -r)/build/ M=$(pwd) modules % strip --strip-debug themoudule.ko % make -C /lib/modules/$(uname -r)/build/ M=$(pwd) clean
Building inside kernel tree
make SUBDIRS=drivers/acpi/ modules make SUBDIRS=drivers/acpi/ button.ko
Subscribe to:
Comments (Atom)