- force usage of kernel-devel in build environment instead of uname

detected kernel
This commit is contained in:
Thomas Woerner 2008-03-03 11:07:40 +00:00
parent 0d85675fe7
commit b6002fe4b0

View File

@ -1,4 +1,5 @@
%define build_devel 1 %define build_devel 1
%define _kernel $(ls -d /usr/src/kernels/*/ | head -1)
Name: iptables Name: iptables
Summary: Tools for managing Linux kernel packet filtering capabilities Summary: Tools for managing Linux kernel packet filtering capabilities
@ -15,7 +16,7 @@ URL: http://www.netfilter.org/
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
License: GPLv2 License: GPLv2
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
BuildRequires: kernel, kernel-devel BuildRequires: kernel-devel
Conflicts: kernel < 2.4.20 Conflicts: kernel < 2.4.20
Requires(post): chkconfig Requires(post): chkconfig
Requires(preun): chkconfig Requires(preun): chkconfig
@ -73,9 +74,8 @@ TOPDIR=`pwd`
OPT="$RPM_OPT_FLAGS -I$TOPDIR/include -fPIC" OPT="$RPM_OPT_FLAGS -I$TOPDIR/include -fPIC"
#export KERNEL_DIR=/usr #export KERNEL_DIR=/usr
#export KBUILD_OUTPUT=/usr #export KBUILD_OUTPUT=/usr
export KERNEL_DIR="/lib/modules/%{uname}/source" export KERNEL_DIR=%{_kernel}
export KBUILD_OUTPUT="/lib/modules/%{uname}/build" export KBUILD_OUTPUT=%{_kernel}
export DO_SELINUX=1 export DO_SELINUX=1
make COPT_FLAGS="$OPT" LIBDIR=/%{_lib} make COPT_FLAGS="$OPT" LIBDIR=/%{_lib}
@ -86,6 +86,8 @@ make COPT_FLAGS="$OPT" LIBDIR=/%{_lib} ip6tables-save ip6tables-restore
rm -rf %{buildroot} rm -rf %{buildroot}
#export KERNEL_DIR=/usr #export KERNEL_DIR=/usr
#export KBUILD_OUTPUT=/usr #export KBUILD_OUTPUT=/usr
export KERNEL_DIR=%{_kernel}
export KBUILD_OUTPUT=%{_kernel}
export DO_SELINUX=1 export DO_SELINUX=1
make install DESTDIR=%{buildroot} BINDIR=/sbin LIBDIR=/%{_lib} MANDIR=%{_mandir} make install DESTDIR=%{buildroot} BINDIR=/sbin LIBDIR=/%{_lib} MANDIR=%{_mandir}
%if %{build_devel} %if %{build_devel}