import squeezecenter:

Formerly known as SlimServer, this is a streaming audio server
for use with the SlimDevices/Logitech network music players -
Squeezebox, Transporter and SLiMP3.

* Web browser UI to control the player and manage playlists
* MP3 & WMA Internet radio
* Alarm clock
* Automatically imports metadata tags
* Browse and search by title, artist, album or genre
* Shuffle and repeat albums or songs
* Create, save, and import .pls, .cue and .m3u playlist files
* Displays current date and time when not playing
* Open protocol and command line API
* Expandable through 3rd party plug-ins and skins
* Supports multiple synchronized players
* Listen from any computer using an MP3 software player
This commit is contained in:
sthen 2008-10-17 09:59:26 +00:00
parent 7b32a5b321
commit 53add730e5
13 changed files with 2310 additions and 0 deletions

View File

@ -0,0 +1,114 @@
# $OpenBSD: Makefile,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
COMMENT = streaming audio server for Squeezebox network music players
V = 7.2.0
PKGNAME = squeezecenter-${V}
DISTNAME = squeezecenter-7.2-noCPAN
CATEGORIES = audio net
MAINTAINER = Stuart Henderson <sthen@openbsd.org>
HOMEPAGE = http://www.slimdevices.com/
# Main software is GPLv2, supplied with some CPAN modules packaged,
# but unfortunately also with proprietary (required) firmware, also
# image files/fonts etc which may not be redistributed without an
# explicit permission being granted.
PERMIT_PACKAGE_CDROM = No
PERMIT_PACKAGE_FTP = No
PERMIT_DISTFILES_CDROM =No
PERMIT_DISTFILES_FTP = No
EXTRACT_SUFX = .tgz
MASTER_SITES = http://downloads.slimdevices.com/SqueezeCenter_v${V}/
WRKDIST = ${WRKDIR}/${DISTNAME:S/.no-cpan-arch//}
RUN_DEPENDS = ::audio/flac \
::audio/lame \
:mysql-server-*:databases/mysql,-server \
:p5-Cache-Cache->=1.04:devel/p5-Cache-Cache \
:p5-Carp-Clan->=5.3:devel/p5-Carp-Clan \
:p5-Class-Accessor->=0.31:devel/p5-Class-Accessor \
:p5-Class-C3->=0.11:devel/p5-Class-C3 \
:p5-Class-Data-Accessor->=0.03:devel/p5-Class-Data-Accessor \
:p5-Class-Data-Inheritable->=0.04:devel/p5-Class-Data-Inheritable \
:p5-Class-Inspector->=1.16:devel/p5-Class-Inspector \
:p5-DBD-mysql->=3.0002:databases/p5-DBD-mysql \
:p5-DBI->=1.604:databases/p5-DBI \
:p5-DBIx-Class->=0.07001:databases/p5-DBIx-Class \
:p5-DBIx-Migration->=0.05:databases/p5-DBIx-Migration \
:p5-Data-Dump->=1.06:devel/p5-Data-Dump \
:p5-Data-URIEncode->=0.11:www/p5-Data-URIEncode \
:p5-Digest-SHA1->=2.11:security/p5-Digest-SHA1 \
:p5-Encode-Detect->=1.01:textproc/p5-Encode-Detect \
:p5-Exporter-Lite->=0.02:devel/p5-Exporter-Lite \
:p5-File-BOM->=0.13:devel/p5-File-BOM \
:p5-File-Next->=1.02:devel/p5-File-Next \
:p5-File-ReadBackwards->=1.04:devel/p5-File-ReadBackwards \
:p5-File-Slurp->=9999.12:devel/p5-File-Slurp \
:p5-File-Which->=0.05:sysutils/p5-File-Which \
:p5-GD->=2.35:graphics/p5-GD \
:p5-HTML-Parser->=3.48:www/p5-HTML-Parser \
:p5-I18N-LangTags->=0.35:devel/p5-I18N-LangTags \
:p5-IO-String->=1.07:devel/p5-IO-String \
:p5-JSON-XS->=1.5:converters/p5-JSON-XS \
:p5-JSON-XS-VersionOneAndTwo->=0.31:converters/p5-JSON-XS-VersionOneAndTwo \
:p5-libwww->=5.805:www/p5-libwww \
:p5-Log-Log4perl->=1.07:devel/p5-Log-Log4perl \
:p5-Math-VecStat->=0.08:math/p5-Math-VecStat \
:p5-Net-DNS->=0.58:net/p5-Net-DNS \
:p5-Net-IP->=1.24:net/p5-Net-IP \
:p5-Net-UPnP->=1.2.1:net/p5-Net-UPnP \
:p5-PAR->=0.970:devel/p5-PAR \
:p5-Path-Class->=0.13:devel/p5-Path-Class \
:p5-POE->=0.9989:devel/p5-POE \
:p5-POE-XS-Queue-Array->=0.002:devel/p5-POE-XS-Queue-Array \
:p5-Proc-Background->=1.08:devel/p5-Proc-Background \
:p5-SQL-Abstract->=1.20:databases/p5-SQL-Abstract \
:p5-Template->=2.15:textproc/p5-Template \
:p5-Text-Unidecode->=0.04:textproc/p5-Text-Unidecode \
:p5-Tie-Cache-LRU->=0.21:devel/p5-Tie-Cache-LRU \
:p5-Tie-Cache-LRU-Expires->=0.54:devel/p5-Tie-Cache-LRU-Expires \
:p5-Tie-IxHash->=1.21:devel/p5-Tie-IxHash \
:p5-Tie-LLHash->=1.003:devel/p5-Tie-LLHash \
:p5-Tie-RegexpHash->=0.13:devel/p5-Tie-RegexpHash \
:p5-Time-TimeDate->=1.16:devel/p5-Time-TimeDate \
:p5-URI->=1.35:www/p5-URI \
:p5-URI-Find->=0.16:www/p5-URI-Find \
:p5-XML-Parser->=2.34:textproc/p5-XML-Parser \
:p5-XML-Simple->=2.15:textproc/p5-XML-Simple \
:p5-YAML-Syck->=0.64:devel/p5-YAML-Syck \
:p5-XML-XSPF-*:textproc/p5-XML-XSPF
# remove squeezecenter's redistributed CPAN modules, we use our own.
# remove MySQL error message file, it's for a specific version.
pre-configure:
@rm ${WRKSRC}/MySQL/errmsg.sys
@ln -s ${TRUEPREFIX}/share/mysql/english/errmsg.sys \
${WRKSRC}/MySQL/errmsg.sys
@rm -rf ${WRKSRC}/CPAN
@${SUBST_CMD} ${WRKSRC}/Slim/Utils/OSDetect.pm
NO_BUILD = yes
PMDIR = libdata/perl5/site_perl/Slim
SSLIBDIR = libdata/squeezecenter
SSSHAREDIR = share/squeezecenter
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/slimserver.pl ${PREFIX}/bin/slimserver.pl
${INSTALL_PROGRAM} ${WRKSRC}/scanner.pl ${PREFIX}/bin/scanner.pl
${INSTALL_DATA_DIR} ${PREFIX}/{${PMDIR},${SSLIBDIR},${SSSHAREDIR}}
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/squeezecenter
.for i in types convert modules
${INSTALL_DATA} ${WRKSRC}/$i.conf ${PREFIX}/share/examples/squeezecenter
.endfor
cd ${WRKSRC}/Slim/; tar cf - * | tar xf - -C ${PREFIX}/${PMDIR}/
cd ${WRKSRC}/lib/; tar cf - * | tar xf - -C ${PREFIX}/${SSLIBDIR}/
cd ${WRKSRC}/; tar cf - Firmware Graphics HTML IR MySQL Plugins \
SQL strings.txt | tar xf - -C ${PREFIX}/${SSSHAREDIR}/
touch ${PREFIX}/share/examples/squeezecenter/empty
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (squeezecenter-7.2-noCPAN.tgz) = KgFg6V+ime5VVSVWwbgEGw==
RMD160 (squeezecenter-7.2-noCPAN.tgz) = 5/2v2wqR3N599APkWLumP1BpISI=
SHA1 (squeezecenter-7.2-noCPAN.tgz) = 5LXSvLTL7rAzcQo4DRIaSSfgJfk=
SHA256 (squeezecenter-7.2-noCPAN.tgz) = MGxo5Ce07oi6vqNTttAEkdzrHUj42zxLvuzTg0L+Zjw=
SIZE (squeezecenter-7.2-noCPAN.tgz) = 22652662

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-Slim_Music_Import_pm,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- Slim/Music/Import.pm.orig Fri Oct 10 16:40:15 2008
+++ Slim/Music/Import.pm Fri Oct 10 16:40:31 2008
@@ -276,9 +276,11 @@ sub setIsScanning {
my $autoCommit = Slim::Schema->storage->dbh->{'AutoCommit'};
- if ($autoCommit) {
- Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
- }
+ # Disabled as per Bugzilla 8261: this causes DBIx transactions to fail.
+ #
+ #if ($autoCommit) {
+ # Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
+ #}
eval { Slim::Schema->txn_do(sub {

View File

@ -0,0 +1,23 @@
support current JSON::XS version, diff from FreeBSD ports.
$OpenBSD: patch-Slim_Plugin_LastFM_ProtocolHandler_pm,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- Slim/Plugin/LastFM/ProtocolHandler.pm.orig Sun Oct 12 17:48:27 2008
+++ Slim/Plugin/LastFM/ProtocolHandler.pm Sun Oct 12 17:48:27 2008
@@ -7,7 +7,7 @@ package Slim::Plugin::LastFM::ProtocolHandler;
use strict;
use base qw(Slim::Player::Protocols::HTTP);
-use JSON::XS qw(from_json);
+use JSON::XS qw(decode_json);
use URI::Escape qw(uri_escape_utf8);
use Slim::Player::Playlist;
@@ -155,7 +155,7 @@ sub gotNextTrack {
my $client = $http->params->{client};
my $params = $http->params->{params};
- my $track = eval { from_json( $http->content ) };
+ my $track = eval { decode_json( $http->content ) };
if ( $@ || $track->{error} ) {
# We didn't get the next track to play

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-Slim_Schema_Playlist_pm,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- Slim/Schema/Playlist.pm.orig Fri Oct 10 16:39:25 2008
+++ Slim/Schema/Playlist.pm Fri Oct 10 16:40:53 2008
@@ -32,9 +32,11 @@ sub setTracks {
# With playlists in the database - we want to make sure the playlist is consistent to the user.
my $autoCommit = Slim::Schema->storage->dbh->{'AutoCommit'};
- if ($autoCommit) {
- Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
- }
+ # Disabled as per Bugzilla 8261: this causes DBIx transactions to fail.
+ #
+ #if ($autoCommit) {
+ # Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
+ #}
eval {
Slim::Schema->txn_do(sub {
@@ -59,9 +61,11 @@ sub appendTracks {
my $autoCommit = Slim::Schema->storage->dbh->{'AutoCommit'};
- if ($autoCommit) {
- Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
- }
+ # Disabled as per Bugzilla 8261: this causes DBIx transactions to fail.
+ #
+ #if ($autoCommit) {
+ # Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
+ #}
eval {
Slim::Schema->txn_do(sub {

View File

@ -0,0 +1,87 @@
$OpenBSD: patch-Slim_Utils_OSDetect_pm,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- Slim/Utils/OSDetect.pm.orig Fri Aug 29 10:00:59 2008
+++ Slim/Utils/OSDetect.pm Sat Oct 11 14:59:23 2008
@@ -124,7 +124,7 @@ sub initSearchPath {
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/libexec /sw/bin /usr/sbin /usr/local/libexec));
} else {
@@ -370,6 +370,55 @@ sub dirsFor {
push @dirs, catdir( $Bin, $dir );
}
+ } elsif (isOpenBSD()) {
+
+ if ($dir =~ /^(?:Firmware|Graphics|HTML|IR|MySQL|SQL|Bin)$/) {
+
+ push @dirs, "${LOCALBASE}/share/squeezecenter/$dir";
+
+ } elsif ($dir eq 'Plugins') {
+
+ push @dirs, "${LOCALBASE}/share/squeezecenter/$dir";
+ push @dirs, "${LOCALBASE}/libdata/perl5/site_perl/Slim/Plugin";
+
+ } elsif ($dir =~ /^(?:Bin|lib)$/) {
+
+ push @dirs, "${LOCALBASE}/libdata/squeezecenter";
+
+ } elsif ($dir eq 'strings' || $dir eq 'revision') {
+
+ push @dirs, "${LOCALBASE}/share/squeezecenter";
+
+ } elsif ($dir =~ /^(?:types|convert)$/) {
+
+ push @dirs, "${SYSCONFDIR}/squeezecenter";
+
+ } elsif ($dir eq 'prefs') {
+
+ push @dirs, "/var/db/squeezecenter/prefs";
+
+ } elsif ($dir eq 'log') {
+
+ push @dirs, "/var/log/squeezecenter";
+
+ } elsif ($dir eq 'cache') {
+
+ push @dirs, "/var/db/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";
+
+ }
+
} else {
# Everyone else - *nix.
@@ -478,6 +527,18 @@ sub isRHorSUSE {
return 1;
}
+ return 0;
+}
+
+sub isOpenBSD {
+
+ # Initialize
+ my $OS = OS();
+ my $details = details();
+
+ if ($details->{'osName'} eq 'openbsd') {
+ return 1;
+ }
return 0;
}

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-Slim_bootstrap_pm,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- Slim/bootstrap.pm.orig Sat Apr 26 08:40:34 2008
+++ Slim/bootstrap.pm Sat May 24 22:52:44 2008
@@ -76,7 +76,11 @@ sub loadModules {
# If the caller passed in a libPath, use that. Otherwise, default to $Bin
if (!$libPath) {
- $libPath = $Bin;
+ if(Slim::Utils::OSDetect::isOpenBSD()) {
+ $libPath = '/usr/local/libdata/squeezecenter';
+ } else {
+ $libPath = $Bin;
+ }
}
# NB: Fedora Core 5 (and other SELinux work-arounds)

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-convert_conf,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- convert.conf.orig Fri Mar 28 16:04:54 2008
+++ convert.conf Sat May 24 22:52:44 2008
@@ -88,7 +88,7 @@ ogg ogg * *
-
ogg aif * *
- [sox] -t ogg $FILE$ -t raw -r 44100 -c 2 -w -s $-x$ -
+ [oggdec] -Q -o - $FILE$
wma wav * *
[wmadec] -r 44100 -b 16 -n 2 $FILE$
@@ -110,7 +110,7 @@ wvp wav * *
## you can comment this out if you want to use LAME to transcode AAC/MOV files to MP3.
mov aif * *
- [mov123] $FILE$
+ [faad] -w -f 2 $FILE$
wma wma squeezebox2 *
-
@@ -142,7 +142,7 @@ ape flc * *
[mac] $FILE$ - -d | [flac] -cs --totally-silent --compression-level-0 -
mov flc * *
- [mov123] $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian big --sign signed --channels 2 --bps 16 --sample-rate 44100 -
+ [faad] -w -f 2 $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian big --sign signed --channels 2 --bps 16 --sample-rate 44100 -
alc flc * *
[alac] $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian big --sign signed --channels 2 --bps 16 --sample-rate 44100 -

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-scanner_pl,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- scanner.pl.orig Fri Oct 10 16:45:35 2008
+++ scanner.pl Fri Oct 10 16:45:50 2008
@@ -158,7 +158,8 @@ sub main {
$log->info("SqueezeCenter done init...\n");
# Take the db out of autocommit mode - this makes for a much faster scan.
- Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
+ # XXX but breaks shit ???
+ # Slim::Schema->storage->dbh->{'AutoCommit'} = 0;
# Flag the database as being scanned.
Slim::Music::Import->setIsScanning(1);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-slimserver_pl,v 1.1.1.1 2008/10/17 09:59:26 sthen Exp $
--- slimserver.pl.orig Fri Oct 10 17:01:36 2008
+++ slimserver.pl Fri Oct 10 17:02:12 2008
@@ -814,7 +814,7 @@ sub changeEffectiveUserAndGroup {
# MySQL can't be run as root, and it's generally a bad idea anyways.
# Try starting as 'slimserver' instead.
if (!defined($user)) {
- $user = 'slimserver';
+ $user = '_squeezecenter';
print STDERR "SqueezeCenter must not be run as root! Trying user $user instead.\n";
}

View File

@ -0,0 +1,16 @@
Formerly known as SlimServer, this is a streaming audio server
for use with the SlimDevices/Logitech network music players -
Squeezebox, Transporter and SLiMP3.
* Web browser UI to control the player and manage playlists
* MP3 & WMA Internet radio
* Alarm clock
* Automatically imports metadata tags
* Browse and search by title, artist, album or genre
* Shuffle and repeat albums or songs
* Create, save, and import .pls, .cue and .m3u playlist files
* Displays current date and time when not playing
* Open protocol and command line API
* Expandable through 3rd party plug-ins and skins
* Supports multiple synchronized players
* Listen from any computer using an MP3 software player

View File

@ -0,0 +1,16 @@
You may start SqueezeCenter automatically at startup by adding
the following lines to /etc/rc.local:
if [ -x ${PREFIX}/bin/slimserver.pl ]; then
${PREFIX}/bin/slimserver.pl --daemon 2>&1 \
> /var/log/squeezecenter/startup.log
fi
To stream via HTTP, connect to http://yourhost:9000/stream.mp3
and control the player from SqueezeCenter's usual web interface.
** SQUEEZECENTER IS BY DEFAULT OPEN TO ANYONE ABLE TO CONNECT **
To restrict access, connect to http://localhost:9000/ and go to
Settings/Advanced/Security, where you can restrict by IP address
or password.

File diff suppressed because it is too large Load Diff