Add dev-libs/crypto++-5.5.2-r1.
[overlay.git] / dev-libs / crypto++ / crypto++-5.5.2-r1.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/crypto++/crypto++-5.5.2-r1.ebuild,v 1.2 2008/08/30 02:33:58 dragonheart Exp $
4
5 inherit flag-o-matic eutils toolchain-funcs multilib
6
7 DESCRIPTION="Crypto++ is a C++ class library of cryptographic schemes"
8 HOMEPAGE="http://cryptopp.com"
9 SRC_URI="mirror://sourceforge/cryptopp/cryptopp${PV//.}.zip"
10
11 LICENSE="cryptopp"
12 SLOT="0"
13 KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86"
14 DEPEND="app-arch/unzip"
15 RDEPEND=""
16 IUSE="sse3"
17
18 S="${WORKDIR}"
19
20 src_compile() {
21         # More than -O1 gives problems
22         replace-flags -O? -O1
23         filter-flags -fomit-frame-pointer
24         append-flags -DCRYPTOPP_DISABLE_SSE2 -DCRYPTOPP_DISABLE_ASM
25         emake -f GNUmakefile \
26                 CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" \
27                 AR="$(tc-getAR)" \
28                 RANLIB="$(tc-getRANLIB)" || die
29 }
30
31 src_test() {
32         # make sure all test vectors have unix line endings
33         for f in TestVectors/* ; do
34                 edos2unix $f
35         done
36
37         if ! ./cryptest.exe v; then
38             eerror "crypto++ self-tests failed"
39             eerror "Try to remove some optimization flags and re-emerge"
40             die
41         fi;
42 }
43
44 src_install() {
45         # For consistency across GNU/Linux distributions,
46         # "crypto++" has been preferred over "crytopp"...
47         newlib.a libcryptopp.a libcrypto++.a
48         # ...unbreak programs which don't expect this
49         dosym libcrypto++.a /usr/$(get_libdir)/libcryptopp.a
50         insinto /usr/include/crypto++
51         doins *.h
52         # should the .exe extension be removed??
53         dobin cryptest.exe
54         # unbreak programs which expect cryptopp
55         into /usr/include
56         dosym crypto++ /usr/include/cryptopp
57 }