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, "/usr/local/squeezeboxserver/$dir";

	} elsif ($dir eq 'Plugins') {

		push @dirs, "/usr/local/lib/perl5/site_perl/5.14", "/usr/local/squeezeboxserver/Plugins", "/usr/local/squeezeboxserver/Slim/Plugin", "/var/db/squeezeboxserver/cache/InstalledPlugins/Plugins";

	} elsif ($dir eq 'strings' || $dir eq 'revision') {

		push @dirs, "/usr/local/squeezeboxserver";

	} elsif ($dir eq 'types' || $dir eq 'convert') {

		push @dirs, "/usr/local/squeezeboxserver";

	} elsif ($dir eq 'prefs') {

		push @dirs, "/var/db/squeezeboxserver/prefs";

	} elsif ($dir eq 'log') {

		push @dirs, "/var/log/squeezeboxserver";

	} elsif ($dir eq 'cache' || $dir eq 'updates') {

		push @dirs, "/var/db/squeezeboxserver/cache";

	} elsif ($dir =~ /^(?:libpath|mysql-language)$/) {

		# Do nothing - use the depended upon MySQL install.

	} elsif ($dir eq 'scprefs') {

		if (-r '/var/db/squeezecenter/prefs/server.prefs') {

			push @dirs, '/var/db/squeezecenter/prefs';

		}

	} else {

		warn "dirsFor: Didn't find a match request: [$dir]\n";

	}

	return wantarray() ? @dirs : $dirs[0];
}


1;
