summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alonbl@gentoo.org>2007-08-11 08:47:21 +0000
committerAlon Bar-Lev <alonbl@gentoo.org>2007-08-11 08:47:21 +0000
commited223d6ec425a64c7e0c05de280236f9b3ebd1d2 (patch)
treebe0f6e47cd3f29454312dd083082ecf1a55ef667 /app-crypt/truecrypt
parent(#183626) Bump. Lots of bugfixes from the 6.5.3 development release, no new f... (diff)
downloadgentoo-2-ed223d6ec425a64c7e0c05de280236f9b3ebd1d2.tar.gz
gentoo-2-ed223d6ec425a64c7e0c05de280236f9b3ebd1d2.tar.bz2
gentoo-2-ed223d6ec425a64c7e0c05de280236f9b3ebd1d2.zip
Don't fail if no volumes are mounted, bug#168691, thanks to Jakob Truelsen
(Portage version: 2.1.3.3)
Diffstat (limited to 'app-crypt/truecrypt')
-rw-r--r--app-crypt/truecrypt/ChangeLog13
-rw-r--r--app-crypt/truecrypt/files/digest-truecrypt-4.2a-r13
-rw-r--r--app-crypt/truecrypt/files/digest-truecrypt-4.2a-r23
-rw-r--r--app-crypt/truecrypt/files/digest-truecrypt-4.2a-r33
-rw-r--r--app-crypt/truecrypt/files/truecrypt-4.2a-2.6.19.patch38
-rw-r--r--app-crypt/truecrypt/files/truecrypt-4.2a-2.6.20.patch31
-rw-r--r--app-crypt/truecrypt/files/truecrypt-4.2a-makefile.patch65
-rw-r--r--app-crypt/truecrypt/files/truecrypt-4.2a_kernel-2.6.18-rc1_fix.patch13
-rw-r--r--app-crypt/truecrypt/files/truecrypt-stop.sh2
-rw-r--r--app-crypt/truecrypt/truecrypt-4.2a-r1.ebuild104
-rw-r--r--app-crypt/truecrypt/truecrypt-4.2a-r2.ebuild105
-rw-r--r--app-crypt/truecrypt/truecrypt-4.2a-r3.ebuild108
12 files changed, 13 insertions, 475 deletions
diff --git a/app-crypt/truecrypt/ChangeLog b/app-crypt/truecrypt/ChangeLog
index 7c6a3f96b54f..38206447e54f 100644
--- a/app-crypt/truecrypt/ChangeLog
+++ b/app-crypt/truecrypt/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for app-crypt/truecrypt
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/truecrypt/ChangeLog,v 1.20 2007/06/07 16:50:20 alonbl Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/truecrypt/ChangeLog,v 1.21 2007/08/11 08:47:20 alonbl Exp $
+
+ 11 Aug 2007; Alon Bar-Lev <alonbl@gentoo.org>
+ -files/truecrypt-4.2a-2.6.19.patch, -files/truecrypt-4.2a-2.6.20.patch,
+ -files/truecrypt-4.2a-makefile.patch,
+ -files/truecrypt-4.2a_kernel-2.6.18-rc1_fix.patch,
+ files/truecrypt-stop.sh, -truecrypt-4.2a-r1.ebuild,
+ -truecrypt-4.2a-r2.ebuild, -truecrypt-4.2a-r3.ebuild:
+ Cleanup
+
+ 11 Aug 2007; Alon Bar-Lev <alonbl@gentoo.org> files/truecrypt-stop.sh:
+ Don't fail if no volumes are mounted, bug#168691, thanks to Jakob Truelsen
*truecrypt-4.3a (07 Jun 2007)
diff --git a/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r1 b/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r1
deleted file mode 100644
index 6aac1268b685..000000000000
--- a/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r1
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 6e60ead403fe23355f61341ccce68ff1 truecrypt-4.2a-source-code.tar.gz 1088418
-RMD160 8d5b142f9cc7de5693b527f8d708d9e1ebd1e2b3 truecrypt-4.2a-source-code.tar.gz 1088418
-SHA256 ba1892584bf52b5a12eef185563705774566a70537d139aef8770477dfe9636f truecrypt-4.2a-source-code.tar.gz 1088418
diff --git a/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r2 b/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r2
deleted file mode 100644
index 6aac1268b685..000000000000
--- a/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r2
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 6e60ead403fe23355f61341ccce68ff1 truecrypt-4.2a-source-code.tar.gz 1088418
-RMD160 8d5b142f9cc7de5693b527f8d708d9e1ebd1e2b3 truecrypt-4.2a-source-code.tar.gz 1088418
-SHA256 ba1892584bf52b5a12eef185563705774566a70537d139aef8770477dfe9636f truecrypt-4.2a-source-code.tar.gz 1088418
diff --git a/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r3 b/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r3
deleted file mode 100644
index 6aac1268b685..000000000000
--- a/app-crypt/truecrypt/files/digest-truecrypt-4.2a-r3
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 6e60ead403fe23355f61341ccce68ff1 truecrypt-4.2a-source-code.tar.gz 1088418
-RMD160 8d5b142f9cc7de5693b527f8d708d9e1ebd1e2b3 truecrypt-4.2a-source-code.tar.gz 1088418
-SHA256 ba1892584bf52b5a12eef185563705774566a70537d139aef8770477dfe9636f truecrypt-4.2a-source-code.tar.gz 1088418
diff --git a/app-crypt/truecrypt/files/truecrypt-4.2a-2.6.19.patch b/app-crypt/truecrypt/files/truecrypt-4.2a-2.6.19.patch
deleted file mode 100644
index ea81d2cfadb5..000000000000
--- a/app-crypt/truecrypt/files/truecrypt-4.2a-2.6.19.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- Linux/Kernel/Dm-target.c.orig 2006-06-28 12:36:28.000000000 +0200
-+++ Linux/Kernel/Dm-target.c 2006-10-23 00:05:33.000000000 +0200
-@@ -29,6 +29,7 @@
- int trace_level = 0;
-
- #define MSG_PREFIX "truecrypt: "
-+#define DM_MSG_PREFIX MSG_PREFIX
- #define error(fmt, args...) printk(KERN_ERR MSG_PREFIX fmt, ## args)
- #define trace(level, fmt, args...) level <= trace_level && printk(KERN_DEBUG MSG_PREFIX fmt, ## args)
- #define dbg(fmt, args...) printk(KERN_DEBUG MSG_PREFIX fmt, ## args)
-@@ -124,8 +125,13 @@
- if (p)
- return p;
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
-+ trace (3, "congestion_wait\n");
-+ congestion_wait (direction, HZ / 50);
-+#else
- trace (3, "blk_congestion_wait\n");
- blk_congestion_wait (direction, HZ / 50);
-+#endif
- }
- }
-
-@@ -496,8 +502,13 @@
- trace (3, "bio_alloc (%hd)\n", bio_segments (bio));
- while (!(bion = bio_alloc (GFP_NOIO | __GFP_NOMEMALLOC, bio_segments (bio))))
- {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
-+ trace (3, "congestion_wait\n");
-+ congestion_wait (bio_data_dir (bio), HZ / 50);
-+#else
- trace (3, "blk_congestion_wait\n");
- blk_congestion_wait (bio_data_dir (bio), HZ / 50);
-+#endif
- }
-
- bion->bi_bdev = tc->dev->bdev;
diff --git a/app-crypt/truecrypt/files/truecrypt-4.2a-2.6.20.patch b/app-crypt/truecrypt/files/truecrypt-4.2a-2.6.20.patch
deleted file mode 100644
index fed9d5558089..000000000000
--- a/app-crypt/truecrypt/files/truecrypt-4.2a-2.6.20.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- Linux/Kernel/Dm-target.c.orig 2007-02-05 20:40:09.000000000 +0200
-+++ Linux/Kernel/Dm-target.c 2007-02-05 20:54:11.000000000 +0200
-@@ -383,9 +383,16 @@
- }
-
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
-+static void work_process (struct work_struct *work)
-+{
-+ struct bio_ctx *bc = container_of(work, struct bio_ctx, work);
-+ void *qdata = (void *)bc;
-+#else
- static void work_process (void *qdata)
- {
- struct bio_ctx *bc = (struct bio_ctx *) qdata;
-+#endif
- struct target_ctx *tc = (struct target_ctx *) bc->target->private;
- struct bio_vec *bv;
- u64 sec_no = bc->crypto_sector;
-@@ -441,7 +448,11 @@
- bio_put (bio);
-
- // Queue decryption to leave completion interrupt ASAP
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
-+ INIT_WORK (&bc->work, work_process);
-+#else
- INIT_WORK (&bc->work, work_process, bc);
-+#endif
- trace (3, "queue_work (%p)\n", work_queue);
- queue_work (work_queue, &bc->work);
- return error;
diff --git a/app-crypt/truecrypt/files/truecrypt-4.2a-makefile.patch b/app-crypt/truecrypt/files/truecrypt-4.2a-makefile.patch
deleted file mode 100644
index 92b458d439df..000000000000
--- a/app-crypt/truecrypt/files/truecrypt-4.2a-makefile.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- Linux/Cli/Makefile.orig 2006-06-27 06:18:32.000000000 +1000
-+++ Linux/Cli/Makefile 2006-07-11 21:24:07.000000000 +1000
-@@ -9,22 +9,13 @@
- -include ../Common/.platform
- endif
-
--ifdef NO_WARNINGS
--CFLAGS := -w
--else
--CFLAGS := -W
--endif
- CFLAGS += -I../../Crypto -I../../Common -I../Kernel
- CFLAGS += -D_cdecl="" -DBOOL=int -DTRUE=1 -DFALSE=0 -DMAX_PATH=260
- CFLAGS += $(TYPES)
-
--ifndef DEBUG
- # Do not enable strict aliasing
--CFLAGS += -O2 -fno-strict-aliasing
--else
--CFLAGS += -ggdb
-+CFLAGS += -fno-strict-aliasing
- NO_STRIP := 1
--endif
-
- KERNEL_OBJS_F := ../.kernel-objs
- USER_OBJS_F := ../.user-objs
-@@ -60,11 +51,11 @@
- OBJS += $(TC_COMMON)/Tests.o
- OBJS += Cli.o
-
--%.o: %.c
-+%.o: %.c $(USER_OBJS_F)
- @echo Compiling $(<F)
-- @$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -o $@ -c $<
-+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -o $@ -c $<
-
--all: objclean truecrypt
-+all: $(USER_OBJS_F) truecrypt
- @echo Done.
-
- ../Common/.platform: ../Common/Platform.c
-@@ -75,7 +66,7 @@
-
- truecrypt: $(OBJS)
- @echo Linking $@
-- @$(CC) -o $@ $(OBJS)
-+ $(CC) -o $@ $(OBJS)
- ifndef NO_STRIP
- @strip $@
- endif
-@@ -85,9 +76,11 @@
- truecrypt.1: objclean truecrypt
- help2man -N -i Man/help2man.inc ./truecrypt >Man/truecrypt.1
-
--objclean:
-- @if [ -f $(KERNEL_OBJS_F) ]; then rm -f ${OBJS} $(KERNEL_OBJS_F); fi
-+$(USER_OBJS_F):
-+ @if [ -f $(KERNEL_OBJS_F) ]; then rm -f $(OBJS) $(KERNEL_OBJS_F); fi
- @>$(USER_OBJS_F)
-
- clean:
-- -rm -f truecrypt ${OBJS} *.d $(TC_COMMON)/*.d $(TC_CRYPTO)/*.d ../Common/platform ../Common/.platform
-+ -rm -f truecrypt $(OBJS) *.d $(TC_COMMON)/*.d $(TC_CRYPTO)/*.d ../Common/platform ../Common/.platform
-+
-+.PHONY: man clean all
diff --git a/app-crypt/truecrypt/files/truecrypt-4.2a_kernel-2.6.18-rc1_fix.patch b/app-crypt/truecrypt/files/truecrypt-4.2a_kernel-2.6.18-rc1_fix.patch
deleted file mode 100644
index e43dd5c5637d..000000000000
--- a/app-crypt/truecrypt/files/truecrypt-4.2a_kernel-2.6.18-rc1_fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- truecrypt-4.2a/Linux/Kernel/Dm-target.c 2006-06-28 12:36:28.000000000 +0200
-+++ truecrypt-4.2a_fixed/Linux/Kernel/Dm-target.c 2006-07-14 19:02:40.000000000 +0200
-@@ -26,6 +26,10 @@
- #error Linux kernel 2.6.5 or later required
- #endif
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
-+#define DM_MSG_PREFIX "truecrypt"
-+#endif
-+
- int trace_level = 0;
-
- #define MSG_PREFIX "truecrypt: "
diff --git a/app-crypt/truecrypt/files/truecrypt-stop.sh b/app-crypt/truecrypt/files/truecrypt-stop.sh
index 1cd8a2d5e3d9..50bb0b749fb0 100644
--- a/app-crypt/truecrypt/files/truecrypt-stop.sh
+++ b/app-crypt/truecrypt/files/truecrypt-stop.sh
@@ -4,6 +4,6 @@
# Try to remove any dm-crypt mappings
if [ -x /usr/bin/truecrypt ]; then
ebegin "Removing truecrypt mappings"
- /usr/bin/truecrypt -d
+ ! /usr/bin/truecrypt -l > /dev/null 2>&1 || /usr/bin/truecrypt -d
eend $?
fi
diff --git a/app-crypt/truecrypt/truecrypt-4.2a-r1.ebuild b/app-crypt/truecrypt/truecrypt-4.2a-r1.ebuild
deleted file mode 100644
index 3070499ea05f..000000000000
--- a/app-crypt/truecrypt/truecrypt-4.2a-r1.ebuild
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright 1999-2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/truecrypt/truecrypt-4.2a-r1.ebuild,v 1.5 2007/02/05 00:40:24 beandog Exp $
-
-inherit linux-mod toolchain-funcs
-
-DESCRIPTION="Free open-source disk encryption software"
-HOMEPAGE="http://www.truecrypt.org/"
-SRC_URI="http://www.truecrypt.org/downloads/truecrypt-${PV}-source-code.tar.gz"
-
-LICENSE="truecrypt-collective-1.0"
-SLOT="0"
-KEYWORDS="amd64 x86"
-IUSE=""
-
-DEPEND="virtual/linux-sources
- sys-fs/device-mapper"
-
-RDEPEND="sys-fs/device-mapper"
-
-BUILD_PARAMS="KERNEL_SRC=${KERNEL_DIR} NO_WARNINGS=1"
-BUILD_TARGETS="truecrypt"
-MODULE_NAMES="truecrypt(block:${S}/Linux/Kernel)"
-
-pkg_setup() {
- linux-info_pkg_setup
- dmcrypt_check
- kernel_is lt 2 6 5 && die 'requires at least 2.6.5 kernel version'
-}
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}/${P}_kernel-2.6.18-rc1_fix.patch"
- epatch "${FILESDIR}/${P}-2.6.19.patch"
- epatch "${FILESDIR}/${P}-makefile.patch"
- linux-mod_pkg_setup
-}
-
-src_compile() {
- linux-mod_src_compile || die "Truecrypt module compilation failed."
- cd "${S}/Linux/Cli"
- einfo "Building truecrypt utility"
- tc-export CC
- # remove kernel linked crypt stuff
- emake clean || die "make clean failed"
- emake truecrypt NO_STRIP=1 || die "Compile and/or linking of TrueCrypt Linux CLI application failed."
-}
-
-src_test() {
- "${S}/Linux/Cli/truecrypt" --test
-}
-
-pkg_preinst() {
- # 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
-}
-
-src_install() {
- # installing files
- dobin Linux/Cli/truecrypt
- doman Linux/Cli/Man/truecrypt.1
- dodoc Readme.txt 'Release/Setup Files/TrueCrypt User Guide.pdf'
-
- # installing kernel module
- linux-mod_src_install
-}
-
-pkg_postinst() {
- linux-mod_pkg_postinst
- elog " For TrueCrypt 4.2 to work you have to load a "
- elog " kernel module. This can be done in three ways: "
- elog
- elog " 1. Loading the module automatically by the running kernel. "
- elog " For this 'Automatic kernel module loading' needs to be "
- elog " enabled (CONFIG_KMOD=y). "
- elog " 2. Loading the module manually before mounting the volume. "
- elog " Try 'modprobe truecrypt' as root to load the module. "
- elog " 3. Load the module during boot by listing it in "
- elog " '/etc/modules.autoload.d/kernel-2.6' "
-}
-
-dmcrypt_check() {
- ebegin "Checking for Device mapper support (BLK_DEV_DM)"
- linux_chkconfig_present BLK_DEV_DM
- eend $?
-
- if [[ $? -ne 0 ]] ; then
- ewarn "TrueCrypt requires Device mapper support!"
- ewarn "Please enable Device mapper support in your kernel config, found at:"
- ewarn "(for 2.6 kernels)"
- ewarn
- ewarn " Device Drivers"
- ewarn " Multi-Device Support"
- ewarn " <*> Device mapper support"
- ewarn
- ewarn "and recompile your kernel if you want this package to work."
- epause 10
- fi
-}
diff --git a/app-crypt/truecrypt/truecrypt-4.2a-r2.ebuild b/app-crypt/truecrypt/truecrypt-4.2a-r2.ebuild
deleted file mode 100644
index 7e560aefc008..000000000000
--- a/app-crypt/truecrypt/truecrypt-4.2a-r2.ebuild
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright 1999-2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/truecrypt/truecrypt-4.2a-r2.ebuild,v 1.2 2007/07/13 21:47:34 mr_bones_ Exp $
-
-inherit linux-mod toolchain-funcs
-
-DESCRIPTION="Free open-source disk encryption software"
-HOMEPAGE="http://www.truecrypt.org/"
-SRC_URI="http://www.truecrypt.org/downloads/truecrypt-${PV}-source-code.tar.gz"
-
-LICENSE="truecrypt-collective-1.0"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND="virtual/linux-sources
- sys-fs/device-mapper"
-
-RDEPEND="sys-fs/device-mapper"
-
-BUILD_PARAMS="KERNEL_SRC=${KERNEL_DIR} NO_WARNINGS=1"
-BUILD_TARGETS="truecrypt"
-MODULE_NAMES="truecrypt(block:${S}/Linux/Kernel)"
-
-pkg_setup() {
- linux-info_pkg_setup
- dmcrypt_check
- kernel_is lt 2 6 5 && die 'requires at least 2.6.5 kernel version'
-}
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}/${P}_kernel-2.6.18-rc1_fix.patch"
- epatch "${FILESDIR}/${P}-2.6.19.patch"
- epatch "${FILESDIR}/${P}-2.6.20.patch"
- epatch "${FILESDIR}/${P}-makefile.patch"
- linux-mod_pkg_setup
-}
-
-src_compile() {
- linux-mod_src_compile || die "Truecrypt module compilation failed."
- cd "${S}/Linux/Cli"
- einfo "Building truecrypt utility"
- tc-export CC
- # remove kernel linked crypt stuff
- emake clean || die "make clean failed"
- emake truecrypt NO_STRIP=1 || die "Compile and/or linking of TrueCrypt Linux CLI application failed."
-}
-
-src_test() {
- "${S}/Linux/Cli/truecrypt" --test
-}
-
-pkg_preinst() {
- # 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
-}
-
-src_install() {
- # installing files
- dobin Linux/Cli/truecrypt
- doman Linux/Cli/Man/truecrypt.1
- dodoc Readme.txt 'Release/Setup Files/TrueCrypt User Guide.pdf'
-
- # installing kernel module
- linux-mod_src_install
-}
-
-pkg_postinst() {
- linux-mod_pkg_postinst
- elog " For TrueCrypt 4.2 to work you have to load a "
- elog " kernel module. This can be done in three ways: "
- elog
- elog " 1. Loading the module automatically by the running kernel. "
- elog " For this 'Automatic kernel module loading' needs to be "
- elog " enabled (CONFIG_KMOD=y). "
- elog " 2. Loading the module manually before mounting the volume. "
- elog " Try 'modprobe truecrypt' as root to load the module. "
- elog " 3. Load the module during boot by listing it in "
- elog " '/etc/modules.autoload.d/kernel-2.6' "
-}
-
-dmcrypt_check() {
- ebegin "Checking for Device mapper support (BLK_DEV_DM)"
- linux_chkconfig_present BLK_DEV_DM
- eend $?
-
- if [[ $? -ne 0 ]] ; then
- ewarn "TrueCrypt requires Device mapper support!"
- ewarn "Please enable Device mapper support in your kernel config, found at:"
- ewarn "(for 2.6 kernels)"
- ewarn
- ewarn " Device Drivers"
- ewarn " Multi-Device Support"
- ewarn " <*> Device mapper support"
- ewarn
- ewarn "and recompile your kernel if you want this package to work."
- epause 10
- fi
-}
diff --git a/app-crypt/truecrypt/truecrypt-4.2a-r3.ebuild b/app-crypt/truecrypt/truecrypt-4.2a-r3.ebuild
deleted file mode 100644
index e10c07c62b8d..000000000000
--- a/app-crypt/truecrypt/truecrypt-4.2a-r3.ebuild
+++ /dev/null
@@ -1,108 +0,0 @@
-# Copyright 1999-2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/truecrypt/truecrypt-4.2a-r3.ebuild,v 1.3 2007/07/13 21:47:34 mr_bones_ Exp $
-
-inherit linux-mod toolchain-funcs
-
-DESCRIPTION="Free open-source disk encryption software"
-HOMEPAGE="http://www.truecrypt.org/"
-SRC_URI="http://www.truecrypt.org/downloads/truecrypt-${PV}-source-code.tar.gz"
-
-LICENSE="truecrypt-collective-1.0"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND="virtual/linux-sources
- sys-fs/device-mapper"
-
-RDEPEND="sys-fs/device-mapper"
-
-pkg_setup() {
- linux-info_pkg_setup
- dmcrypt_check
- kernel_is lt 2 6 5 && die 'requires at least 2.6.5 kernel version'
-
- BUILD_PARAMS="KERNEL_SRC=${KERNEL_DIR} NO_WARNINGS=1"
- BUILD_TARGETS="truecrypt"
- MODULE_NAMES="truecrypt(block:${S}/Linux/Kernel)"
-
-}
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch "${FILESDIR}/${P}_kernel-2.6.18-rc1_fix.patch"
- epatch "${FILESDIR}/${P}-2.6.19.patch"
- epatch "${FILESDIR}/${P}-2.6.20.patch"
- epatch "${FILESDIR}/${P}-makefile.patch"
- linux-mod_pkg_setup
-}
-
-src_compile() {
- linux-mod_src_compile || die "Truecrypt module compilation failed."
- cd "${S}/Linux/Cli"
- einfo "Building truecrypt utility"
- tc-export CC
- # remove kernel linked crypt stuff
- emake clean || die "make clean failed"
- emake truecrypt NO_STRIP=1 || die "Compile and/or linking of TrueCrypt Linux CLI application failed."
-}
-
-src_test() {
- "${S}/Linux/Cli/truecrypt" --test
-}
-
-pkg_preinst() {
- # 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
-}
-
-src_install() {
- # installing files
- dobin Linux/Cli/truecrypt
- doman Linux/Cli/Man/truecrypt.1
- dodoc Readme.txt 'Release/Setup Files/TrueCrypt User Guide.pdf'
- insinto "/$(get_libdir)/rcscripts/addons"
- newins "${FILESDIR}/${PN}-stop.sh" "${PN}-stop.sh"
-
- # installing kernel module
- linux-mod_src_install
-}
-
-pkg_postinst() {
- linux-mod_pkg_postinst
- elog " For TrueCrypt 4.2 to work you have to load a "
- elog " kernel module. This can be done in three ways: "
- elog
- elog " 1. Loading the module automatically by the running kernel. "
- elog " For this 'Automatic kernel module loading' needs to be "
- elog " enabled (CONFIG_KMOD=y). "
- elog " 2. Loading the module manually before mounting the volume. "
- elog " Try 'modprobe truecrypt' as root to load the module. "
- elog " 3. Load the module during boot by listing it in "
- elog " '/etc/modules.autoload.d/kernel-2.6' "
-}
-
-dmcrypt_check() {
- ebegin "Checking for Device mapper support (BLK_DEV_DM)"
- linux_chkconfig_present BLK_DEV_DM
- eend $?
-
- if [[ $? -ne 0 ]] ; then
- ewarn "TrueCrypt requires Device mapper support!"
- ewarn "Please enable Device mapper support in your kernel config, found at:"
- ewarn "(for 2.6 kernels)"
- ewarn
- ewarn " Device Drivers"
- ewarn " Multi-Device Support"
- ewarn " <*> Device mapper support"
- ewarn
- ewarn "and recompile your kernel if you want this package to work."
- epause 10
- fi
-}