]> CyberLeo.Net >> Repos - CDN/portage-cdn.git/blob - app-crypt/truecrypt/truecrypt-6.1.ebuild
Initial import
[CDN/portage-cdn.git] / app-crypt / truecrypt / truecrypt-6.1.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils toolchain-funcs multilib wxwidgets
6
7 DESCRIPTION="Free open-source disk encryption software"
8 HOMEPAGE="http://www.truecrypt.org/"
9 #SRC_URI="TrueCrypt ${PV} Source.tar.gz"
10 SRC_URI="${P}.tar.gz
11         pkcs11.h 
12         pkcs11f.h 
13         pkcs11t.h"
14
15 LICENSE="truecrypt-collective-1.4"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="X"
19 RESTRICT="mirror fetch bindist"
20
21 RDEPEND="sys-fs/fuse
22         =x11-libs/wxGTK-2.8*"
23 DEPEND="${RDEPEND}"
24
25 S="${WORKDIR}/${P}-source"
26 MY_P="${P}.tar.gz"
27
28 pkg_nofetch() {
29         einfo "Please download tar.gz source from:"
30         einfo "http://www.truecrypt.org/downloads2.php"
31         einfo "Then put the file in ${DISTDIR}/${MY_P}"
32         einfo "Please download RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20"
33         einfo "header files:"
34         einfo "ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11.h" 
35         einfo "ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11f.h"
36         einfo "ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11t.h"
37         einfo "Then put files in ${DISTDIR}"
38 }
39
40 pkg_setup() {
41         WX_GTK_VER="2.8"
42         if use X; then
43                 need-wxwidgets unicode
44         else
45                 need-wxwidgets base-unicode
46         fi
47 }
48
49 src_unpack() {
50         unpack ${MY_P}
51         cd "${S}"
52 #       epatch "${FILESDIR}/${P}-gcc-4.3.patch"
53 #       epatch "${FILESDIR}/${PN}-5.1a-external-wx.patch"
54 #       epatch "${FILESDIR}/${PN}-5.1-64bit.patch"
55 #       epatch "${FILESDIR}/${PN}-5.0-bool.patch"
56         epatch "${FILESDIR}/${PN}-6.1-64bit.patch"
57         epatch "${FILESDIR}/${PN}-6.1-bool.patch"
58         epatch "${FILESDIR}/${PN}-6.1-external-wx.patch"
59 }
60
61 src_compile() {
62         local EXTRA
63         use amd64 && EXTRA="${EXTRA} USE64BIT=1"
64         use X || EXTRA="${EXTRA} NOGUI=1"
65         if has_version '<=sys-libs/glibc-2.7'; then
66                 if [ "$(gcc-version)" = "4.3" ]; then
67                         elog "You are trying to compile ${P} using >=sys-devel/gcc-4.3 and <sys-libs/glibc-2.7"
68                         elog "In this case compiling will failed if not -O0 optimization flag used."
69                         elog "Therefore ${P} will compliling with -O0 flag."
70                         elog "Otherwise you could install >=sys-libs/glibc-2.7 or use <sys-devel/gcc-4.3"
71                         CFLAGS="${CFLAGS} -O0" 
72                         CXXFLAGS="${CXXFLAGS} -O0"
73                 fi
74         fi
75         emake \
76                 ${EXTRA} \
77                 PKCS11_INC="${DISTDIR}" \
78                 NOSTRIP=1 \
79                 VERBOSE=1 \
80                 NOTEST=1 \
81                 CC="$(tc-getCC)" \
82                 AR="$(tc-getAR)" \
83                 CXX="$(tc-getCXX)" \
84                 RANLIB="$(tc-getRANLIB)" \
85                 EXTRA_CFLAGS="${CFLAGS}" \
86                 EXTRA_CXXFLAGS="${CXXFLAGS}" \
87                 EXTRA_LDFLAGS="${LDFLAGS}" \
88                 WX_CONFIG="${WX_CONFIG}" \
89                 WX_CONFIG_EXTRA="" \
90                 || die
91 }
92
93 src_test() {
94         "${S}/Main/truecrypt" --text --test
95 }
96
97 src_install() {
98         dobin Main/truecrypt
99         dodoc Readme.txt 'Release/Setup Files/TrueCrypt User Guide.pdf'
100         insinto "/$(get_libdir)/rcscripts/addons"
101         newins "${FILESDIR}/${PN}-stop.sh" "${PN}-stop.sh"
102 }
103
104 pkg_postinst() {
105         elog "potential legal problems - use at own risk"
106         elog "http://lists.freedesktop.org/archives/distributions/2008-October/000276.html"
107 }