From b6002fe4b0a087e74b8fb2586d41f4623c69ce91 Mon Sep 17 00:00:00 2001 From: Thomas Woerner Date: Mon, 3 Mar 2008 11:07:40 +0000 Subject: [PATCH] - force usage of kernel-devel in build environment instead of uname detected kernel --- iptables.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iptables.spec b/iptables.spec index 644c1a9..ea28613 100644 --- a/iptables.spec +++ b/iptables.spec @@ -1,4 +1,5 @@ %define build_devel 1 +%define _kernel $(ls -d /usr/src/kernels/*/ | head -1) Name: iptables 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) License: GPLv2 BuildRequires: libselinux-devel -BuildRequires: kernel, kernel-devel +BuildRequires: kernel-devel Conflicts: kernel < 2.4.20 Requires(post): chkconfig Requires(preun): chkconfig @@ -73,9 +74,8 @@ TOPDIR=`pwd` OPT="$RPM_OPT_FLAGS -I$TOPDIR/include -fPIC" #export KERNEL_DIR=/usr #export KBUILD_OUTPUT=/usr -export KERNEL_DIR="/lib/modules/%{uname}/source" -export KBUILD_OUTPUT="/lib/modules/%{uname}/build" - +export KERNEL_DIR=%{_kernel} +export KBUILD_OUTPUT=%{_kernel} export DO_SELINUX=1 make COPT_FLAGS="$OPT" LIBDIR=/%{_lib} @@ -86,6 +86,8 @@ make COPT_FLAGS="$OPT" LIBDIR=/%{_lib} ip6tables-save ip6tables-restore rm -rf %{buildroot} #export KERNEL_DIR=/usr #export KBUILD_OUTPUT=/usr +export KERNEL_DIR=%{_kernel} +export KBUILD_OUTPUT=%{_kernel} export DO_SELINUX=1 make install DESTDIR=%{buildroot} BINDIR=/sbin LIBDIR=/%{_lib} MANDIR=%{_mandir} %if %{build_devel}