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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Feb 11 14:12:49 2007 UTC (13 years ago) by grobian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Dropped ppc-macos keyword, dropped old ebuild
(Portage version: 2.1.1-r2)
 (Unsigned Manifest commit)

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.0.ebuild,v 1.4 2007/01/31 13:41:05 genone 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 static"
10 PV_SQL=2.10.0
11 PV_XQ=0.10.0
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 ~ppc-macos ~x86"
19
20 DEPEND="virtual/libc
21 >=sys-devel/gcc-3.3
22 java? ( >=virtual/jdk-1.4 )
23 java? ( dev-java/ant-core )
24 readline? ( >=sys-libs/readline-4.1 )
25 dev-libs/libxml2
26 >=dev-libs/libpcre-5"
27
28 DATA_DIR="/var/lib/MonetDB"
29
30 pkg_setup() {
31 # see if we have a dbfarm, and whether there is a version of monetdb
32 # installed which is not a version that we can 'upgrade' to.
33 if [ -x "${DATA_DIR}/dbfarm" ] || [ -x "${DATA_DIR}/log" ];
34 then
35 if [ -x "/usr/bin/monetdb-config" ] && \
36 [ "`/usr/bin/monetdb-config --version`" != "4.10.0" ];
37 then
38 while read line; do eerror "${line}"; done <<EOF
39 MonetDB ${MY_PV} cannot upgrade your existing SQL databases. You must
40 export your existing SQL databases to a file using "JdbcClient -D" and
41 then restore them when you have upgraded completey using
42 "JdbcClient -f". Dumping and restoring of MIL and XQuery databases
43 unfortunately is not possible at the moment.
44
45 You must remove your entire database directory to continue.
46 (database directory = ${DATA_DIR}).
47 See the following url for more information on dumping and
48 restoring your database:
49 http://monetdb.cwi.nl/TechDocs/FrontEnds/SQL/upgrade/
50 EOF
51 die "Cannot upgrade automatically."
52 fi
53 fi
54 }
55
56 src_unpack() {
57 unpack ${A} || die
58
59 epatch "${FILESDIR}/${PN}-${PV_M}"-gentoo-MapiClient.patch
60 epatch "${FILESDIR}/${PN}-${PV_M}"-gentoo-conf.patch
61 epatch "${FILESDIR}/${PN}-${PV_M}"-darwin.patch
62 }
63
64 src_compile() {
65 # The tar has capitals, the ebuild doesn't...
66 cd "${WORKDIR}/MonetDB-${PV_M}"
67
68 local myconf=""
69
70 if use debug;
71 then
72 myconf="${myconf} --enable-debug"
73 else
74 myconf="${myconf} --enable-optimize --disable-assert"
75 fi
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 static)"
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 exeinto /etc/init.d/
156 newexe "${FILESDIR}/${PN}.init-4.8.2" monetdb || die "init.d script"
157
158 insinto /etc/conf.d/
159 newins "${FILESDIR}/${PN}.conf-4.8.2" monetdb || die "conf.d file"
160
161 diropts -m750
162 dodir "${DATA_DIR}" "/var/log/${PN}"
163
164 exeinto "${DATA_DIR}"
165 newexe "${FILESDIR}/${PN}-start.sh" "${PN}-start.sh" || die "start script"
166 newexe "${FILESDIR}/${PN}-stop.sh" "${PN}-stop.sh" || die "stop script"
167
168 insinto "${DATA_DIR}"
169 newins "${FILESDIR}/${PN}-4.8.2-startup.mil" "${PN}-startup.mil" || die "startup MIL script"
170
171 if use java;
172 then
173 exeinto /usr/bin
174 newexe "${FILESDIR}/${PN}.JdbcClient-${PV_M}" "JdbcClient" \
175 || die "JdbcClient alias"
176 fi
177
178 # set right permissions
179 chown -R monetdb:monetdb "${D}/${DATA_DIR}"
180 fowners monetdb:monetdb "/var/log/${PN}"
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 # remove perl DBD on ppc-macos, since it gets installed in the wrong
212 # location and getting it right is not just a simple thing
213 use ppc-macos && rm -Rf "${D}/usr/Network" > /dev/null
214 }
215
216 src_test() {
217 # Upstream has tests that work in their "lab-setting". They prefer to wait
218 # using it when they provide a set of tests that is meant to be used
219 # outside their "labs". Those tests will also be supposed not to fail...
220 true
221 }
222
223 pkg_preinst() {
224 enewgroup monetdb
225 enewuser monetdb -1 /bin/bash "${DATA_DIR}" monetdb
226 }
227
228 pkg_postinst() {
229 while read line; do elog "${line}"; done <<EOF
230 MonetDB has been installed on your system, using data directory
231 ${DATA_DIR}.
232 To get started using SQL, XQuery or MIL see:
233
234 http://monetdb.cwi.nl/GettingStarted/
235 EOF
236 }

  ViewVC Help
Powered by ViewVC 1.1.20