/[gentoo-x86]/dev-db/monetdb/monetdb-4.10.2.ebuild
Gentoo

Contents of /dev-db/monetdb/monetdb-4.10.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Tue Nov 6 10:44:06 2007 UTC (12 years, 2 months ago) by grobian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
Backport latest release from Gentoo/Alt:Prefix overlay.  Keep it still masked as it needs to be tested non-prefix first.  Remove old non-compiling cruft.
(Portage version: 2.1.3.9)

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-db/monetdb/monetdb-4.10.2.ebuild,v 1.9 2007/04/28 22:07:02 tove Exp $
4
5 inherit flag-o-matic eutils
6
7 DESCRIPTION="A main-memory relational database for SQL, XQuery and MIL"
8 HOMEPAGE="http://monetdb.cwi.nl/"
9 IUSE="java readline debug"
10 PV_SQL=2.10.2
11 PV_XQ=0.10.2
12 PV_M=${PV}
13 SRC_URI="mirror://sourceforge/monetdb/MonetDB-${PV_M}.tar.gz
14 mirror://sourceforge/monetdb/MonetDB-SQL-${PV_SQL}.tar.gz
15 mirror://sourceforge/monetdb/MonetDB-XQuery-${PV_XQ}.tar.gz"
16 LICENSE="MonetDBPL-1.1 PathfinderPL-1.1"
17 SLOT="0"
18 KEYWORDS="ppc x86"
19 RESTRICT="test"
20
21 DEPEND="virtual/libc
22 >=sys-devel/gcc-3.3
23 java? ( >=virtual/jdk-1.4 )
24 java? ( dev-java/ant-core )
25 readline? ( >=sys-libs/readline-4.1 )
26 dev-libs/libxml2
27 >=dev-libs/libpcre-5"
28
29 DATA_DIR="/var/lib/MonetDB"
30
31 pkg_setup() {
32 # see if we have a dbfarm, and whether there is a version of monetdb
33 # installed which is not a version that we can 'upgrade' to.
34 if [ -x "${DATA_DIR}/dbfarm" ] || [ -x "${DATA_DIR}/log" ];
35 then
36 if [ -x "/usr/bin/monetdb-config" ] && \
37 [ "`/usr/bin/monetdb-config --version`" != "${PV_M}" ];
38 then
39 while read line; do eerror "${line}"; done <<EOF
40 MonetDB ${MY_PV} cannot upgrade your existing SQL databases. You must
41 export your existing SQL databases to a file using "JdbcClient -D" and
42 then restore them when you have upgraded completey using
43 "JdbcClient -f". Dumping and restoring of MIL and XQuery databases
44 unfortunately is not possible at the moment.
45
46 You must remove your entire database directory to continue.
47 (database directory = ${DATA_DIR}).
48 See the following url for more information on dumping and
49 restoring your database:
50 http://monetdb.cwi.nl/TechDocs/FrontEnds/SQL/upgrade/
51 EOF
52 die "Cannot upgrade automatically."
53 fi
54 fi
55
56 enewgroup monetdb
57 enewuser monetdb -1 /bin/bash "${DATA_DIR}" monetdb
58 }
59
60 src_unpack() {
61 unpack ${A} || die
62
63 epatch "${FILESDIR}/${PN}-${PV_M}"-gentoo-MapiClient.patch
64 epatch "${FILESDIR}/${PN}-${PV_M}"-gentoo-conf.patch
65 }
66
67 src_compile() {
68 # The tar has capitals, the ebuild doesn't...
69 cd "${WORKDIR}/MonetDB-${PV_M}"
70
71 # setting these respects the user's CFLAGS and disables -Werror etc.
72 local myconf="--disable-optimize --disable-debug"
73 sed -i \
74 -e 's|CFLAGS="\$CFLAGS \\\$(X_CFLAGS)"||' \
75 configure || die "failed fixing configure"
76
77 # Gentoo's amd64 doesn't allow 32-bits monetdb to compile, hence we switch
78 # to 64-bits Mserver here. Note that this also gives 64-bits OIDs.
79 use amd64 && myconf="${myconf} --enable-bits=64"
80
81 myconf="${myconf} $(use_with java)"
82 myconf="${myconf} $(use_with readline)"
83 myconf="${myconf} $(use_enable debug assert)"
84
85 econf ${myconf} || die "econf monetdb failed"
86
87 # NOTE: the Makefiles have serious issues with parallel builds.
88 # Nothing is guaranteed to work but a single process build.
89 emake -j1 || die "emake monetdb failed"
90
91 # make the header files available to the sql and xquery compilation
92 mkdir include
93 cd include
94 ln -s ../src/common
95 ln -s ../src/gdk
96 ln -s ../src/monet
97 ln -s ../src/modules/plain
98 ln -s ../src/modules/contrib
99 ln -s ../src/mapi
100 ln -s ../src/mapi/clients/C
101 ln -s ../monetdb_config.h
102 ln -s ../sysdefs.h
103
104 cd "${WORKDIR}/MonetDB-${PV_M}"
105 mkdir -p lib/MonetDB
106 cd lib/MonetDB
107 find ../.. -name "lib_*" -exec ln -s {} ';' >& /dev/null
108 ln -s . .libs
109
110 cd "${WORKDIR}/MonetDB-${PV_M}/lib"
111 find .. -name "lib*" -exec ln -s {} ';' >& /dev/null
112 ln -s . .libs
113
114 # enable the fool-script
115 mkdir -p "${WORKDIR}/MonetDB-${PV_M}/bin"
116 MYWD=`echo ${WORKDIR} | sed -re 's/\//\\\\\//g'`
117 sed -r \
118 -e "s/\\$\_MONETDB\_INCLUDEDIR/${MYWD}\/MonetDB-${PV_M}\/include/g" \
119 -e "s/\\$\_MONETDB\_VERSION/${PV_M}/g" \
120 -e "s/\\$\_MONETDB\_LIBS/-L${MYWD}\/MonetDB-${PV_M}\/lib\/MonetDB -L${MYWD}\/MonetDB-${PV_M}\/lib/g" \
121 -e "s/\\$\_MONETDB\_MOD_PATH/${MYWD}\/MonetDB-${PV_M}\/include/g" \
122 -e "s/\\$\_MONETDB\_PREFIX/${MYWD}\/MonetDB-${PV_M}/g" \
123 -e "s/\\$\_MONETDB\_CLASSPATH/${MYWD}\/MonetDB-${PV_M}\/src\/mapi\/clients\/java\/mapi.jar/g" \
124 "${FILESDIR}/monetdb_config.sh" > \
125 "${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config"
126 chmod 744 "${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config"
127
128 # configure and make SQL
129 cd "${WORKDIR}/sql-${PV_SQL}"
130 econf MONETDB_CONFIG="${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config" \
131 "--with-monet=${WORKDIR}/MonetDB-${PV_M}" \
132 ${myconf} \
133 || die
134 emake -j1 || die "emake sql failed"
135
136 # configure and make XQuery
137 cd "${WORKDIR}/pathfinder-${PV_XQ}"
138 econf MONETDB_CONFIG="${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config" \
139 "--with-monet=${WORKDIR}/MonetDB-${PV_M} " \
140 ${myconf} || die
141 emake -j1 || die "emake xquery failed"
142 }
143
144 src_install() {
145 # The tar has capitals, the ebuild doesn't...
146 cd "${WORKDIR}/MonetDB-${PV_M}"
147 emake -j1 DESTDIR="${D}" install || die "failed to install monetdb"
148
149 cd "${WORKDIR}/sql-${PV_SQL}"
150 emake -j1 DESTDIR="${D}" install || die "failed to install sql"
151
152 cd "${WORKDIR}/pathfinder-${PV_XQ}"
153 emake -j1 DESTDIR="${D}" install || die "failed to install xquery"
154
155 newinitd "${FILESDIR}/${PN}.init-4.8.2" monetdb || die "init.d script"
156 newconfd "${FILESDIR}/${PN}.conf-4.8.2" monetdb || die "conf.d file"
157
158 diropts -m750
159 dodir "${DATA_DIR}" "/var/log/${PN}"
160
161 exeinto "${DATA_DIR}"
162 newexe "${FILESDIR}/${PN}-start.sh" "${PN}-start.sh" || die "start script"
163 newexe "${FILESDIR}/${PN}-stop.sh" "${PN}-stop.sh" || die "stop script"
164
165 insinto "${DATA_DIR}"
166 newins "${FILESDIR}/${PN}-4.8.2-startup.mil" "${PN}-startup.mil" \
167 || die "startup MIL script"
168
169 if use java;
170 then
171 exeinto /usr/bin
172 newexe "${FILESDIR}/${PN}.JdbcClient-4.10.0" "JdbcClient" \
173 || die "JdbcClient alias"
174 fi
175
176 # set right permissions
177 chown -R monetdb:monetdb "${D}/${DATA_DIR}" \
178 || die "setting ownership on ${DATA_DIR} failed"
179 fowners monetdb:monetdb "/var/log/${PN}" \
180 || die "setting ownership on /var/log/${PN} failed"
181
182 # remove testing framework and compiled tests
183 rm -f \
184 "${D}/usr/bin/Mapprove.py" \
185 "${D}/usr/bin/Mdiff" \
186 "${D}/usr/bin/Mfilter.py" \
187 "${D}/usr/bin/MkillUsers" \
188 "${D}/usr/bin/Mlog" \
189 "${D}/usr/bin/Mprofile.py" \
190 "${D}/usr/bin/Mtest.py" \
191 "${D}/usr/bin/Mtimeout" \
192 "${D}/usr/bin/prof.py" \
193 "${D}/usr/share/MonetDB/Mprofile-commands.lst" \
194 || die "removing testing tools"
195 rm -Rf \
196 "${D}/usr/lib/MonetDB/Tests" \
197 "${D}/usr/lib/sql/Tests" \
198 "${D}/usr/share/MonetDB/Tests" \
199 "${D}/usr/share/sql/Tests" \
200 || die "removing tests"
201 # remove pf_burk, upstream only compiles it, but doesn't use it
202 rm -f \
203 "${D}/usr/lib/MonetDB/pf_burk.mil" \
204 "${D}/usr/lib/MonetDB/lib_pf_burk.so.0.0.0" \
205 "${D}/usr/lib/MonetDB/lib_pf_burk.so.0" \
206 "${D}/usr/lib/MonetDB/lib_pf_burk.so" \
207 "${D}/usr/lib/MonetDB/lib_pf_burk.la" \
208 || die "removing incomplete Burkowski step support"
209 # remove windows cruft
210 find "${D}" -name "*.bat" | xargs rm -f || die "removing windows stuff"
211 }
212
213 src_test() {
214 # Upstream has tests that work in their "lab-setting". They prefer to wait
215 # using it when they provide a set of tests that is meant to be used
216 # outside their "labs". Those tests will also be supposed not to fail...
217 true
218 }
219
220 pkg_postinst() {
221 while read line; do elog "${line}"; done <<EOF
222 MonetDB has been installed on your system, using data directory
223 ${DATA_DIR}.
224 To get started using SQL, XQuery or MIL see:
225
226 http://monetdb.cwi.nl/GettingStarted/
227 EOF
228 }

  ViewVC Help
Powered by ViewVC 1.1.20