PDA

View Full Version : File location for plugin binaries (alienbbc)



Mark Miksis
2007-10-25, 09:10
While rewriting the SC RPM, I'm trying to be as strict as possible about not allowing things to be added to /usr/share/squeezecenter after the RPM is installed. There are really two reasons for this:
- The FHS is clear that anything installed in /usr must work if it is mounted read-only
- Adding files within a directory structure that is owned by an RPM, leaves messy remnants around when uninstalling
I've addressed this for plugins by simply adding a symlink from /usr/share/squeezecenter/Plugins to /var/lib/squeezecenter/Plugins. I'm wondering how best to handle cases like alienbbc (are there others?) that need to install an executable. Maybe add a Plugins/Bin directory and look for them there? Comments?

Triode
2007-10-25, 10:46
I'd like to ensure any solution is generic so that we can ship a single version of alien for unix rather than a specific one for rpm installs.

Perhaps a Plugins/Bin folder is the best answer as long as it is means it is in a fixed location relative to the rest of the Plugin. However this will impact all unix systems including OSX so we need to ensure this will work for them too.

bpa
2007-10-25, 11:17
If there is a Bin for each Plugin, will there need to be some changes to custom-convert.conf and custom-types.conf needed so FileTypes will know which Plugin/Bin to search to find which binary to use.

Mark Miksis
2007-10-25, 11:29
If there is a Bin for each Plugin, will there need to be some changes to custom-convert.conf and custom-types.conf needed so FileTypes will know which Plugin/Bin to search to find which binary to use.

I thought that custom-convert just references mplayer.sh and SC uses findbin to look for it. Is that not correct? I see no reason to need a separate Bin for each plugin.

bpa
2007-10-25, 11:41
You're right - I got a bit mixed up and thought you meant a Bin per Plugin.

I agree with a single Bin for all Plugins.

Mark Miksis
2007-10-25, 12:04
So I guess all I'm really suggesting for now is adding one more place for findbin to look.

To clarify, I'm really trying to be prepared for a future plugin installer. For now, I assume that anyone installing your tarball is root, so he can also remount /usr RW if necessary. Your existing tarball will still work (although issue 2 from my initial post still exists), or you could change it to use Plugins/Bin.

Eventually, SC will have a web-based GUI plugin installer. This means that a non-privileged user "squeezecenter" will be writing and deleting stuff somewhere. That's when it's important that the destination is outside or /usr. At that time either the installer, or perhaps some info in the xml file will need to be smart enough to know where binary and conf files need to go. I don't think anyone really knows how that will work yet.

Prior to the availability of such an installer, are you guys interested in an alienbbc RPM? I'd be happy to contribute a spec file.

Triode
2007-10-25, 12:16
> To clarify, I'm really trying to be prepared for a future plugin
> installer. For now, I assume that anyone installing your tarball is
> root, so he can also remount /usr RW if necessary. Your existing
> tarball will still work (although issue 2 from my initial post still
> exists), or you could change it to use Plugins/Bin.

I've not looked at the rpm yet, but does it still work as the Bin folder is
assumed to be at the same location as Plugins? I suspect you've moved
Plugins but not Bin so our tarball won't work anyway?

I'm tempted to say Plugins/Bin should be the location - but it would be
worth comments from other plugin authors.

Re rpm - depends on the number of users of alien on rpm systems - I suspect
its relatively few and maybe just making a tarball work for all unix would
be simpler (we haven't spent much time on packaging for anthing other than
windows to date..)

Mark Miksis
2007-10-25, 12:27
I've not looked at the rpm yet, but does it still work as the Bin folder is assumed to be at the same location as Plugins? I suspect you've moved Plugins but not Bin so our tarball won't work anyway?

I've moved Plugins but added a symlink from the old location.


I'm tempted to say Plugins/Bin should be the location - but it would be worth comments from other plugin authors.

You're the only one I know of that ships something in Bin, but I don't use that many plugins...


