summaryrefslogtreecommitdiff
blob: 7071905e9e80a26d3ddc57a385f54a5b60219ae9 (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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/monetdb/monetdb-5.2.0.ebuild,v 1.1 2007/11/06 10:44:06 grobian Exp $

inherit flag-o-matic

COMMON_PV=1.20.0
CLIENTS_PV=1.20.0
M5_PV=5.2.0
SQL_PV=2.20.0

DESCRIPTION="MonetDB/SQL is a main-memory column-store database"
HOMEPAGE="http://monetdb.cwi.nl/"
SRC_URI="mirror://sourceforge/monetdb/MonetDB-${COMMON_PV}.tar.gz
	mirror://sourceforge/monetdb/clients-${CLIENTS_PV}.tar.gz
	mirror://sourceforge/monetdb/MonetDB5-${M5_PV}.tar.gz
	mirror://sourceforge/monetdb/sql-${SQL_PV}.tar.gz"

LICENSE="MonetDBPL-1.1"
SLOT="5"
KEYWORDS="~amd64 ~x86"
IUSE="python perl php java"

S=${WORKDIR}

DEPEND="dev-libs/libpcre
	dev-libs/openssl
	sys-libs/readline
	python? ( dev-lang/python )
	perl? ( dev-lang/perl )
	php? ( dev-lang/php )
	java? ( dev-java/ant >=virtual/jdk-1.4 <=virtual/jdk-1.6 )"
RDEPEND="${DEPEND}"

pkg_preinst() {
	enewgroup monetdb
	enewuser monetdb
}

src_compile() {
	local myconf=
	# Upstream likes to stick things like -O6 and what more in CFLAGS
	myconf="${myconf} --disable-strict --disable-optimize --disable-assert"
	# Deal with auto-dependencies
	myconf="${myconf} $(use_with python)"
	myconf="${myconf} $(use_with perl)"
	myconf="${myconf} $(use_with php)"
	myconf="${myconf} $(use_with java)"

	cd "${S}"/MonetDB-${COMMON_PV} || die
	econf ${myconf} || die
	emake || die "common"

	mkdir "${T}"/bin
	cp conf/monetdb-config "${T}"/bin/monetdb-config
	chmod 755 "${T}"/bin/monetdb-config

	append-flags -I"${S}"/MonetDB-${COMMON_PV}/src/common
	append-ldflags -L"${S}"/MonetDB-${COMMON_PV}/src/common/.libs
	cd "${S}"/clients-${CLIENTS_PV} || die
	econf --with-monetdb="${T}" ${myconf} || die
	emake || die "clients"

	append-flags -I"${S}"/MonetDB-${COMMON_PV}/src/gdk
	append-ldflags -L"${S}"/MonetDB-${COMMON_PV}/src/gdk/.libs
	append-flags -I"${S}"/clients-${CLIENTS_PV}/src
	append-ldflags -L"${S}"/clients-${CLIENTS_PV}/src/mapilib/.libs
	cd "${S}"/MonetDB5-${M5_PV} || die
	econf --with-monetdb="${T}" ${myconf} || die
	emake || die "MonetDB5"

	cp conf/monetdb5-config "${T}"/bin/monetdb5-config
	chmod 755 "${T}"/bin/monetdb5-config

	append-flags -I"${S}"/MonetDB5-${M5_PV}
	append-flags -I"${S}"/MonetDB5-${M5_PV}/src/{mal,optimizer,scheduler}
	append-ldflags -L"${S}"/MonetDB5-${M5_PV}/src/{mal,optimizer,scheduler}/.libs
	append-flags -I"${S}"/MonetDB5-${M5_PV}/src/modules/{atoms,kernel,mal}
	append-ldflags -L"${S}"/MonetDB5-${M5_PV}/src/modules/{atoms,kernel,mal}/.libs
	cd "${S}"/sql-${SQL_PV} || die
	econf --with-monetdb="${T}" --with-monetdb5="${T}" ${myconf} || die
	emake || die "sql"
}

src_install() {
	cd "${S}"/MonetDB-${COMMON_PV} || die
	emake DESTDIR="${D}" install || die "common"

	cd "${S}"/clients-${CLIENTS_PV} || die
	emake DESTDIR="${D}" install || die "clients"

	cd "${S}"/MonetDB5-${M5_PV} || die
	# parallel is broken here
	emake -j1 DESTDIR="${D}" install || die "MonetDB5"

	cd "${S}"/sql-${SQL_PV} || die
	emake DESTDIR="${D}" install || die "sql"

	# remove testing framework and compiled tests
	rm -f \
		"${D}/usr/bin/Mapprove.py" \
		"${D}/usr/bin/Mdiff" \
		"${D}/usr/bin/Mfilter.py" \
		"${D}/usr/bin/MkillUsers" \
		"${D}/usr/bin/Mlog" \
		"${D}/usr/bin/Mprofile.py" \
		"${D}/usr/bin/Mtest.py" \
		"${D}/usr/bin/Mtimeout" \
		"${D}/usr/bin/prof.py" \
		"${D}/usr/share/MonetDB/Mprofile-commands.lst" \
		"${D}/usr/MonetDB/subprocess26.py" \
		"${D}/usr/MonetDB/trace.py" \
		"${D}/usr/MonetDB/__init__.py" \
		"${D}/usr/MonetDB/monet_options.py" \
		|| die "removing testing tools"
	rm -Rf \
		"${D}/usr/lib/MonetDB/Tests" \
		"${D}/usr/lib/sql/Tests" \
		"${D}/usr/share/MonetDB/Tests" \
		"${D}/usr/share/sql/Tests" \
		|| die "removing tests"
	# remove windows cruft
	find "${D}" -name "*.bat" | xargs rm -f || die "removing windows stuff"

	newinitd "${FILESDIR}/${PN}.init-5.2.0" monetdb || die "init.d script"
	newconfd "${FILESDIR}/${PN}.conf-5.2.0" monetdb || die "conf.d file"

	# merovingian needs this
	keepdir /var/lib/MonetDB5/dbfarm
}