# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # We are using Splunk's generic i686 binary MY_P="splunk-${PV}-18173-Linux-i686" DESCRIPTION="The search engine for IT data" HOMEPAGE="http://www.splunk.com" SRC_URI="${MY_P}.tgz" RESTRICT="nomirror fetch nostrip" LICENSE="Nessus-EULA" SLOT="0" KEYWORDS="x86" IUSE="" pkg_nofetch() { einfo "Please download ${MY_P}.tgz from ${HOMEPAGE}/index.php/predownload?d=progeneric" einfo "The archive should then be placed into ${DISTDIR}." einfo "${D}" } pkg_setup() { case ${CHOST} in i686-pc-linux-gnu*) einfo "Found compatible architecture." ;; *) die "No compatible architecture found." ;; esac } src_install() { elog "Creating /opt/splunk" dodir /opt/splunk/ insinto /opt/ || die "Install failed!" elog "Installing splunk" doins -r ${WORKDIR}/splunk || die "Install failed!" elog "Fixing symlinks" dosym "/opt/splunk/etc/event-types/v1.2.1" "/opt/splunk/etc/event-types/v1.2" dosym "/opt/splunk/etc/event-types/v1.2.2" "/opt/splunk/etc/event-types/v1.2" dosym "/opt/splunk/etc/event-types/v1.2.3" "/opt/splunk/etc/event-types/v1.2" dosym "/opt/splunk/etc/event-types/v1.2.4" "/opt/splunk/etc/event-types/v1.2" } pkg_postinst() { # Add the init scripts elog "Setting up init scripts" echo "#!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # \$Header: $ depend() { after logger } start() { ebegin "Starting Splunk" exec /opt/splunk/bin/splunk start > /dev/null 2>&1 } stop() { ebegin "Stopping Splunk" exec /opt/splunk/bin/splunk stop > /dev/null 2>&1 } restart() { ebegin "Restarting Splunk" exec /opt/splunk/bin/splunk restart > /dev/null 2>&1 } status() { exec /opt/splunk/bin/splunk status }" > /etc/init.d/splunk chmod 0755 /etc/init.d/splunk elog "For more information about Splunk, please visit" elog "${HOMEPAGE}/doc/latest" elog "" elog "To add splunk to your startup scripts" elog "run 'rc-update add splunk default'" } pkg_postrm() { # Remove the init script rc-update del splunk rm -rf /etc/init.d/splunk }