# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ MY_P="${PN}-$(echo ${PV} | sed -e 's:_beta:b:')-php4.1+" S="${WORKDIR}/${PN}" DESCRIPTION="Artekopia Netjuke is a Web-Based Audio Streaming Jukebox powered by PHP, an increasing choice of databases and all the MP3, Ogg Vorbis, Windows Media Audio and other format files that constitute your digital music collection." SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz" HOMEPAGE="http://netjuke.sourceforge.net/" KEYWORDS="x86" SLOT="0" LICENSE="GPL-2" IUSE="apache2 freetds mysql odbc postgres" DEPEND=">=dev-php/mod_php-4.1.2-r5 freetds? ( dev-db/freetds ) mysql? ( dev-db/mysql ) odbc? ( dev-db/unixODBC ) postgres? ( dev-db/postgresql )" src_install() { HTTPD_USER="apache" HTTPD_GROUP="apache" if [ `use apache2` ] && [ -e "/etc/apache2/conf/apache2.conf" ] ; then HTTPD_ROOT="`grep '^DocumentRoot' /etc/apache2/conf/apache2.conf | cut -d' ' -f2`" elif [ -e "/etc/apache/conf/apache.conf" ] ; then HTTPD_ROOT="`grep '^DocumentRoot' /etc/apache/conf/apache.conf | cut -d' ' -f2`" else HTTPD_ROOT="/home/httpd/htdocs" ewarn ewarn "No apache config file found in /etc, assuming DocumentRoot /home/httpd/htdocs" ewarn fi dodir "${HTTPD_ROOT}" cp -R "${S}" "${D}/${HTTPD_ROOT}/${PN}" # Snippet from the Netjuke INSTALL.txt file: # # "Make the inc-prefs.php file and netjuke/var/data/ directory owned by the web # server user, or world-writable (Read/Write privileges for all. Less secure)." touch "${D}/${HTTPD_ROOT}/${PN}/etc/inc-prefs.php" chown ${HTTPD_USER}:${HTTPD_GROUP} "${D}/${HTTPD_ROOT}/${PN}/etc/inc-prefs.php" chown -R ${HTTPD_USER}:${HTTPD_GROUP} "${D}/${HTTPD_ROOT}/${PN}/var/data" dodoc ${WORKDIR}/${PN}/docs/*.txt } pkg_postinst() { einfo einfo "To configure Netjuke please point your web browser to:" einfo "http:///netjuke/installer/installer.php" einfo }