--- Slim/Utils/OSDetect.pm.old 2008-07-22 12:25:34.000000000 +0100 +++ Slim/Utils/OSDetect.pm 2008-07-22 12:27:06.000000000 +0100 @@ -253,6 +253,58 @@ warn "dirsFor: Didn't find a match request: [$dir]\n"; } + } elsif (isGentoo()) { + + if ($dir =~ /^(?:Firmware|Graphics|HTML|IR|MySQL|SQL)$/) { + + push @dirs, "/usr/share/squeezecenter/$dir"; + + } elsif ($dir =~ /^(?:lib)$/) { + + push @dirs, "/usr/lib/squeezecenter"; + + } elsif ($dir eq 'UserPluginRoot') { + + push @dirs, "/var/lib/squeezecenter"; + + } elsif ($dir eq 'Plugins') { + + push @dirs, "/var/lib/squeezecenter/Plugins"; + push @dirs, "/usr/lib/" . $Config{'package'} . "/vendor_perl/" . $Config{'version'} . "/Slim/Plugin" + + } elsif ($dir eq 'strings' || $dir eq 'revision') { + + push @dirs, "/usr/share/squeezecenter"; + + } elsif ($dir =~ /^(?:types|convert)$/) { + + push @dirs, "/etc/squeezecenter"; + + } elsif ($dir =~ /^(?:prefs)$/) { + + push @dirs, "/var/lib/squeezecenter/prefs"; + + } elsif ($dir eq 'log') { + + push @dirs, "/var/log/squeezecenter"; + + } elsif ($dir eq 'cache') { + + push @dirs, "/var/lib/squeezecenter/cache"; + + } elsif ($dir eq 'MySQL') { + + # Do nothing - use the depended upon MySQL install. + + } elsif ($dir =~ /^(?:music|playlists)$/) { + + push @dirs, ''; + + } else { + + warn "dirsFor: Didn't find a match request: [$dir]\n"; + } + # Red Hat/Fedora/SUSE RPM specific paths. } elsif (isRHorSUSE()) { @@ -465,6 +517,19 @@ return isReadyNAS(); } +sub isGentoo { + + # Initialize + my $OS = OS(); + my $details = details(); + + if ($details->{'osName'} eq 'Gentoo') { + return 1; + } + + return 0; +} + sub isRHorSUSE { # Initialize @@ -586,6 +651,10 @@ $osDetails{'osName'} = 'Debian'; + } elsif (-f '/etc/gentoo-release') { + + $osDetails{'osName'} = 'Gentoo'; + } elsif (-f '/etc/redhat_release' || -f '/etc/redhat-release') { $osDetails{'osName'} = 'Red Hat'; @@ -603,7 +672,7 @@ $osDetails{'osArch'} = $Config{'myarchname'}; # package specific addition to @INC to cater for plugin locations - if (isDebian()) { + if (isDebian() || isGentoo()) { unshift @INC, '/usr/share/squeezecenter'; unshift @INC, '/usr/share/squeezecenter/CPAN'; --- Slim/Music/Import.pm.old 2008-07-22 12:24:32.000000000 +0100 +++ Slim/Music/Import.pm 2008-07-22 12:27:06.000000000 +0100 @@ -128,7 +128,7 @@ $command = '/usr/libexec/squeezecenter-scanner'; - } elsif (Slim::Utils::OSDetect::isDebian()) { + } elsif (Slim::Utils::OSDetect::isDebian() || Slim::Utils::OSDetect::isGentoo()) { $command = '/usr/sbin/squeezecenter-scanner'; --- Slim/bootstrap.pm.old 2008-07-22 12:24:09.000000000 +0100 +++ Slim/bootstrap.pm 2008-07-22 12:27:06.000000000 +0100 @@ -97,8 +97,9 @@ my @SlimINC = (); - if (Slim::Utils::OSDetect::isDebian() || Slim::Utils::OSDetect::isRHorSUSE()) { - # On Debian, RH and SUSE, our CPAN directory is located in the same dir as strings.txt + if (Slim::Utils::OSDetect::isDebian() || Slim::Utils::OSDetect::isRHorSUSE() || Slim::Utils::OSDetect::isGentoo()) { + # On Debian, Gentoo, RH and SUSE, our CPAN directory is located in the + # same dir as strings.txt $libPath = Slim::Utils::OSDetect::dirsFor('strings'); } @@ -125,6 +126,14 @@ $libPath, ); + if (Slim::Utils::OSDetect::isGentoo()) { + # On Gentoo, the lib directory is located separately to the CPAN + # directory as it's not architecture-independent, and make sure we + # also look at the separate user plugins directory. + push @SlimINC, Slim::Utils::OSDetect::dirsFor('lib'); + push @SlimINC, Slim::Utils::OSDetect::dirsFor('UserPluginRoot'); + } + $d_startup && printf("Got \@INC containing:\n%s\n\n", join("\n", @INC)); # This works like 'use lib' --- Slim/Utils/MySQLHelper.pm.old 2008-07-22 12:25:31.000000000 +0100 +++ Slim/Utils/MySQLHelper.pm 2008-07-22 12:27:06.000000000 +0100 @@ -152,7 +152,7 @@ # Because we use the system MySQL, we need to point to the right # directory for the errmsg. files. Default to english. - if (Slim::Utils::OSDetect::isDebian() || Slim::Utils::OSDetect::isRHorSUSE()) { + if (Slim::Utils::OSDetect::isDebian() || Slim::Utils::OSDetect::isRHorSUSE() || Slim::Utils::OSDetect::isGentoo()) { $config{'language'} = '/usr/share/mysql/english'; }