Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SRC_URI only for .tar.gz?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
andrew_j_w
Guru
Guru


Joined: 28 Jun 2003
Posts: 534
Location: York, UK

PostPosted: Sat Jun 28, 2003 11:27 pm    Post subject: SRC_URI only for .tar.gz? Reply with quote

Hi,

I've just begun writing my own eBuilds, and have straight away hit a problem. I was trying to write an ebuild to add the XMMS plugin for AudioScrobbler (www.audioscrobbler.com). To install it all you need to do is download a Perl file and run it. Nice and easy I thought, but no it would appear that the SRC_URI variable won't download a perl file. If I change the extension to .tar.gz then wget is run as expected, although obviously the file isn't there. If it has a .pl extension then wget appears not to be run, and it even passes the md5 check - even though no file was downloaded!

Have I done something wrong to prevent this from working, or is this by design?

Thanks in advance,
Andrew Wilkinson
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Sun Jun 29, 2003 1:26 am    Post subject: Reply with quote

The Perl script downloads xmmsplugin1.41.tgz. How about using that for the SRC_URI?

Your ebuild will have to replace the Perl script anyways. An ebuild installs your package in a temporary image directory before actually installing it in /usr (or wherever). You usually use make DESTDIR=${D} install to do that. There isn't any easy way to make the Perl script work that way since the directories are hard-coded.

In your src_install() funcion use this to find the directory to unpack ${A} in:
Code:
xmms-config --general-plugin-dir


As for determining the latest version, I think you'll just have to tie that in to the version of the ebuild. You can't just have an ebuild named 'audioscrobbler.ebuild' and have it download the latest version like the Perl script does, in other words. You need to name it audioscrobbler-1.41.ebuild.

Then set:
Code:
MY_P='xmmsplugin${PV}"
SRC_URI='http://audioscrobbler.com/controlcentre/${MY_P}.tgz"


This way, when 1.42 comes out you simply rename the ebuild using that new version number and it'll download the new version automagically.
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Sun Jun 29, 2003 2:16 am    Post subject: Reply with quote

An ebuild is worth a thousand long posts:
Code:

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $

MY_P="xmmsplugin${PV}"
S="${WORKDIR}/${P}"
DESCRIPTION="scrobbler your xmms output with this plugin"
HOMEPAGE="http://audioscrobbler.com/"
SRC_URI="http://audioscrobbler.com/controlcentre/${MY_P}.tgz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE=""

src_install() {
   insinto /usr/lib/xmms/General
   doins ${$WORKDIR}/audioscrobbler.so
}



Hey, and its even shorter than the Perl script.

Save this as:
/usr/local/portage/media-sound/audioscrobbler/audioscrobbler-1.41.ebuild
Back to top
View user's profile Send private message
andrew_j_w
Guru
Guru


Joined: 28 Jun 2003
Posts: 534
Location: York, UK

PostPosted: Sun Jun 29, 2003 11:10 am    Post subject: Reply with quote

Cheers guys, that's just what I needed.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum