forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cryptlib-3.4.3.1-r2.ebuild
112 lines (85 loc) · 2.63 KB
/
cryptlib-3.4.3.1-r2.ebuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 pypy )
DISTUTILS_OPTIONAL=1
inherit distutils-r1 eutils flag-o-matic multilib toolchain-funcs versionator
MY_PV="${PV//.}"
DESCRIPTION="Powerful security toolkit for adding encryption to software"
HOMEPAGE="http://www.cs.auckland.ac.nz/~pgut001/cryptlib/"
DOC_PREFIX="${PN}-$(get_version_component_range 1-2 ${PV}).0"
SRC_URI="ftp://ftp.franken.de/pub/crypt/cryptlib/cl${MY_PV}.zip
doc? ( mirror://gentoo/${DOC_PREFIX}-manual.pdf.bz2 )"
LICENSE="Sleepycat"
KEYWORDS="amd64 x86"
SLOT="0"
IUSE="doc ldap odbc python static-libs test"
S="${WORKDIR}"
RDEPEND="sys-libs/zlib
ldap? ( net-nds/openldap )
odbc? ( dev-db/unixODBC )
python? ( ${PYTHON_DEPS} )"
DEPEND="${RDEPEND}
app-arch/unzip"
PATCHES=(
"${FILESDIR}/${P}-build.patch"
"${FILESDIR}/${P}-zlib.patch"
)
# test access the network
RESTRICT="test"
src_unpack() {
# we need the -a option, so we can not use 'unpack'
unzip -qoa "${DISTDIR}/cl${MY_PV}.zip" || die
use doc && unpack "${DOC_PREFIX}-manual.pdf.bz2"
}
wrap_python() {
if use python; then
cd bindings || die
distutils-r1_${1}
fi
}
src_prepare() {
default
rm -fr zlib || die
# we want our own CFLAGS ;-)
sed -i -e "s:-m.*=pentium::g" -e "s:-fomit-frame-pointer::g" -e "s:-O2::g" \
-e "s:-O3::g" -e "s:-O4::g" makefile || die "sed makefile failed"
sed -i -e "s/-march=[[:alnum:]\.=-]*//g" -e "s/-mcpu=[[:alnum:]\.=-]*//g" \
-e "s:-O2::g" -e "s:-O3::g" tools/ccopts.sh || die "sed tools/ccopts.sh failed"
# change 'make' to '$(MAKE)'
sed -i -e "s:@\?make:\$(MAKE):g" makefile || die "sed makefile failed"
wrap_python ${FUNCNAME}
}
src_compile() {
use ldap && append-cppflags -DHAS_LDAP
use odbc && append-cppflags -DHAS_ODBC
export DISABLE_AUTODETECT=1
emake EXTRA_CFLAGS="${CPPFLAGS} ${CFLAGS}" shared
use static-libs && emake EXTRA_CFLAGS="${CPPFLAGS} ${CFLAGS}" default
use test && emake EXTRA_CFLAGS="${CPPFLAGS} ${CFLAGS}" stestlib
#
# Without this:
# 1. python will link against the static lib
# 2. tests will not work find soname.
#
local libname="libcl.so.$(get_version_component_range 1-3 ${PV})"
local solibname="libcl.so.$(get_version_component_range 1-2 ${PV})"
ln -s "${libname}" "${solibname}" || die
ln -s "${solibname}" libcl.so || die
if use python; then
wrap_python ${FUNCNAME}
fi
}
src_test() {
LD_LIBRARY_PATH="." ./stestlib || die "test failed"
}
src_install() {
einstalldocs
doheader cryptlib.h
dolib.so libcl.so*
use static-libs && dolib.a libcl.a
if use doc; then
newdoc "${DOC_PREFIX}-manual.pdf" "manual.pdf"
fi
wrap_python ${FUNCNAME}
}