# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-db/maxdb-devtools-src/maxdb-devtools-src-562049.ebuild,v 1.0 2005/08/19 18:00:00 hmun Exp $ inherit eutils DESCRIPTION="Development Utils for MaxDB - a enterpise grade, database server. Needed for compilation of MaxDB. This ebuild will compile maxdb Development Utils from sources." HOMEPAGE="http://www.mysql.com/products/maxdb" #SRC_URI="http://mysql.mirror.netmonic.com/Downloads/MaxDB/7.5.00/maxdb-buildtools-source-562049.tgz" SRC_URI="mirror://mysql/Downloads/MaxDB/7.6.00/maxdb-buildtools-source-562049.tgz" KEYWORDS="~x86" LICENSE="GPL-2" SLOT="0" IUSE="" DEPEND="gcc? ( >=sys-devel/gcc-3.3.5 ) bison? ( sys-devel/bison ) python? ( >=dev-lang/python-2.3.5 ) perl? ( >=dev-lang/perl-5.8.6 ) vim ( >=app-editors/vim-6.3 )" warning() { ewarn ewarn "You can specify the root directory for the installation" ewarn "by setting the environment variable MAXDBROOT" ewarn ewarn "DevTools will be installed to:" ewarn ${MAXDBROOT} ewarn einfo "Workdir is:" einfo ${WORKDIR} einfo D is: einfo ${D} einfo ROOT is: einfo ${ROOT} sleep 10 } pkg_setup() { SRC_DEVTOOLDIR=TOOLSRC DEST_DEVTOOLDIR=devtools if [ -z "${MAXDBROOT}" ]; then MAXDBROOT=/opt/sdb fi warning } src_unpack() { unpack ${A} || die cd ${WORKDIR}/${SRC_DEVTOOLDIR} ./configure } src_compile() { cd ${WORKDIR}/${SRC_DEVTOOLDIR} make # make || die "compile problem" } src_install() { if [ ! -d ${D}${MAXDBROOT}/${DEST_DEVTOOLDIR} ] then dodir ${MAXDBROOT}/${DEST_DEVTOOLDIR} fi fowners root:root ${MAXDBROOT}/${DEVTOOLDIR} (cd ${WORKDIR}/${SRC_DEVTOOLDIR} > /dev/null; tar cf - .) | (cd ${D}${MAXDBROOT}/${DEST_DEVTOOLDIR} >/dev/null; tar xvf -) addwrite ${ROOT}usr/spool/sql dodir ${ROOT}usr/spool/sql/config fowners root:root ${ROOT}/usr/spool/sql/config dodir ${ROOT}usr/spool/sql/ini fowners root:root ${ROOT}/usr/spool/sql/ini } pkg_preinst() { if ! groupmod sdba; then groupadd sdba || die "problem adding group sdba" fi if ! id sdb; then useradd -g sdba -s /dev/null -d /opt/maxdb -c "sdb" sdb assert "problem adding user sdb" fi } pkg_postinst() { install -d -m0755 -o root -g root ${MAXDBROOT}/${DEST_DEVTOOLDIR} install -d -m0755 -o root -g root usr/spool/sql/config install -d -m0755 -o root -g root usr/spool/sql/ini einfo "Creating the global MAXDB registry" ${MAXDBROOT}/${DEST_DEVTOOLDIR}/bin/prepare_inst.pl #your friendly public service announcement... einfo "MaxDb Devtools have been installed to" einfo ${MAXDBROOT}/${DEST_DEVTOOLDIR} einfo if [ ! -d /usr/spool/sql/config ] then ewarn "**********************************************************************" ewarn "*** Run ${DEVTOOLS}/bin/prepare_inst.pl as root" ewarn "*** to create the global SAP DB registry " ewarn "***" ewarn "*** (or export NOREG=1 to build without registration)" ewarn "**********************************************************************" fi }