# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
# 
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
# 
# ROCK Linux: rock-src/package/mnemoc/rsbac/parse-config
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
# 
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
# 
# --- ROCK-COPYRIGHT-NOTE-END ---

if pkgcheck rsbac X; then
	if [ ${pkg:0:7} == linux24 ]; then
		echo_status "Including RSBAC patch..."
		pkg_rsbac_tempdir=`mktemp -d`
		pkg_rsbac_archdir=$base/download/mnemoc/rsbac
		pkg_rsbac_confdir=$base/package/mnemoc/rsbac
		pkg_rsbac_ver=`sed -n 's,^\[V\] \(.*\),\1,p' ${pkg_rsbac_confdir}/rsbac.desc`

		bunzip2 -c ${pkg_rsbac_archdir}/patch-$ver-v${pkg_rsbac_ver}.bz2 > \
			${pkg_rsbac_tempdir}/rsbac-${pkg_rsbac_ver}.patch

		var_append patchfiles ' ' "${pkg_rsbac_tempdir}/rsbac-${pkg_rsbac_ver}.patch"
		var_append patchfiles ' ' "${pkg_rsbac_confdir}/rsbac-no_extraversion.diff"
		var_append conffiles  ' ' "${pkg_rsbac_confdir}/kernel-conf.sh"

		hook_add prepatch  4 "tar -v $taropt ${pkg_rsbac_archdir}/rsbac-v${pkg_rsbac_ver}.tar.bz2"
		hook_add postpatch 4 "rm -rf $pkg_rsbac_tempdir"

		# apply hotfixes here
		for i in 1 3 5; do
			var_append patchfiles ' ' "${pkg_rsbac_archdir}/rsbac-bugfix-v$pkg_rsbac_ver-$i.diff"
		done
	fi
fi
