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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Sep 10 15:28:11 2005 UTC (14 years, 5 months ago) by grobian
Branch: MAIN
Changes since 1.2: +2 -2 lines
Stable on x86
(Portage version: 2.0.51.22-r2)

1 # Copyright 1999-2005 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.8.2.ebuild,v 1.2 2005/08/23 14:33:36 swegener 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 PV_SQL=2.8.2
10 PV_XQ=0.8.2
11 SRC_URI="mirror://sourceforge/monetdb/MonetDB-${PV}.tar.gz
12 mirror://sourceforge/monetdb/MonetDB-SQL-${PV_SQL}.tar.gz
13 mirror://sourceforge/monetdb/MonetDB-XQuery-${PV_XQ}.tar.gz
14 ppc-macos? ( mirror://gentoo/monetdb-pathfinder-bison-sources-0.8.2.tar.bz2 )"
15 LICENSE="MonetDBPL-1.1 PathfinderPL-1.1"
16 SLOT="0"
17 KEYWORDS="~ppc-macos x86"
18 IUSE="java readline"
19
20 DEPEND="virtual/libc
21 sys-devel/flex
22 ppc-macos? ( sys-devel/bison )
23 !ppc-macos? ( >=sys-devel/bison-1.33 )
24 >=sys-devel/gcc-3.3
25 java? ( >=virtual/jdk-1.4 )
26 readline? ( >=sys-libs/readline-4.1 )
27 dev-libs/libxml2"
28
29 DATA_DIR="/var/lib/MonetDB"
30
31 pkg_setup() {
32 if [ -x ${DATA_DIR}/dbfarm ] || [ -x ${DATA_DIR}/log ]; then
33 while read line; do eerror "${line}"; done <<EOF
34 MonetDB ${MY_PV} cannot upgrade your existing SQL databases. You must
35 export your existing SQL databases to a file using "JdbcClient -D" and
36 then restore them when you have upgraded completey using
37 "JdbcClient -f".
38
39 If you have MIL BATs, aging from before MonetDB 4.8.0 your have to
40 convert those after upgrading. See the following for more information
41 on upgrading from previous database versions:
42 http://monetdb.cwi.nl/TechDocs/FrontEnds/SQL/upgrade/
43 http://monetdb.cwi.nl/TechDocs/FrontEnds/mil/upgrade/
44
45 You must remove your entire database directory to continue.
46 (database directory = ${DATA_DIR}).
47 EOF
48 die "Cannot upgrade automatically."
49 fi
50
51 enewgroup monetdb
52 enewuser monetdb -1 /bin/bash ${DATA_DIR} monetdb
53 }
54
55 src_unpack() {
56 unpack ${A} || die
57
58 epatch ${FILESDIR}/monetdb-${PV}-gentoo-conf.patch
59 epatch ${FILESDIR}/monetdb-${PV}-gentoo-MapiClient.patch
60 }
61
62 src_compile() {
63 # The tar has capitals, the ebuild doesn't...
64 cd ${WORKDIR}/MonetDB-${PV}
65
66 econf \
67 "--enable-optimize" \
68 $(use_with java) \
69 $(use_with readline) \
70 || die "econf monetdb failed"
71
72 emake || die "emake monetdb failed"
73
74 # make the header files available to the sql and xquery compilation
75 mkdir include
76 cd include
77 ln -s ../src/common
78 ln -s ../src/gdk
79 ln -s ../src/monet
80 ln -s ../src/modules/plain
81 ln -s ../src/modules/contrib
82 ln -s ../src/mapi
83 ln -s ../src/mapi/clients/C
84 ln -s ../monetdb_config.h
85 ln -s ../sysdefs.h
86
87 cd ${WORKDIR}/MonetDB-${PV}
88 mkdir -p lib/MonetDB
89 cd lib/MonetDB
90 find ../.. -name "lib_*" -exec ln -s {} ';' >& /dev/null
91 ln -s . .libs
92
93 cd ${WORKDIR}/MonetDB-${PV}/lib
94 find .. -name "lib*" -exec ln -s {} ';' >& /dev/null
95 ln -s . .libs
96
97 cd ${WORKDIR}/MonetDB-${PV}
98 mkdir bin
99 cd bin
100 ln -s ../src/mel/mel
101 ln -s ../src/utils/Mx/Mx
102
103 # enable the fool-script
104 MYWD=`echo ${WORKDIR} | sed -re 's/\//\\\\\//g'`
105 sed -r \
106 -e "s/\\$\_MONETDB\_INCLUDEDIR/${MYWD}\/MonetDB-${PV}\/include/g" \
107 -e "s/\\$\_MONETDB\_VERSION/${PV}/g" \
108 -e "s/\\$\_MONETDB\_LIBS/-L${MYWD}\/MonetDB-${PV}\/lib\/MonetDB -L${MYWD}\/MonetDB-${PV}\/lib/g" \
109 -e "s/\\$\_MONETDB\_MOD_PATH/${MYWD}\/MonetDB-${PV}\/include/g" \
110 -e "s/\\$\_MONETDB\_PREFIX/${MYWD}\/MonetDB-${PV}/g" \
111 -e "s/\\$\_MONETDB\_CLASSPATH/${MYWD}\/MonetDB-${PV}\/src\/mapi\/clients\/java\/mapi.jar/g" \
112 ${FILESDIR}/monetdb_config.sh > \
113 ${WORKDIR}/MonetDB-${PV}/bin/monetdb-config
114 chmod 744 ${WORKDIR}/MonetDB-${PV}/bin/monetdb-config
115
116 # configure and make SQL
117 cd ${WORKDIR}/sql-${PV_SQL}
118 econf MONETDB_CONFIG=${WORKDIR}/MonetDB-${PV}/bin/monetdb-config \
119 "--with-monet=${WORKDIR}/MonetDB-${PV}" \
120 "--enable-optimize" \
121 `use_with java` || die
122 emake || die "emake sql failed"
123
124 # configure and make XQuery, because it relies on >=bison-1.33 which we
125 # might not have, we apply a special patch with bison 2.0 generated
126 # files. This is especially useful for OSX users, as this allows
127 # them to use this package without having to overwrite their system
128 # installed bison 1.28
129 cd ${WORKDIR}/pathfinder-${PV_XQ}
130 # has_version/best_version do not take package.provided into
131 # account! thus we assume OSX users don't have the right bison :(
132 if use ppc-macos; then
133 einfo "extracting extra files for older bison users"
134 tar -jxf ${DISTDIR}/monetdb-pathfinder-bison-sources-${PV_XQ}.tar.bz2
135 fi
136 econf MONETDB_CONFIG=${WORKDIR}/MonetDB-${PV}/bin/monetdb-config \
137 "--with-monet=${WORKDIR}/MonetDB-${PV} " \
138 "--enable-optimize" || die
139 emake || die "emake xquery failed"
140 }
141
142 src_install() {
143 # The tar has capitals, the ebuild doesn't...
144 cd ${WORKDIR}/MonetDB-${PV}
145 einstall || die "failed to install monetdb"
146
147 cd ${WORKDIR}/sql-${PV_SQL}
148 einstall || die "failed to install sql"
149
150 cd ${WORKDIR}/pathfinder-${PV_XQ}
151 einstall || die "failed to install xquery"
152
153 exeinto /etc/init.d/
154 newexe ${FILESDIR}/${PN}.init-${PV} monetdb || die "init.d script"
155
156 insinto /etc/conf.d/
157 newins ${FILESDIR}/${PN}.conf-${PV} monetdb || die "conf.d file"
158
159 diropts -m750
160 dodir ${DATA_DIR} /var/log/${PN}
161
162 exeinto ${DATA_DIR}
163 newexe ${FILESDIR}/${PN}-start.sh ${PN}-start.sh || die "start script"
164 newexe ${FILESDIR}/${PN}-stop.sh ${PN}-stop.sh || die "stop script"
165
166 insinto ${DATA_DIR}
167 newins ${FILESDIR}/${PN}-${PV}-startup.mil ${PN}-startup.mil || die "startup MIL script"
168
169 # set right permissions
170 chown -R monetdb:monetdb ${D}/${DATA_DIR}
171 fowners monetdb:monetdb /var/log/${PN}
172
173 # remove Mx and mel, they are only needed for compilation
174 rm -f ${D}/usr/bin/Mx ${D}/usr/bin/mel ${D}/usr/bin/idxmx
175 # remove windows crap
176 rm -f ${D}/usr/bin/*.bat
177 # remove perl DBD on ppc-macos, since it gets installed in the wrong
178 # location and getting it right is not just a simple thing
179 use ppc-macos && rm -Rf ${D}/usr/Network > /dev/null
180 }
181
182 pkg_postinst() {
183 while read line; do einfo "${line}"; done <<EOF
184 MonetDB has been installed on your system, using data directory
185 ${DATA_DIR}. To get started using SQL, XQuery or MIL see:
186
187 http://monetdb.cwi.nl/GettingStarted/
188
189 If you have upgraded from version 4.6.2 or below you should restore your
190 SQL databases, as well as convert your MIL BATs. See also:
191 http://monetdb.cwi.nl/TechDocs/FrontEnds/SQL/upgrade/
192 http://monetdb.cwi.nl/TechDocs/FrontEnds/mil/upgrade/
193 EOF
194 }

  ViewVC Help
Powered by ViewVC 1.1.20