# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils flag-o-matic MY_PN="openqm" MY_PV="2.2-0-2005-09-01.tar.bz2" MY_P="${MY_PN}_${MY_PV}" COMPILE_DIR="${WORKDIR}/qmsys/csrc" DESCRIPTION="An open-source (GPL) multi-valued database based on the commercial QM" HOMEPAGE="http://www.openqm.org/" S="${WORKDIR}/${MY_P}" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86 ~ppc" IUSE="" SRC_URI="http://www.blackflute.com/${MY_P}" DEPEND="virtual/libc sys-apps/xinetd" pkg_setup() { #Add user and group for QM enewgroup qm 61 enewuser qm 61 /bin/false /dev/null qm } pkg_preinst() { pkg_setup if [ ! -f /usr/qmsys ]; then einfo "/usr/qmsys already exists" else mkdir /usr/qmsys fi } src_unpack() { if [ ! -r ${DISTDIR}/${MY_P} ]; then eerror "cannot read ${MY_P}. Please check the permissions and try again." die fi unpack ${A} } src_compile() { append-flags "-fPIC" cd ${COMPILE_DIR} emake clean || die "make clean problem" einstall || die "make install problem" } src_install() { mkdir -p ${D}usr/qmsys cp -R ${WORKDIR}/qmsys ${D}usr } pkg_postinst() { #Set permissions chown -R qm:qm /usr/qmsys chmod -R 774 /usr/qmsys mkdir /var/qm chown -R qm:qm /var/qm chmod -R 774 /var/qm #Copy over config files cp /usr/qmsys/etc/gentoo/etc/conf.d/* /etc/conf.d cp /usr/qmsys/etc/gentoo/etc/env.d/* /etc/env.d cp /usr/qmsys/etc/gentoo/etc/init.d/* /etc/init.d cp /usr/qmsys/etc/gentoo/etc/qmconfig /etc/qmconfig cp /usr/qmsys/xinetd.d/* /etc/xinetd.d einfo "You can add QM to the default run level (so it starts when you boot) by doing rc-update add qm default" einfo "You can start the QM server by doing /etc/init.d/qm start" env-update source /etc/profile einfo "You should restart Xinetd on your own by doing: /etc/init.d/xinetd restart." einfo "We don't do this for you because you may be using xinetd for something else." einfo "To create an account in QM, add your user to the qm group." einfo "Adequate Documentation can be found at http://www.openqm.com/downloads.htm" einfo "Other useful info can be found at http://www.openqm.org/" epause 5 } pkg_prerm() { /etc/init.d/qm stop } pkg_postrm() { einfo "If you are upgrading QM, then be sure to do /etc/init.d/qm restart" einfo "If you are unmerging QM, do rc-update del qm default" }