# 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="~amd64 ~ppc ~x86" IUSE="debug exif javascript libextractor mysql taglib" RDEPEND="sys-apps/file !taglib? ( media-libs/id3lib ) exif? ( media-libs/libexif ) libextractor? ( media-libs/libextractor ) virtual/libiconv mysql? ( virtual/mysql ) javascript? ( dev-lang/spidermonkey ) !mysql? ( >=dev-db/sqlite-3 ) taglib? ( media-libs/taglib ) sys-libs/zlib" DEPEND="${RDEPEND}" MEDIATOMB_HOMEDIR="/var/lib/mediatomb" pkg_setup() { # create the mediatomb group and user enewgroup mediatomb enewuser mediatomb -1 -1 "${MEDIATOMB_HOMEDIR}" mediatomb chown mediatomb:mediatomb "${MEDIATOMB_HOMEDIR}" } src_compile() { # only build with sqlite support if mysql use is not set if use mysql; then myconf="${myconf} --enable-mysql --disable-sqlite3" else myconf="${myconf} --disable-mysql --enable-sqlite3" fi # 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) \ ${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 # install the mediatomb config file insinto /etc/mediatomb doins "${FILESDIR}/config.xml" fperms 0660 /etc/mediatomb/config.xml fowners root:mediatomb /etc/mediatomb/config.xml } pkg_postinst() { if use mysql; then elog elog "MediaTomb has been built with MySQL support. You will" elog "find information on how to setup MediaTomb with MySQL" elog "in section \"6.1 Server Settings\" of the MediaTomb" elog "documentation, which is available at:" elog "http://mediatomb.cc/pages/documentation" fi elog elog "The MediaTomb Web UI can be reached at:" elog "http://localhost:49152/" elog elog "To start MediaTomb:" elog "/etc/init.d/mediatomb start" elog elog "To start MediaTomb at boot:" elog "rc-update add mediatomb default" elog } pkg_postrm() { ewarn ewarn "To completely uninstall MediaTomb, remove the \"mediatomb\"" ewarn "user and group and delete the ${MEDIATOMB_HOMEDIR} directory." ewarn }