blob: baba5c026012b726a8f78d4d7af818ecc7fba2d9 (
plain)
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
|
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/poco/poco-1.3.2.ebuild,v 1.2 2008/06/29 09:37:01 dev-zero Exp $
EAPI="1"
inherit eutils toolchain-funcs flag-o-matic
DESCRIPTION="C++ class libraries that simplify and accelerate the development of network-centric, portable applications."
HOMEPAGE="http://pocoproject.org/"
SRC_URI="mirror://sourceforge/poco/${P}-data.tar.bz2
doc? ( mirror://sourceforge/poco/${P}-doc.tar.gz )"
LICENSE="Boost-1.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc examples iodbc odbc sqlite ssl"
DEPEND="dev-libs/libpcre
dev-libs/expat
odbc? ( iodbc? ( dev-db/libiodbc )
!iodbc? ( dev-db/unixODBC ) )
ssl? ( dev-libs/openssl )
sqlite? ( dev-db/sqlite:3 )"
RDEPEND="${DEPEND}"
# Upstream has three editions: "economic", "with NetSSL" and "with NetSSL and Data"
# We take the last one and provide useflags for ssl, odbc, sqlite
S="${WORKDIR}/${P}-data"
src_unpack() {
unpack ${A}
cd "${S}"
epatch \
"${FILESDIR}/${PV}-missing_includes.patch" \
"${FILESDIR}/${PV}-gentoo.patch"
}
src_compile() {
local targets="all"
local odbc="unixodbc"
if use ssl; then
targets="${targets} NetSSL_OpenSSL-libexec"
echo NetSSL_OpenSSL >> components
fi
if use odbc; then
targets="${targets} Data/ODBC-libexec"
echo Data/ODBC >> components
if use iodbc; then
append-flags "-I/usr/include/iodbc"
odbc="iodbc"
fi
fi
if use sqlite; then
targets="${targets} Data/SQLite-libexec"
echo Data/SQLite >> components
fi
if has test ${FEATURES}; then
targets="${targets} cppunit tests"
echo CppUnit >> components
use ssl && targets="${targets} NetSSL_OpenSSL-tests"
use odbc && targets="${targets} Data/ODBC-tests"
use sqlite && targets="${targets} Data/SQLite-tests"
fi
# not autoconf
./configure \
--no-samples \
--prefix=/usr \
|| die "configure failed"
sed -i \
-e "s|CC = .*|CC = $(tc-getCC)|" \
-e "s|CXX = .*|CXX = $(tc-getCXX)|" \
-e "s|RANLIB = .*|RANLIB = $(tc-getRANLIB)|" \
-e "s|LIB = ar|LIB = $(tc-getAR)|" \
-e "s|STRIP = .*|STRIP = /usr/bin/true|" \
-e "s|CFLAGS = |CFLAGS = ${CFLAGS}|" \
-e "s|CXXFLAGS = |CXXFLAGS = ${CXXFLAGS} |" \
-e "s|LINKFLAGS = |LINKFLAGS = ${LDFLAG} |" \
-e 's|-O2||g' \
build/config/Linux build/config/FreeBSD || die "sed failed"
emake POCO_PREFIX=/usr GENTOO_ODBC="${odbc}" LIBDIR="$(get_libdir)" ${targets} || die "emake failed"
}
src_install() {
emake POCO_PREFIX=/usr LIBDIR="$(get_libdir)" DESTDIR="${D}" install || die "emake install failed"
dodoc CHANGELOG CONTRIBUTORS NEWS README
use doc && dohtml -r "${WORKDIR}/${P}-doc"/*
if use examples ; then
for d in Net XML Data Util NetSSL_OpenSSL Foundation ; do
insinto /usr/share/doc/${PF}/examples/${d}
doins -r ${d}/samples
done
find "${D}/usr/share/doc/${PF}/examples" \
-iname "*.sln" -or -iname "*.vcproj" -or \
-iname "*.vmsbuild" -or -iname "*.properties" \
| xargs rm
fi
}
|