summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDane Smith <smithdanea@gmail.com>2010-07-25 17:25:59 -0400
committerDane Smith <smithdanea@gmail.com>2010-07-25 17:25:59 -0400
commit16eb13cdcf2809ced4c7a328d3f3c87c04f93dac (patch)
tree0a78d64f391d76779cf7a0b52190c30414d0e9f6 /app-crypt
parentAgain (diff)
downloadsmithdanea-16eb13cdcf2809ced4c7a328d3f3c87c04f93dac.tar.gz
smithdanea-16eb13cdcf2809ced4c7a328d3f3c87c04f93dac.tar.bz2
smithdanea-16eb13cdcf2809ced4c7a328d3f3c87c04f93dac.zip
Start work on truecrypt-7.0
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/truecrypt/Manifest7
-rw-r--r--app-crypt/truecrypt/files/truecrypt-4.3a-2.6.23.patch15
-rw-r--r--app-crypt/truecrypt/files/truecrypt-4.3a-2.6.24.patch51
-rw-r--r--app-crypt/truecrypt/files/truecrypt-4.3a-2.6.29.patch19
-rw-r--r--app-crypt/truecrypt/files/truecrypt-stop.sh9
-rw-r--r--app-crypt/truecrypt/metadata.xml8
-rw-r--r--app-crypt/truecrypt/truecrypt-7.0.ebuild107
7 files changed, 216 insertions, 0 deletions
diff --git a/app-crypt/truecrypt/Manifest b/app-crypt/truecrypt/Manifest
new file mode 100644
index 0000000..579ad4f
--- /dev/null
+++ b/app-crypt/truecrypt/Manifest
@@ -0,0 +1,7 @@
+AUX truecrypt-4.3a-2.6.23.patch 707 RMD160 fa1221f99cddc9cd4e2c3768f4387d6b17320849 SHA1 2344a65fd9b8ccddcb65cb4c188bccf59bff5360 SHA256 199ab45e983203cfe0602175073c0b6fab2a1009e7699ea154613a3398bf3476
+AUX truecrypt-4.3a-2.6.24.patch 1658 RMD160 c29522d767f96ae01e266fbfd8441ddd37049f71 SHA1 b138b60c5b036243c13d294cf61a2e905f1c4b83 SHA256 d12dd2252daf753f3d56dd504627de0f5f652a67781e930d717d1a86b46e4636
+AUX truecrypt-4.3a-2.6.29.patch 416 RMD160 dc7721e5ac0ebd5a075c4f6c0d8cf80524cd549b SHA1 25f3ac87d78af68c40956ba788ac323b8ce73941 SHA256 a4d9da64b1976635c8ce97ca0dbd7e8e3b6805efc37d1616aa6046502278d1de
+AUX truecrypt-stop.sh 308 RMD160 4b2e6f47520f701324c03b5a43118cc38ee409a3 SHA1 7139ba403e482a4746e1d545115b74760b1438ea SHA256 243a9d1041b291e12ce2065959838f0cfe01484bffac7915991ebeb90d2ccd2c
+DIST truecrypt-7.0.tar.gz 1973038 RMD160 20947227c4e9ba0a0383e0b9b27ea350bb1dc0f8 SHA1 a1e73ce533fb21f7c878d34fa9a62c55a605924e SHA256 0b173af97abb542eb61431312a484d517abf922d86dc0446f5f9ca7c617100ed
+EBUILD truecrypt-7.0.ebuild 2617 RMD160 f4b4617c71212da32bcc7aa0501efe9c9e781df6 SHA1 cdc8ad210b00b785bb84c0498cbbab25bd0a20a1 SHA256 df756cbd0818627e97b27754586348e72def08c2ba7ef4a6872b71365bbd90d6
+MISC metadata.xml 224 RMD160 74db96ad8aa1d285d83ae93a9f4a767335f55c15 SHA1 d86a171d981b45e7ed0c0b3b5059d2a63c811001 SHA256 9e9ce661a9fdb45a535ad875a247b700a70745359b27533ec29a6a46fa708e86
diff --git a/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.23.patch b/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.23.patch
new file mode 100644
index 0000000..cfa54bf
--- /dev/null
+++ b/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.23.patch
@@ -0,0 +1,15 @@
+diff -urNp truecrypt-4.3a-source-code.org/Linux/Kernel/Dm-target.c truecrypt-4.3a-source-code/Linux/Kernel/Dm-target.c
+--- truecrypt-4.3a-source-code.org/Linux/Kernel/Dm-target.c 2007-04-24 19:32:06.000000000 +0300
++++ truecrypt-4.3a-source-code/Linux/Kernel/Dm-target.c 2007-10-10 23:18:24.000000000 +0200
+@@ -656,7 +656,11 @@ int __init dm_truecrypt_init(void)
+ goto err;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+ bio_ctx_cache = kmem_cache_create ("truecrypt-bioctx", sizeof (struct bio_ctx), 0, 0, NULL, NULL);
++#else
++ bio_ctx_cache = kmem_cache_create ("truecrypt-bioctx", sizeof (struct bio_ctx), 0, 0, NULL);
++#endif
+ if (!bio_ctx_cache)
+ {
+ error ("kmem_cache_create failed");
diff --git a/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.24.patch b/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.24.patch
new file mode 100644
index 0000000..eec4aa8
--- /dev/null
+++ b/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.24.patch
@@ -0,0 +1,51 @@
+diff -Nrup a/Linux/Kernel/Dm-target.c b/Linux/Kernel/Dm-target.c
+--- a/Linux/Kernel/Dm-target.c 2007-04-24 18:32:06.000000000 +0200
++++ b/Linux/Kernel/Dm-target.c 2007-12-22 15:07:56.000000000 +0100
+@@ -375,7 +375,11 @@ static void dereference_bio_ctx (struct
+ if (!atomic_dec_and_test (&bc->ref_count))
+ return;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+ bio_endio (bc->orig_bio, bc->orig_bio->bi_size, bc->error);
++#else
++ bio_endio (bc->orig_bio, bc->error);
++#endif
+ mempool_free (bc, tc->bio_ctx_pool);
+ }
+
+@@ -417,24 +421,35 @@ static void work_process (void *qdata)
+ }
+
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+ static int truecrypt_endio (struct bio *bio, unsigned int bytes_done, int error)
++#else
++static int truecrypt_endio (struct bio *bio, int error)
++#endif
+ {
+ struct bio_ctx *bc = (struct bio_ctx *) bio->bi_private;
+ struct target_ctx *tc = (struct target_ctx *) bc->target->private;
+ struct bio_vec *bv;
+ int seg_no;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+ trace (1, "end: sc=%llu fl=%ld rw=%ld sz=%d ix=%hd vc=%hd dn=%d er=%d\n",
+ (unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_rw, bio->bi_size, bio->bi_idx, bio->bi_vcnt, bytes_done, error);
++#else
++ trace (1, "end: sc=%llu fl=%ld sz=%ld rw=%ld ix=%hd vc=%hd er=%d\n",
++ (unsigned long long) bio->bi_sector, bio->bi_flags, bio->bi_size, bio->bi_rw, bio->bi_idx, bio->bi_vcnt, error);
++#endif
+
+ if (error != 0)
+ bc->error = error;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+ if (bio->bi_size)
+ {
+ trace (2, "Outstanding IO: %d\n", bio->bi_size);
+ return 1;
+ }
++#endif
+
+ if (bio_data_dir (bio) == READ)
+ {
diff --git a/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.29.patch b/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.29.patch
new file mode 100644
index 0000000..1ce09f6
--- /dev/null
+++ b/app-crypt/truecrypt/files/truecrypt-4.3a-2.6.29.patch
@@ -0,0 +1,19 @@
+--- Linux/Kernel/Dm-target.c
++++ Linux/Kernel/Dm-target.c
+@@ -703,12 +703,16 @@
+
+ void __exit dm_truecrypt_exit(void)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+ int r;
+
+ r = dm_unregister_target (&truecrypt_target);
+
+ if (r < 0)
+ error ("unregister failed %d", r);
++#else
++ dm_unregister_target (&truecrypt_target);
++#endif
+
+ destroy_workqueue (work_queue);
+ kmem_cache_destroy (bio_ctx_cache);
diff --git a/app-crypt/truecrypt/files/truecrypt-stop.sh b/app-crypt/truecrypt/files/truecrypt-stop.sh
new file mode 100644
index 0000000..50bb0b7
--- /dev/null
+++ b/app-crypt/truecrypt/files/truecrypt-stop.sh
@@ -0,0 +1,9 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2 or later
+
+# Try to remove any dm-crypt mappings
+if [ -x /usr/bin/truecrypt ]; then
+ ebegin "Removing truecrypt mappings"
+ ! /usr/bin/truecrypt -l > /dev/null 2>&1 || /usr/bin/truecrypt -d
+ eend $?
+fi
diff --git a/app-crypt/truecrypt/metadata.xml b/app-crypt/truecrypt/metadata.xml
new file mode 100644
index 0000000..df1a1a8
--- /dev/null
+++ b/app-crypt/truecrypt/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>crypto</herd>
+ <maintainer>
+ <email>crypto@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-crypt/truecrypt/truecrypt-7.0.ebuild b/app-crypt/truecrypt/truecrypt-7.0.ebuild
new file mode 100644
index 0000000..297b48b
--- /dev/null
+++ b/app-crypt/truecrypt/truecrypt-7.0.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/truecrypt/truecrypt-6.3a.ebuild,v 1.2 2009/12/27 08:54:08 josejx Exp $
+
+EAPI="2"
+
+inherit flag-o-matic linux-info multilib toolchain-funcs wxwidgets
+
+DESCRIPTION="Free open-source disk encryption software"
+HOMEPAGE="http://www.truecrypt.org/"
+SRC_URI="${P}.tar.gz"
+
+LICENSE="truecrypt-3.0"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="X"
+RESTRICT="bindist fetch mirror"
+
+RDEPEND="|| ( >=sys-fs/lvm2-2.02.45 sys-fs/device-mapper )
+ sys-fs/fuse
+ x11-libs/wxGTK:2.8[X?]"
+DEPEND="${RDEPEND}
+ || ( dev-libs/pkcs11-helper dev-libs/opensc )"
+RDEPEND="${RDEPEND}
+ app-admin/sudo"
+
+S="${WORKDIR}/${P}-source"
+
+pkg_nofetch() {
+ elog "Please download .tar.gz source from:"
+ elog "http://www.truecrypt.org/downloads2"
+ elog "Then put the file in ${DISTDIR}/${SRC_URI}"
+}
+
+pkg_setup() {
+ local CONFIG_CHECK="~BLK_DEV_DM ~DM_CRYPT ~FUSE_FS ~CRYPTO"
+ linux-info_pkg_setup
+
+ local WX_GTK_VER="2.8"
+ if use X; then
+ need-wxwidgets unicode
+ else
+ need-wxwidgets base-unicode
+ fi
+}
+
+src_prepare() {
+ if has_version x11-libs/wxGTK[X]; then
+ # Fix linking when NOGUI=1
+ sed -e "s/WX_CONFIG_LIBS := base/&,core/" -i Main/Main.make || die "sed Main/Main.make failed"
+ fi
+}
+
+src_compile() {
+ local EXTRA pkcs11_include_directory
+
+ use X || EXTRA+=" NOGUI=1"
+
+ if has_version dev-libs/pkcs11-helper; then
+ pkcs11_include_directory="/usr/include/pkcs11-helper-1.0"
+ else
+ pkcs11_include_directory="/usr/include/opensc"
+ fi
+ append-flags -DCKR_NEW_PIN_MODE=0x000001B0 -DCKR_NEXT_OTP=0x000001B1
+
+ emake \
+ ${EXTRA} \
+ NOSTRIP=1 \
+ NOTEST=1 \
+ VERBOSE=1 \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ AR="$(tc-getAR)" \
+ RANLIB="$(tc-getRANLIB)" \
+ TC_EXTRA_CFLAGS="${CFLAGS}" \
+ TC_EXTRA_CXXFLAGS="${CXXFLAGS}" \
+ TC_EXTRA_LFLAGS="${LDFLAGS}" \
+ WX_CONFIG="${WX_CONFIG}" \
+ PKCS11_INC="${pkcs11_include_directory}" \
+ || die "emake failed"
+}
+
+src_test() {
+ "${S}/Main/truecrypt" --text --test || die "tests failed"
+}
+
+src_install() {
+ dobin Main/truecrypt
+ dodoc Readme.txt "Release/Setup Files/TrueCrypt User Guide.pdf"
+ insinto "/$(get_libdir)/rcscripts/addons"
+ newins "${FILESDIR}/${PN}-stop.sh" "${PN}-stop.sh"
+}
+
+pkg_postinst() {
+ warn_license
+}
+pkg_preinst() {
+ warn_license
+}
+
+warn_license() {
+ ewarn "TrueCrypt has very restrictive license."
+ ewarn "Please read the ${LICENSE} license in ${PORTDIR}/licenses"
+ ewarn "directory before using TrueCrypt. Please be explicitly aware of"
+ ewarn "the limitations on redistribution of binaries or modified source."
+ ebeep 5
+}