Use https by default
[gentoo.git] / media-sound / lastfmplayer / lastfmplayer-1.5.4.27091-r3.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils multilib readme.gentoo toolchain-funcs qt4-r2
7
8 MY_P="${P/lastfmplayer/lastfm}+dfsg"
9
10 DESCRIPTION="A player for last.fm radio streams"
11 HOMEPAGE="http://www.last.fm/help/player
12         http://www.mehercule.net/staticpages/index.php/lastfm"
13 SRC_URI="https://dev.gentoo.org/~hwoarang/distfiles/lastfm-${PV}+dfsg.tar.gz
14         https://dev.gentoo.org/~hwoarang/distfiles/lastfm_${PV}+dfsg-2.debian.tar.gz
15         dbus? ( http://glue.umd.edu/~rossatok/dbusextension-2.0.tar.bz2 )"
16
17 LICENSE="GPL-2"
18 SLOT="0"
19 KEYWORDS="amd64 ~arm ppc x86"
20 IUSE="dbus ipod"
21
22 RDEPEND="dev-qt/qtgui:4
23         dev-qt/qtsql:4
24         media-libs/libsamplerate
25         sci-libs/fftw
26         media-libs/libmad
27         ipod? ( >=media-libs/libgpod-0.5.2 )
28         media-libs/alsa-lib"
29 DEPEND="${RDEPEND}
30         app-arch/sharutils"
31
32 S=${WORKDIR}/${MY_P}
33
34 src_prepare() {
35         DISABLE_AUTOFORMATTING="yes"
36         DOC_CONTENTS="To use the Last.fm player with a mozilla based browser:
37 1. Install gnome-base/gconf
38 2. gconftool-2 -t string -s /desktop/gnome/url-handlers/lastfm/command \"/usr/bin/lastfm %s\"
39 3. gconftool-2 -s /desktop/gnome/url-handlers/lastfm/needs_terminal false -t bool
40 4. gconftool-2 -t bool -s /desktop/gnome/url-handlers/lastfm/enabled true
41
42 If you experience awkward fonts or widgets, try running qtconfig."
43
44         qt4-r2_src_prepare
45         # Use a different extensions path
46         epatch "${FILESDIR}"/${PN}-extensions-path.patch
47         einfo "Applying Debian patchset"
48         sed -i "/^tray-icon-size.diff/d" "${WORKDIR}"/debian/patches/series
49         cd "${S}"
50         for i in $( < "${WORKDIR}"/debian/patches/series); do
51                 epatch "${WORKDIR}"/debian/patches/$i
52         done
53         if ! use ipod ; then
54                 sed -i '/src\/mediadevices\/ipod/d' LastFM.pro || die "sed failed"
55         fi
56         #fix plugin search path for multilib support
57         sed -i -e "s:/usr/lib/:/usr/$(get_libdir)/:g" \
58                 "${S}"/src/libMoose/MooseCommon.cpp
59         if use dbus; then
60                 mv "${WORKDIR}"/dbus "${S}"/src/dbus
61                 sed -i -e "/include/s:../definitions.pro.in:definitions.pro.in:" \
62                         -e "/TARGET/s:dbusextension:LastFmDbusExtension:" \
63                         "${S}"/src/dbus/dbusextension.pro
64         fi
65
66         # only glib.h can be included directly in >glib-2.32
67         epatch "${FILESDIR}"/${P}-glib.h.patch
68         # Gcc 4.7 definitions. Bug #423221
69         epatch "${FILESDIR}"/${P}-gcc47.patch
70 }
71
72 src_configure() {
73         if use dbus; then
74                 pushd "${S}"/src/dbus
75                 eqmake4 dbusextension.pro
76                 popd >> /dev/null
77         fi
78         qt4-r2_src_configure
79 }
80
81 src_compile() {
82         emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" || die "emake failed"
83         if use dbus; then
84                 einfo "Building DBUS plugin"
85                 emake -C "${S}"/src/dbus || die "failed to build dbus extension"
86         fi
87         cd i18n; lrelease *.ts
88 }
89
90 src_install() {
91         cd "${WORKDIR}"
92         # Docs
93         dodoc "${S}"/ChangeLog.txt "${S}"/README debian/README.source
94         doman debian/lastfm.1
95
96         # Copied from debian/rules
97         insinto /usr/share
98         doins -r debian/package-files/share/icons || die "failed to install icons"
99         insinto /usr/share/lastfm/icons
100         doins "${S}"/bin/data/icons/*.png \
101                 || die "failed to install application icons"
102         insinto /usr/share/lastfm
103         doins "${S}"/bin/data/*.png || die "failed to install icons"
104         dodir /usr/$(get_libdir)/lastfm_services/
105         insinto /usr/$(get_libdir)/lastfm_services/
106         insopts -m0755
107         doins -r "${S}"/bin/lastfm_services/*.so || die "failed to install plugins"
108         if use dbus; then
109                 insinto /usr/$(get_libdir)/lastfm_services/extensions/
110                 insopts -m0755
111                 doins "${S}"/bin/lastfm_services/extensions/*.so
112         fi
113         insinto /usr/$(get_libdir)
114         insopts -m0755
115         doins "${S}"/bin/libLastFmTools.so.1* || die "failed to install library"
116         doins "${S}"/bin/libMoose.so.1* || die "failed to install library"
117         #fix symlinks
118         cd "${D}"/usr/$(get_libdir)/
119         ln -sfn libLastFmTools.so.1.0.0 libLastFmTools.so.1
120         ln -sfn libLastFmTools.so.1.0.0 libLastFmTools.so.1.0
121         ln -sfn libMoose.so.1.0.0 libMoose.so.1
122         ln -sfn libMoose.so.1.0.0 libMoose.so.1.0
123         cd "${WORKDIR}"
124         newbin "${S}"/bin/last.fm lastfm
125         insinto /usr/share/lastfm/i18n
126         doins "${S}"/i18n/*.qm || die "failed to install translations"
127         fperms 755 /usr/bin/lastfm
128         rm -f "${D}"/usr/share/lastfm/icons/{*profile24,systray_mac}.png
129         # create desktop entry
130         doicon "${WORKDIR}"/debian/package-files/share/icons/hicolor/48x48/apps/lastfm.png
131         # Allow arguments when launching application. Bug #395277
132         make_desktop_entry lastfm "Last.fm Player" lastfm
133         sed -i -e "/^Exec/s:lastfm:& %U:" \
134                 "${D}"/usr/share/applications/lastfm-${PN}.desktop || die
135
136         readme.gentoo_create_doc
137 }