1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
$FreeBSD$
--- Slim/Utils/OSDetect.pm.orig
+++ Slim/Utils/OSDetect.pm
@@ -125,7 +125,7 @@
if ($detectedOS ne "win") {
- push @paths, (split(/:/, $ENV{'PATH'}), qw(/usr/bin /usr/local/bin /usr/libexec /sw/bin /usr/sbin));
+ push @paths, (split(/:/, $ENV{'PATH'}), qw(/usr/bin /usr/local/bin /usr/local/libexec /usr/libexec /sw/bin /usr/sbin));
} else {
@@ -248,6 +248,48 @@
warn "dirsFor: Didn't find a match request: [$dir]\n";
}
+ } elsif (isFreeBSD()) {
+
+ if ($dir =~ /^(?:Firmware|Graphics|HTML|IR|MySQL|SQL|lib|Bin)$/) {
+
+ push @dirs, "%%PREFIX%%/squeezecenter/$dir";
+
+ } elsif ($dir eq 'Plugins') {
+ push @dirs, "%%SITE_PERL%%", "%%PREFIX%%/squeezecenter/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 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()) {
@@ -432,6 +474,28 @@
return isReadyNAS();
}
+=head2 isFreeBSD( )
+
+ The FreeBSD package has some specific differences for file locations.
+ This routine needs no args, and returns 1 if FreeBSD is detected, with
+ a clear sign that the port/package has been installed, 0 if not.
+
+=cut
+
+sub isFreeBSD {
+
+ # Initialize
+ my $OS = OS();
+ my $details = details();
+
+ if ($details->{'osName'} eq 'freebsd' && $0 =~ m{^/usr/local/squeezecenter} ) {
+ return 1;
+ }
+
+ return 0;
+}
+
+
sub isRHorSUSE {
# Initialize
|