mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-04 01:48:54 +00:00
d5498cb642
directories. This should fix the installation of plugins via the Extension Downloader. [1] Rename Slim/Utils/OS/FreeBSD.pm as Slim/Utils/OS/Custom.pm and store it directly rather than as a patch to make it easier to edit. This reduces the number of patches required. Remove the Slim/Utils/OS/Unix.pm patch since it's now replaced by code in Custom.pm. Submitted by: Hans Soonieus <hans at soonieus dot nl> and Mark Knight <markk at knigma dot org> [1]
84 lines
1.6 KiB
Perl
84 lines
1.6 KiB
Perl
package Slim::Utils::OS::Custom;
|
|
#package Slim::Utils::OS::FreeBSD;
|
|
|
|
use strict;
|
|
use base qw(Slim::Utils::OS::Unix);
|
|
|
|
use Config;
|
|
|
|
sub initDetails {
|
|
my $class = shift;
|
|
|
|
$class->{osDetails} = $class->SUPER::initDetails();
|
|
$class->{osDetails}->{'os'} = 'FreeBSD';
|
|
$class->{osDetails}->{osName} = 'FreeBSD';
|
|
|
|
return $class->{osDetails};
|
|
}
|
|
|
|
sub initSearchPath {
|
|
my $class = shift;
|
|
|
|
$class->SUPER::initSearchPath();
|
|
|
|
my @extra_paths = qw(/usr/local/libexec);
|
|
|
|
Slim::Utils::Misc::addFindBinPaths(@extra_paths);
|
|
}
|
|
|
|
sub dirsFor {
|
|
my ($class, $dir) = @_;
|
|
|
|
my @dirs;
|
|
|
|
if ($dir =~ /^(?:Firmware|Graphics|HTML|IR|MySQL|SQL|lib|Bin)$/) {
|
|
|
|
push @dirs, "%%PREFIX%%/squeezecenter/$dir";
|
|
|
|
} elsif ($dir eq 'Plugins') {
|
|
|
|
push @dirs, "%%SITE_PERL%%", "%%PREFIX%%/%%SLIMDIR%%/Plugins", "%%PREFIX%%/%%SLIMDIR%%/Slim/Plugin", "%%SLIMDBDIR%%/cache/InstalledPlugins/Plugins";
|
|
|
|
} elsif ($dir eq 'strings' || $dir eq 'revision') {
|
|
|
|
push @dirs, "%%PREFIX%%/squeezecenter";
|
|
|
|
} elsif ($dir eq 'types' || $dir eq 'convert') {
|
|
|
|
push @dirs, "%%PREFIX%%/squeezecenter";
|
|
|
|
} elsif ($dir eq 'prefs') {
|
|
|
|
push @dirs, "%%SLIMDBDIR%%/prefs";
|
|
|
|
} elsif ($dir eq 'log') {
|
|
|
|
push @dirs, "/var/log/squeezecenter";
|
|
|
|
} elsif ($dir eq 'cache') {
|
|
|
|
push @dirs, "%%SLIMDBDIR%%/cache";
|
|
|
|
} elsif ($dir =~ /^(?:libpath|mysql-language)$/) {
|
|
|
|
# Do nothing - use the depended upon MySQL install.
|
|
|
|
} elsif ($dir eq 'oldprefs') {
|
|
|
|
if (-r '/var/db/slimserver/slimserver.conf') {
|
|
|
|
push @dirs, '/var/db/slimserver/slimserver.conf';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
warn "dirsFor: Didn't find a match request: [$dir]\n";
|
|
|
|
}
|
|
|
|
return wantarray() ? @dirs : $dirs[0];
|
|
}
|
|
|
|
1;
|