summaryrefslogtreecommitdiff
blob: 81e49d94e731e7b175c89db7801d321b8382a4e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/lastfmplayer/lastfmplayer-1.4.2.58240-r1.ebuild,v 1.4 2008/07/16 19:26:40 yngwin Exp $

EAPI=1
inherit eutils multilib qt4

MY_P="${P/lastfmplayer/lastfm}.dfsg"

DESCRIPTION="The player allows you to listen to last.fm radio streams"
HOMEPAGE="http://www.last.fm/help/player"
SRC_URI="mirror://debian/pool/main/l/lastfm/lastfm_${PV}.dfsg.orig.tar.gz
	mirror://debian/pool/main/l/lastfm/lastfm_${PV}.dfsg-1.diff.gz"
#http://cdn.last.fm/client/src/${MY_P}.src.tar.bz2

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~ppc ~amd64"
IUSE=""
RESTRICT="mirror"

RDEPEND="|| ( ( x11-libs/qt-gui:4 x11-libs/qt-sql:4 )
			=x11-libs/qt-4.3* )
	media-libs/libsamplerate
	sci-libs/fftw
	media-libs/libmad
	>=media-libs/libgpod-0.5.2
	media-libs/alsa-lib"
DEPEND="${RDEPEND}
	app-arch/sharutils"

S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack ${A}
	epatch lastfm_${PV}.dfsg-1.diff
	cd "${S}"
	for i in $(< debian/patches/series); do
		epatch debian/patches/$i
	done
}

src_compile() {
	./configure
	emake || die "emake failed"
	cd i18n; lrelease *.ts
}

src_install() {
	# Docs
	dodoc ChangeLog README debian/README.Debian-source
	doman debian/lastfm.1

	# Copied from debian/rules
	uudecode -o - debian/icons.tar.gz.uu | tar -xzf -
	uudecode -o - debian/trayicons22.tar.gz.uu | tar -xzf -
	insinto /usr/share
	doins -r icons
	insinto /usr/share/lastfm/icons
	doins user_*.png

	sed -i -e "s,/usr/lib,/usr/$(get_libdir),g" debian/lastfm.install
	# make directories
	for i in $(<debian/lastfm.install); do [ ${i:0:1} == / ] && dodir $i; done
	# debian installation
	sed -i -e "s:^:mv :" -e 's: /:${D}/:' debian/lastfm.install
	bash debian/lastfm.install

	# copied..
	mv "${D}"/usr/bin/last{.,}fm
	rm -f "${D}"/usr/share/lastfm/icons/{*profile24,systray_mac}.png
}

pkg_postinst() {
	elog "To use the Last.fm player with a mozilla based browser:"
	elog " 1. Go to about:config in the browser"
	elog " 2. Right-click on the page"
	elog " 3. Select New and then String"
	elog " 4. For the name: network.protocol-handler.app.lastfm"
	elog " 5. For the value: /usr/bin/lastfm"
	elog
	elog "If you experience awkward fonts or widgets, try running qtconfig."
}