Re rpm - depends on the number of users of alien on rpm systems - I suspect its relatively few and maybe just making a tarball work for all unix would be simpler (we haven't spent much time on packaging for anthing other than windows to date..)

OK. It's pretty simple but I won't work on it unless you ask.

bpa
2007-10-25, 12:42
I think InguzDSP ( http://inguzaudio.com/installation/ ) also has an executable.

It seems to me that Ubuntu and Debian users more often have problems with installing AlienBBC from a tarball but that could be because there are no instructions for Ubuntu/Debian on the Alien website.

erland
2007-10-25, 21:06
Is there a reason why there can't be a bin directory per plugin, for example:
Plugins/AlienBBC/bin

Triode
2007-12-28, 13:40
I'm planning on adding support for a Bin directory at the top level of each plugin. I hope this will simplify plugin packaging for plugins which include binaries.

Fletch - would this mean we can remove the extra /var/lib/squeezecenter/Plugins/Bin in Slim::Utils::Misc::findbin
(assuming we convert the plugins?)

I'm hoping it means we can remove the osx machine specifics too.

Mark Miksis
2007-12-28, 14:05
Fletch - would this mean we can remove the extra /var/lib/squeezecenter/Plugins/Bin in Slim::Utils::Misc::findbin
(assuming we convert the plugins?)

Yes. AFAIK, no plugin is currently packaged to use it so there should be no plugins to convert. I have an Alien RPM that I use for Instant SqueezeCenter, but I can easily change that.

Do you plan to get this in for 7.0?

Triode
2007-12-30, 18:54
Here's a proposed patch to add support for a Bin and Bin/<arch> directories
for plugins.

It also moves as much of the OS specific code into OSDetect.pm to help
maintaining this.

As we are getting near 7.0, I thought I'd ask for a review of this before
including it.

Note that removes support for the architecture specific Bin directories
currently used on osx, RH and SUSE as I believe these were only there for
plugins. Please confirm if they are not...

> Triode;252237 Wrote:
>> Fletch - would this mean we can remove the extra
>> /var/lib/squeezecenter/Plugins/Bin in Slim::Utils::Misc::findbin
>> (assuming we convert the plugins?)
>
> Yes. AFAIK, no plugin is currently packaged to use it so there should
> be no plugins to convert. I have an Alien RPM that I use for Instant
> SqueezeCenter, but I can easily change that.
>
> Do you plan to get this in for 7.0?

Mark Miksis
2007-12-31, 11:27
Here's a proposed patch to add support for a Bin and Bin/<arch> directories
for plugins.

Triode,

I built an RPM with this patch applied to the 12/31 nightly tarball. It builds and installs fine and doesn't seem to break anything at that point. I then installed the Alien Beta2 and moved Bin/mplayer.sh to Plugins/Alien/Bin. The Plugin loads and the menus all show up properly in SC and on the player. But, when I try to play an Alien stream from the player, I get:

[07-12-31 10:16:30.0491] Slim::Buttons::XMLBrowser::gotError (165) Error: While retrieving [http://www.bbc.co.uk/radio/aod/networks/radio1/live.shtml]: [Can't locate object method "parse" via package "Plugins::
Alien::Parsers::PlayableAodParser" (perhaps you forgot to load "Plugins::Alien::Parsers::PlayableAodParser"?) at /usr/lib/perl5/vendor_perl/Slim/Formats/XML.pm line 214.

When I try to play an Alien stream from SC, nothing happens and nothing appears in the logs.

HTH

Mark Miksis
2007-12-31, 11:32
Also, the Alien settings page fails to load with:

[07-12-31 10:31:17.7496] Slim::Web::HTTP::_generateContentFromFile (2226) Error: file error - : not found

Mark Miksis
2007-12-31, 11:40
Argh... Ignore my last 2 posts. It was a permission issue and all seems to work fine now. I'll continue to test.

(How many times have I warned other users about Plugin permission and ownership...)