inherit eutils kernel-mod DESCRIPTION="Linux kernel module to encrypt local file systems and disk partitions with AES cipher." HOMEPAGE="http://loop-aes.sourceforge.net/loop-AES.README" SRC_URI="http://loop-aes.sourceforge.net/loop-AES/${PN/aes/AES}-v${PV}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~ppc ~sparc ~amd64 ~ppc64 ~alpha" DEPEND="" RDEPEND="" S="${WORKDIR}/${PN/aes/AES}-v${PV}" pkg_setup() { kernel-mod_getversion kernel-mod_check_modules_supported if kernel-mod_configoption_present BLK_DEV_LOOP then eerror "" eerror "${PN} requires Loopback device support (CONFIG_BLK_DEV_LOOP)" eerror "to be disabled in the kernel to avoid conflicting modules." eerror "" die fi if ! kernel-mod_configoption_present KMOD && \ ! kernel-mod_configoption_present KERNELD then ewarn "" ewarn "It is recommended to have Automatic kernel module loading" ewarn "(CONFIG_KERNELD in kernels 2.0 or CONFIG_KMOD in newer)" ewarn "" fi } src_unpack () { unpack ${A} kernel-mod_getversion if [ ${KV_MINOR} -ge 6 ] && [ ${KV_PATCH} -ge 6 ]; then sed -i 's:SUBDIRS=:M=:g' ${S}/Makefile fi } src_compile() { set_arch_to_kernel emake LINUX_SOURCE=${KERNEL_DIR} MODINST=n RUNDM=n || die } src_install() { dodoc README insinto ${ROOT}/lib/modules/${KV}/block if [ ${KV_MINOR} -ge 6 ]; then doins loop.ko else doins loop.o fi } pkg_postinst() { einfo "Checking kernel module dependencies" test -r "${ROOT}/usr/src/linux/System.map" && \ depmod -ae -F "${ROOT}/usr/src/linux/System.map" -b "${ROOT}" -r ${KV} ewarn "" ewarn "Note, that you will need util-linux compiled with loop-aes" ewarn "in USE flag enabled in order to use this module." ewarn "" einfo "For more instructions take a look at examples in" einfo "/usr/share/doc/${PF}/README.gz" einfo "" }