# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-db/monetdb/monetdb-4.10.2.ebuild,v 1.1 2006/02/24 21:33:50 grobian Exp $ inherit flag-o-matic eutils DESCRIPTION="A main-memory relational database for SQL, XQuery and MIL" HOMEPAGE="http://monetdb.cwi.nl/" IUSE="java readline debug static" PV_SQL=2.10.2 PV_XQ=0.10.2 PV_M=${PV} SRC_URI="mirror://sourceforge/monetdb/MonetDB-${PV_M}.tar.gz mirror://sourceforge/monetdb/MonetDB-SQL-${PV_SQL}.tar.gz mirror://sourceforge/monetdb/MonetDB-XQuery-${PV_XQ}.tar.gz" LICENSE="MonetDBPL-1.1 PathfinderPL-1.1" SLOT="0" KEYWORDS="~ppc ~ppc-macos ~x86" DEPEND="virtual/libc >=sys-devel/gcc-3.3 java? ( >=virtual/jdk-1.4 ) java? ( dev-java/ant-core ) readline? ( >=sys-libs/readline-4.1 ) dev-libs/libxml2 >=dev-libs/libpcre-5" DATA_DIR="/var/lib/MonetDB" pkg_setup() { # see if we have a dbfarm, and whether there is a version of monetdb # installed which is not a version that we can 'upgrade' to. if [ -x "${DATA_DIR}/dbfarm" ] || [ -x "${DATA_DIR}/log" ]; then if [ -x "/usr/bin/monetdb-config" ] && \ [ "`/usr/bin/monetdb-config --version`" != "${PV_M}" ]; then while read line; do eerror "${line}"; done <& /dev/null ln -s . .libs cd "${WORKDIR}/MonetDB-${PV_M}/lib" find .. -name "lib*" -exec ln -s {} ';' >& /dev/null ln -s . .libs # enable the fool-script mkdir -p "${WORKDIR}/MonetDB-${PV_M}/bin" MYWD=`echo ${WORKDIR} | sed -re 's/\//\\\\\//g'` sed -r \ -e "s/\\$\_MONETDB\_INCLUDEDIR/${MYWD}\/MonetDB-${PV_M}\/include/g" \ -e "s/\\$\_MONETDB\_VERSION/${PV_M}/g" \ -e "s/\\$\_MONETDB\_LIBS/-L${MYWD}\/MonetDB-${PV_M}\/lib\/MonetDB -L${MYWD}\/MonetDB-${PV_M}\/lib/g" \ -e "s/\\$\_MONETDB\_MOD_PATH/${MYWD}\/MonetDB-${PV_M}\/include/g" \ -e "s/\\$\_MONETDB\_PREFIX/${MYWD}\/MonetDB-${PV_M}/g" \ -e "s/\\$\_MONETDB\_CLASSPATH/${MYWD}\/MonetDB-${PV_M}\/src\/mapi\/clients\/java\/mapi.jar/g" \ "${FILESDIR}/monetdb_config.sh" > \ "${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config" chmod 744 "${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config" # configure and make SQL cd "${WORKDIR}/sql-${PV_SQL}" econf MONETDB_CONFIG="${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config" \ "--with-monet=${WORKDIR}/MonetDB-${PV_M}" \ ${myconf} \ || die emake -j1 || die "emake sql failed" # configure and make XQuery cd "${WORKDIR}/pathfinder-${PV_XQ}" econf MONETDB_CONFIG="${WORKDIR}/MonetDB-${PV_M}/bin/monetdb-config" \ "--with-monet=${WORKDIR}/MonetDB-${PV_M} " \ ${myconf} || die emake -j1 || die "emake xquery failed" } src_install() { # The tar has capitals, the ebuild doesn't... cd "${WORKDIR}/MonetDB-${PV_M}" make DESTDIR="${D}" install || die "failed to install monetdb" cd "${WORKDIR}/sql-${PV_SQL}" make DESTDIR="${D}" install || die "failed to install sql" cd "${WORKDIR}/pathfinder-${PV_XQ}" make DESTDIR="${D}" install || die "failed to install xquery" exeinto /etc/init.d/ newexe "${FILESDIR}/${PN}.init-4.8.2" monetdb || die "init.d script" insinto /etc/conf.d/ newins "${FILESDIR}/${PN}.conf-4.8.2" monetdb || die "conf.d file" diropts -m750 dodir "${DATA_DIR}" "/var/log/${PN}" exeinto "${DATA_DIR}" newexe "${FILESDIR}/${PN}-start.sh" "${PN}-start.sh" || die "start script" newexe "${FILESDIR}/${PN}-stop.sh" "${PN}-stop.sh" || die "stop script" insinto "${DATA_DIR}" newins "${FILESDIR}/${PN}-4.8.2-startup.mil" "${PN}-startup.mil" || die "startup MIL script" if use java; then exeinto /usr/bin newexe "${FILESDIR}/${PN}.JdbcClient-4.10.0" "JdbcClient" \ || die "JdbcClient alias" fi # set right permissions chown -R monetdb:monetdb "${D}/${DATA_DIR}" fowners monetdb:monetdb "/var/log/${PN}" # 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" \ || 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 pf_burk, upstream only compiles it, but doesn't use it rm -f \ "${D}/usr/lib/MonetDB/pf_burk.mil" \ "${D}/usr/lib/MonetDB/lib_pf_burk.so.0.0.0" \ "${D}/usr/lib/MonetDB/lib_pf_burk.so.0" \ "${D}/usr/lib/MonetDB/lib_pf_burk.so" \ "${D}/usr/lib/MonetDB/lib_pf_burk.la" \ || die "removing incomplete Burkowski step support" # remove windows cruft find "${D}" -name "*.bat" | xargs rm -f || die "removing windows stuff" # remove perl DBD on ppc-macos, since it gets installed in the wrong # location and getting it right is not just a simple thing use ppc-macos && rm -Rf "${D}/usr/Network" > /dev/null } src_test() { # Upstream has tests that work in their "lab-setting". They prefer to wait # using it when they provide a set of tests that is meant to be used # outside their "labs". Those tests will also be supposed not to fail... true } pkg_preinst() { enewgroup monetdb enewuser monetdb -1 /bin/bash "${DATA_DIR}" monetdb } pkg_postinst() { while read line; do einfo "${line}"; done <