# 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} cp Linux/Kernel/truecrypt.ko ${D}/${MOD_DIR}/ || die "Install failed!" }