# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="MediaTomb is an open source UPnP MediaServer" HOMEPAGE="http://www.mediatomb.cc/" SRC_URI="mirror://sourceforge/mediatomb/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="debug exif javascript libextractor mysql sqlite taglib" RDEPEND="javascript? ( dev-lang/spidermonkey ) mysql? ( virtual/mysql ) sqlite? ( >=dev-db/sqlite-3 ) virtual/libiconv" DEPEND="${RDEPEND} exif? ( media-libs/libexif ) libextractor? ( media-libs/libextractor ) !taglib? ( media-libs/id3lib ) taglib? ( media-libs/taglib ) sys-apps/file sys-libs/zlib" MEDIATOMB_DATADIR="/var/lib/mediatomb" pkg_setup() { # only build if mysql or sqlite use flag is set if ! use mysql && ! use sqlite ; then eerror eerror "MediaTomb requires MySQL or SQLite support." eerror die "Setup failed!" fi } src_compile() { # only build with id3lib support if taglib use is not set if use taglib; then myconf="${myconf} --enable-taglib --disable-id3lib" else myconf="${myconf} --disable-taglib --enable-id3lib" fi econf \ --prefix=/usr \ $(use_enable debug tombdebug ) \ $(use_enable exif libexif ) \ $(use_enable javascript libjs ) \ $(use_enable libextractor ) \ $(use_enable mysql ) \ $(use_enable sqlite sqlite3 ) \ ${myconf} \ || die "Configure failed!" } src_install() { emake DESTDIR="${D}" install || die "Install failed" dodoc AUTHORS ChangeLog NEWS README newinitd "${FILESDIR}/mediatomb.initd" mediatomb newconfd "${FILESDIR}/mediatomb.confd" mediatomb insinto /etc/mediatomb doins "${FILESDIR}/config.xml" fperms 0600 /etc/mediatomb/config.xml # create direcotry for the sqlite database and bookmark file dodir "${MEDIATOMB_DATADIR}" # prevent removal of mediatomb data directory on unmerge touch "${D}/${MEDIATOMB_DATADIR}/.keep" } pkg_postinst() { elog "To start MediaTomb:" elog "# /etc/init.d/mediatomb start" elog elog "To start MediaTomb at boot:" elog "# rc-update add mediatomb default" elog elog "The MetiaTomb Web UI can be reached at:" elog "http://localhost:49152/" } pkg_postrm() { ewarn "It may be necessary to delete the ${MEDIATOMB_DATADIR}" ewarn "directory to completely remove MediaTomb." }