# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs DESCRIPTION="Free open-source disk encryption software for Windows XP/2000/2003 and Linux" HOMEPAGE="http://www.truecrypt.org/" SRC_URI="http://www.truecrypt.org/downloads/truecrypt-${PV}-source-code.tar.gz" LICENSE="truecrypt" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="virtual/linux-sources >=sys-fs/device-mapper-1.00.08" RDEPEND="sys-apps/module-init-tools >=sys-fs/device-mapper-1.00.08" src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/${P}-head.patch } src_compile() { ARCH=$(tc-arch-kernel) cd ${S}/Linux sh build.sh || die "build failed" } src_test() { ${S}/Linux/Cli/truecrypt --test } src_install() { # unload truecrypt modules if already loaded /sbin/rmmod truecrypt >&- 2>&- if grep -q "^truecrypt" /proc/modules then die "Please dismount all mounted TrueCrypt volumes" fi cd ${S} # installing files dobin Linux/Cli/truecrypt doman Linux/Cli/Man/truecrypt.1 dodoc Readme.txt # installing kernel module MOD_DIR=/lib/modules/$(uname -r)/extra dodir ${MOD_DIR} fperms 600 Linux/Kernel/truecrypt.ko cp Linux/Kernel/truecrypt.ko ${D}/${MOD_DIR}/ || die "Install failed!" } pkg_postinst() { depmod || die "depmod failed" echo einfo " For TrueCrypt 4.0 to work you have to load a " einfo " kernel module. This can be done in three ways: " einfo einfo " 1. Loading the module automatically by the running kernel. " einfo " For this 'Automatic kernel module loading' needs to be " einfo " enabled (CONFIG_KMOD=y). " einfo " 2. Loading the module manually before mounting the volume. " einfo " Try 'modprobe truecrypt' as root to load the module. " einfo " 3. Load the module during boot by listing it in " einfo " '/etc/modules.autoload.d/kernel-2.6' " }