--- /usr/portage/net-misc/openswan/openswan-2.4.4.ebuild 2005-11-29 16:06:02.000000000 +0100 +++ /usr/local/portage/net-misc/openswan/openswan-2.4.4.ebuild 2006-09-26 21:24:21.000000000 +0200 @@ -37,7 +37,15 @@ check_version_h # Get the kernel version of sources in /usr/src/linux ... - export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \ + export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); utsrelease=$3}; \ + /LINUX_VERSION_CODE/ { \ + major=rshift( $3, 16 ); \ + minor=and( rshift( $3, 8 ), 255 ); \ + micro=and( $3, 255); \ + linuxversion=major"."minor"."micro; \ + }; \ + END {if (utsrelease) {print utsrelease} \ + else {if (linuxversion) {print linuxversion}}}' \ "${ROOT}/usr/src/linux/include/linux/version.h")" export KV_major="$(echo "${KV_full}" | cut -d. -f1)" export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"