/usr/src/openswan-2.6.38/packaging/utils/kernelversion is in openswan-modules-dkms 1:2.6.38-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 | #! /bin/sh
# determine kernel version code, mostly for use in RPM building
awk 'BEGIN { FS = " *= *" }
NF != 2 { next }
$1 == "VERSION" { maj = $2 }
$1 == "PATCHLEVEL" { mid = $2 }
$1 == "SUBLEVEL" { min = $2 }
$1 == "EXTRAVERSION" { ext = $2 }
END { print maj "." mid "." min ext }' $*
|