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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
--- 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';
}
|