# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit kde eutils DESCRIPTION="The Last.fm player allows you to listen to their internet radio which is tailored to your music profile" HOMEPAGE="http://www.last.fm" SRC_URI="http://83.142.226.211/player/LastfmSource-${PV}.tar.bz2" LICENSE="BSD" SLOT="0" KEYWORDS="~x86" IUSE="doc" S="${WORKDIR}/Last.fm-${PV}-src" DEPEND="=x11-libs/qt-4*" RDEPEND="=x11-libs/qt-4* virtual/x11" #need-qt 4 # Doesn't work yet apperantly pkg_setup() { if ! built_with_use qt gif ; then eerror "It appears that $(best_version qt) was compiled with the \"gif\" USE flag disabled." eerror eerror "In order to use the Last.fm player, you need to enable this USE flag" eerror "To do this, run the following in a command window:" eerror "echo \"x11-libs/qt gif\" >> /etc/portage/package.use" eerror "and recompile qt using \"emerge -avN1 qt\"" die "no gif support in qt" fi } src_compile() { # Expects /usr/bin/qmake in QT4 qmake || die "qmake failed" emake || die "emake failed" } src_install() { local destination="/opt/lastfm" dodir ${destination} exeinto ${destination} doexe player dodir ${destination}/data insinto ${destination}/data doins data/*.png data/*.gif dodir ${destination}/data/buttons insinto ${destination}/data/buttons doins data/buttons/*.png dodir ${destination}/cache fperms 777 ${destination}/cache exeinto /usr/bin make_wrapper lastfm ${destination}/player ${destination} if use doc ; then dodoc README fi newicon data/icon.png lastfm.png make_desktop_entry lastfm "Last.fm Player" lastfm.png } pkg_postinst() { einfo "In order to use the Last.fm player with your mozilla based browser," einfo "You must follow these steps:" einfo einfo " 1. Go to \"about:config\" using the location bar" einfo " 2. Right-click on the page. Select \"New\" and then \"String\"" einfo " 3. Type in the name field: \"network.protocol-handler.app.lastfm\"" einfo " 4. Type in the value field: \"/usr/bin/lastfm\"" einfo einfo "If you experiance awkward fonts or widgets, you may consider" einfo "running \"qtconfig\" and change the settings" }