diff options
author | Joe Peterson <lavajoe@gentoo.org> | 2009-01-26 03:29:21 +0000 |
---|---|---|
committer | Joe Peterson <lavajoe@gentoo.org> | 2009-01-26 03:29:21 +0000 |
commit | 500c0e66d217bf40c9019d2ef5d03d2441c7477a (patch) | |
tree | bee9c9f6fc48d89d24c863b7625e19277c662192 /media-sound | |
parent | Split pcimodules files apart to share across versions. (diff) | |
download | historical-500c0e66d217bf40c9019d2ef5d03d2441c7477a.tar.gz historical-500c0e66d217bf40c9019d2ef5d03d2441c7477a.tar.bz2 historical-500c0e66d217bf40c9019d2ef5d03d2441c7477a.zip |
Add new version 7.3.2
Package-Manager: portage-2.1.6.7/cvs/Linux i686
Diffstat (limited to 'media-sound')
6 files changed, 613 insertions, 2 deletions
diff --git a/media-sound/squeezecenter/ChangeLog b/media-sound/squeezecenter/ChangeLog index b864e9c9d9d8..19b572e75324 100644 --- a/media-sound/squeezecenter/ChangeLog +++ b/media-sound/squeezecenter/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for media-sound/squeezecenter # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v 1.36 2009/01/21 17:52:58 lavajoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v 1.37 2009/01/26 03:29:21 lavajoe Exp $ + +*squeezecenter-7.3.2 (26 Jan 2009) + + 26 Jan 2009; Joe Peterson <lavajoe@gentoo.org> + +files/squeezecenter-7.3.2-aac-transcode-gentoo.patch, + +files/squeezecenter-7.3.2-build-perl-modules-gentoo.patch, + +files/squeezecenter-7.3.2-json-xs-gentoo.patch, + +squeezecenter-7.3.2.ebuild: + Add new version 7.3.2 *squeezecenter-7.3.1 (21 Jan 2009) diff --git a/media-sound/squeezecenter/Manifest b/media-sound/squeezecenter/Manifest index 4d93716d993f..578245ef21f7 100644 --- a/media-sound/squeezecenter/Manifest +++ b/media-sound/squeezecenter/Manifest @@ -11,6 +11,9 @@ AUX mDNSResponder-gentoo.patch 351 RMD160 084a1374d5f8f9f4586bfade7a1bda22a4f783 AUX squeezecenter-7.3.1-aac-transcode-gentoo.patch 1244 RMD160 85596b04058021f5f94e56b6b6d0f904e74f14a7 SHA1 15d589f3071ac4efa61ac4d3a5467b57809d6d12 SHA256 1e744d9cacd5898956eddf834347759a5465a947e3e042128986afca6fca5770 AUX squeezecenter-7.3.1-build-perl-modules-gentoo.patch 2749 RMD160 6e38831b81ac200c40f7f7f8a5efaaab69e27d61 SHA1 f4c2e18591cee050f543b2aef51647d045b254af SHA256 d3c2ab3609e28676d34755ef673161b831abbc755b5f6e4b72403f1ca2ac4d01 AUX squeezecenter-7.3.1-json-xs-gentoo.patch 506 RMD160 c489bd77c7ea2bb2db7c67e6f3a0686346bda36b SHA1 a305b87c3550bbf69456b7a7a57887d600529259 SHA256 db6db5e28afdbf36c938d3bd406997340b4ad7c718f26289fbfab0dee564116a +AUX squeezecenter-7.3.2-aac-transcode-gentoo.patch 1302 RMD160 454e42c08eff939e61820692ba607a5e5400d7e6 SHA1 ef599099cda7a53f46fb4f8c38e3bd851a1b16d3 SHA256 76228bc3d95184e8f8eeb069bad72a17d924daecfef5880d9384a88628d42ac8 +AUX squeezecenter-7.3.2-build-perl-modules-gentoo.patch 2749 RMD160 6e38831b81ac200c40f7f7f8a5efaaab69e27d61 SHA1 f4c2e18591cee050f543b2aef51647d045b254af SHA256 d3c2ab3609e28676d34755ef673161b831abbc755b5f6e4b72403f1ca2ac4d01 +AUX squeezecenter-7.3.2-json-xs-gentoo.patch 506 RMD160 c489bd77c7ea2bb2db7c67e6f3a0686346bda36b SHA1 a305b87c3550bbf69456b7a7a57887d600529259 SHA256 db6db5e28afdbf36c938d3bd406997340b4ad7c718f26289fbfab0dee564116a AUX squeezecenter.conf.d 1087 RMD160 e979e2bfe070024f46f7f0005de6e7ae11623bdb SHA1 ad69cfdf0f0ace7d44d479e7a7e1ad79a9f86be6 SHA256 7509d6cbc013ddb9c5cbdfe1fe2b81ae3a7f6eb1dc6e119b1ee37553a8f8a69f AUX squeezecenter.init.d 1338 RMD160 8d97de1146151cad44844146f390ac44edf4bc03 SHA1 c4dd848fbf2a0fba44bec7bcb8f92f4eaf278faf SHA256 32845b5669164930088c61ba422e2d4b5a128bbdc8d27aebe70f689ea06de1c2 AUX squeezecenter.logrotate.d 407 RMD160 5a6045321cf1f180ee2ce671d5395cd08379accd SHA1 e1f4c03e9bae354ba44c7fdc59721696c643eb64 SHA256 a98dcb6a95d8711632d6913b7dab221decf35f70858618529b7ae8c103b20a01 @@ -35,10 +38,12 @@ DIST squeezecenter-7.2-noCPAN.tgz 22652662 RMD160 e7fdafdb0a91dcde7df403e458bba6 DIST squeezecenter-7.2.1-noCPAN.tgz 22681495 RMD160 ed7ee0f27b15edc307a6fa2b8ec49abb7731e10a SHA1 a954510933928a1a98d8f1c8bbf21d48c9ffd202 SHA256 d603f9d4affad68a537230bf66cb170f691919d4696873b41452a88ba77480ae DIST squeezecenter-7.3-noCPAN.tgz 23756416 RMD160 648b396be2ff7c64c1e13874141ceb326211dfb3 SHA1 e54402cf016ca9f068ffcf2cafcebc5412843aca SHA256 bc91344af84505f04298d4a8f1f519c42ead1a4d61d33645dc1fe71ec98258f7 DIST squeezecenter-7.3.1-noCPAN.tgz 23765464 RMD160 d114c4fcf5bee255d9f20e7a685f0763e3ef8f7f SHA1 f6160aa467f1c479a25403b65524c494e22d9715 SHA256 7d4fceb8b0b87e10a849cc08237addec910e135e15094e911da6386036302cea +DIST squeezecenter-7.3.2-noCPAN.tgz 25322353 RMD160 80c06cb53fe0bded3801b27e9528b595f84ce7b6 SHA1 9d88cd99fc260736d2c6eebca2aeb9cde81c29ac SHA256 42be2af96fd0924df3fb69bb6cbeb3d73304608bd865cb7f2c505c254f8d664d EBUILD squeezecenter-7.1.0-r1.ebuild 13058 RMD160 25e1d30268ddb1e03dc8b281455e3de9c894ca7e SHA1 8952f15b62700d17b4de626decc5725f5fd9513f SHA256 3141c32deaafe93a7e0331abd28b9d58b2eaa2be7cd9f0af01af0113d9084ea0 EBUILD squeezecenter-7.2.0-r1.ebuild 13035 RMD160 aa0cf2b49a9233e7c4d3c3716d925b76f4313b77 SHA1 c351aebb1dd2a0dfdf545de007211394c10b4a41 SHA256 4bf15144a2306578cd12b5c58b49b60747e124873862200e1c250af303d747ee EBUILD squeezecenter-7.2.1.ebuild 13953 RMD160 50f4112c1a6b0ff031f423ca7bc6129bab311d4f SHA1 d3f4fcd74c51e436cc6ea1b6fca51cc95579c710 SHA256 502c88dc62b02ee2386c58f12d68fd7768cba94f825dde5fdd089fdeab3af3f1 EBUILD squeezecenter-7.3.0.ebuild 14586 RMD160 a71e0f2aa15e1736fcc87419cab871796af02f55 SHA1 b70fef2ea3b64855a2f70dd62f7496ff1f639ea3 SHA256 ace2578c9388e017d3bc20bac735853dfceb15cf6462ae5ac43ad8768966b573 EBUILD squeezecenter-7.3.1.ebuild 15750 RMD160 ef46c6f85adc61275c5090ada150fa969e922718 SHA1 c1e0fb5462960dfdd33d62203f502fdc12e76be9 SHA256 168c2fd9cb208e02cd1c59e412c3ec515b526bb5cc05224291a238dda11c6d88 -MISC ChangeLog 7701 RMD160 785ab47f950ffa7220a7540c41fca0434f800fe6 SHA1 bbdd6c33c1ae56923677c6412efb115ddc978981 SHA256 fa75ac14afbf254de5d4b738e4073ddca89b0fcd707bfda5ea2a70fba6b2e1e9 +EBUILD squeezecenter-7.3.2.ebuild 15750 RMD160 b845b04d7ec2233e296269f8295a58dbc066d578 SHA1 3706afbf2479627d89710030e1d21a8f6c6ad240 SHA256 b9f53bc9ae1a1669c3461292b2909fb69007d4fdeae12266bdf8181504adc40c +MISC ChangeLog 8012 RMD160 956d1dc0f45a7e5f0292c3b802df069a45fbedb1 SHA1 6ab4dee1f476215249214a63603f22aad26ba11c SHA256 b64329ddea1f711629c94703643dde180738fdb379c2724f425ce7c233f0b35b MISC metadata.xml 1111 RMD160 09bbcc60edfa73e0b04a509c43a9e3a38396c9a5 SHA1 091e7172538d6f37f885752a2ab72d1cbf40334a SHA256 3f92fd179e06f52bd8af1caf6d160bacadb9b5ad90e3d34c98255379e075e1fe diff --git a/media-sound/squeezecenter/files/squeezecenter-7.3.2-aac-transcode-gentoo.patch b/media-sound/squeezecenter/files/squeezecenter-7.3.2-aac-transcode-gentoo.patch new file mode 100644 index 000000000000..8500e3d57071 --- /dev/null +++ b/media-sound/squeezecenter/files/squeezecenter-7.3.2-aac-transcode-gentoo.patch @@ -0,0 +1,40 @@ +--- convert.conf.old 2009-01-21 12:10:24.000000000 +0000 ++++ convert.conf 2009-01-21 20:22:05.000000000 +0000 +@@ -74,8 +74,8 @@ + # specific combinations match before wildcards + + mov mp3 * * +- # FRB:{BITRATE=-B %B}D:{RESAMPLE=--resample %D} +- [mov123] $FILE$ | [lame] -s 44100 --silent -q $QUALITY$ $RESAMPLE$ -v $BITRATE$ -r --big-endian - - ++ # FB:{BITRATE=-B %B}D:{RESAMPLE=--resample %D} ++ [faad] -q -w -f 2 $FILE$ | [lame] -s 44100 --silent -q $QUALITY$ $RESAMPLE$ -v $BITRATE$ -r --big-endian - - + + alc mp3 * * + # FB:{BITRATE=-B %B}D:{RESAMPLE=--resample %D} +@@ -158,9 +158,12 @@ + [wvunpack] $FILE$ -rq $START$ $END$ -o - + + ## you can comment this out if you want to use LAME to transcode AAC/MOV files to MP3. +-mov aif * * +- # FR +- [mov123] $FILE$ ++#mov aif * * ++# # FR ++# [mov123] $FILE$ ++mov wav * * ++ # F ++ [faad] -q -w -f 2 $FILE$ + + wma wma * * + - +@@ -198,8 +201,8 @@ + [mac] $FILE$ - -d | [flac] -cs --totally-silent --compression-level-0 - + + mov flc * * +- # FR +- [mov123] $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian big --sign signed --channels 2 --bps 16 --sample-rate 44100 - ++ # F ++ [faad] -q -w -f 2 $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian little --sign signed --channels 2 --bps 16 --sample-rate 44100 - + + alc flc * * + # F diff --git a/media-sound/squeezecenter/files/squeezecenter-7.3.2-build-perl-modules-gentoo.patch b/media-sound/squeezecenter/files/squeezecenter-7.3.2-build-perl-modules-gentoo.patch new file mode 100644 index 000000000000..37de856422d6 --- /dev/null +++ b/media-sound/squeezecenter/files/squeezecenter-7.3.2-build-perl-modules-gentoo.patch @@ -0,0 +1,80 @@ +--- Bin/build-perl-modules.pl.old 2009-01-04 17:55:46.000000000 +0000 ++++ Bin/build-perl-modules.pl 2009-01-05 18:53:33.000000000 +0000 +@@ -21,24 +21,12 @@ + + # NOTE: If you change this in a future version of SC, create a new + # versioned directory under vendor/src for all files for that version +-my $SOURCE = 'http://svn.slimdevices.com/repos/slim/vendor/src/7.3'; + my $dlext = $Config{'dlext'}; + + # The list of all the packages needed. + my %packages = ( + 'Class::XSAccessor::Array' => 'Class-XSAccessor-Array-0.05.tar.gz', +- 'Compress::Zlib' => 'Compress-Zlib-1.41.tar.gz', +- 'DBI' => 'DBI-1.604.tar.gz', +- 'DBD::mysql' => 'DBD-mysql-3.0002.tar.gz', +- 'Digest::SHA1' => 'Digest-SHA1-2.11.tar.gz', +- 'Encode::Detect' => 'Encode-Detect-1.00.tar.gz', +- 'JSON::XS' => 'JSON-XS-1.5.tar.gz', +- 'HTML::Parser' => 'HTML-Parser-3.48.tar.gz', + 'POE::XS::Queue::Array' => 'POE-XS-Queue-Array-0.002.tar.gz', +- 'Template' => 'Template-Toolkit-2.15.tar.gz', +- 'Time::HiRes' => 'Time-HiRes-1.86.tar.gz', +- 'XML::Parser::Expat' => 'XML-Parser-2.34.tar.gz', +- 'YAML::Syck' => 'YAML-Syck-0.64.tar.gz', + ); + + # Don't need Class::C3::XS if you're running 5.10 +@@ -196,36 +184,16 @@ + } + } + ++ # Utilise AutoXS::Header as we need that to support the following builds. ++ chdir($pwd) or die "Couldn't change to $pwd : $!"; ++ # Include this when performing the following builds. ++ $ENV{'PERL5LIB'} = cwd() . "/AutoXS-Header-0.03/lib"; ++ + for my $package (@packages) { + + chdir($pwd) or die "Couldn't change to $pwd : $!"; + +- print "\nDownloading $package to: $pwd\n"; +- +- # Remove any previous version. +- unlink $package; +- +- if ($downloadUsing eq 'lwp') { +- +- LWP::Simple::getstore("$SOURCE/$package?view=auto", $package); +- +- } elsif ($downloadUsing =~ /curl$/) { +- +- `$downloadUsing --silent -o $package $SOURCE/$package?view=auto`; +- +- } else { +- +- `$downloadUsing -q -O $package $SOURCE/$package?view=auto`; +- } +- +- unless (-r $package) { +- print "Something looks wrong - I couldn't read $pwd/$package, which I just downloaded.\n"; +- } +- +- print "Uncompressing..\n"; +- `gzip -d < $package | tar xvf -`; +- +- unlink $package; ++ print "\nBuilding $package\n"; + + # Just the directory name. + my ($packageDir) = ($package =~ /(\S+?)\.tar\.gz/); +--- Slim/bootstrap.pm.old 2008-11-22 15:14:07.000000000 +0000 ++++ Slim/bootstrap.pm 2008-11-22 15:14:30.000000000 +0000 +@@ -176,7 +176,6 @@ + + print "The following modules failed to load: $failed\n\n"; + +- print "To download and compile them, please run: $libPath/Bin/build-perl-modules.pl $failed\n\n"; + print "Exiting..\n"; + + exit; diff --git a/media-sound/squeezecenter/files/squeezecenter-7.3.2-json-xs-gentoo.patch b/media-sound/squeezecenter/files/squeezecenter-7.3.2-json-xs-gentoo.patch new file mode 100644 index 000000000000..a1c4e080614a --- /dev/null +++ b/media-sound/squeezecenter/files/squeezecenter-7.3.2-json-xs-gentoo.patch @@ -0,0 +1,20 @@ +--- Slim/Formats/XML.pm.old 2009-01-17 21:27:29.000000000 +0000 ++++ Slim/Formats/XML.pm 2009-01-17 21:40:14.000000000 +0000 +@@ -13,7 +13,7 @@ + use strict; + use File::Slurp; + use HTML::Entities; +-use JSON::XS qw(from_json); ++use JSON::XS qw(decode_json); + use Scalar::Util qw(weaken); + use URI::Escape qw(uri_escape); + use XML::Simple; +@@ -288,7 +288,7 @@ + my $xml; + + if ( $type =~ /json/ ) { +- $xml = from_json($$content); ++ $xml = decode_json($$content); + } + else { + $xml = xmlToHash($content); diff --git a/media-sound/squeezecenter/squeezecenter-7.3.2.ebuild b/media-sound/squeezecenter/squeezecenter-7.3.2.ebuild new file mode 100644 index 000000000000..366017f26119 --- /dev/null +++ b/media-sound/squeezecenter/squeezecenter-7.3.2.ebuild @@ -0,0 +1,457 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/squeezecenter-7.3.2.ebuild,v 1.1 2009/01/26 03:29:21 lavajoe Exp $ + +inherit eutils + +MAJOR_VER="${PV:0:3}" +MINOR_VER="${PV:4:1}" +SRC_DIR="SqueezeCenter_v${MAJOR_VER}.${MINOR_VER}" +MY_P="squeezecenter-${MAJOR_VER}.${MINOR_VER}-noCPAN" + +DESCRIPTION="Logitech SqueezeCenter music server" +HOMEPAGE="http://www.slimdevices.com/pi_features.html" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="lame wavpack musepack alac ogg bonjour flac avahi aac" + +SRC_URI="http://www.slimdevices.com/downloads/${SRC_DIR}/${MY_P}.tgz + mirror://gentoo/SqueezeCenter-AutoXS-Header-0.03.tar.gz + mirror://gentoo/SqueezeCenter-Class-XSAccessor-Array-0.05.tar.gz + mirror://gentoo/SqueezeCenter-POE-XS-Queue-Array-0.002.tar.gz" + +# Note: dev-perl/module-build necessary because of SC bug#5882 +# (http://bugs.slimdevices.com/show_bug.cgi?id=5882). +DEPEND=" + dev-perl/File-Which + virtual/perl-Module-Build + virtual/logger + virtual/mysql + avahi? ( net-dns/avahi ) + " +# Note: dev-perl/GD necessary because of SC bug#6143 +# (http://bugs.slimdevices.com/show_bug.cgi?id=6143). +RDEPEND="${DEPEND} + >=dev-lang/perl-5.8.8 + >=app-admin/sudo-1.6.8 + >=dev-perl/GD-2.35 + >=virtual/perl-Compress-Zlib-2.015 + >=dev-perl/YAML-Syck-1.05 + >=dev-perl/DBD-mysql-4.00.5 + >=dev-perl/DBI-1.607 + >=dev-perl/Digest-SHA1-2.11 + >=dev-perl/Encode-Detect-1.01 + >=dev-perl/HTML-Parser-3.56 + >=dev-perl/JSON-XS-2.2.3.1 + >=dev-perl/Template-Toolkit-2.19 + >=virtual/perl-Time-HiRes-1.97.15 + >=dev-perl/XML-Parser-2.36 + >=dev-perl/Cache-Cache-1.04 + >=dev-perl/Class-Data-Inheritable-0.08 + >=dev-perl/Class-Inspector-1.23 + >=dev-perl/File-Next-1.02 + >=virtual/perl-File-Temp-0.20 + >=dev-perl/File-Which-0.05 + >=perl-core/i18n-langtags-0.35 + >=dev-perl/IO-String-1.08 + >=dev-perl/Log-Log4perl-1.13 + >=dev-perl/libwww-perl-5.805 + >=perl-core/CGI-3.29 + >=dev-perl/TimeDate-1.16 + >=dev-perl/Math-VecStat-0.08 + >=dev-perl/Net-DNS-0.63 + >=dev-perl/Net-IP-1.25 + >=dev-perl/Path-Class-0.16 + >=dev-perl/SQL-Abstract-1.22 + >=dev-perl/SQL-Abstract-Limit-0.12 + >=dev-perl/TimeDate-1.16 + >=dev-perl/URI-1.35 + >=dev-perl/XML-Simple-2.18 + >=perl-core/version-0.76 + >=dev-perl/Carp-Clan-5.9 + >=dev-perl/Readonly-1.03 + >=dev-perl/Carp-Assert-0.20 + >=dev-perl/Class-Virtual-0.06 + >=dev-perl/File-Slurp-9999.13 + >=dev-perl/Exporter-Lite-0.02 + >=dev-perl/Tie-IxHash-1.21 + >=virtual/perl-Module-Pluggable-3.6 + >=dev-perl/Archive-Zip-1.23 + lame? ( media-sound/lame ) + alac? ( media-sound/alac_decoder ) + wavpack? ( media-sound/wavpack ) + bonjour? ( net-misc/mDNSResponder ) + flac? ( media-libs/flac ) + musepack? ( media-sound/musepack-tools ) + ogg? ( media-sound/sox ) + aac? ( media-libs/faad2 ) + " + +S="${WORKDIR}/${MY_P}" + +# Selected contents of SqueezeCenter's local CPAN collection that we include +# in the installation. This removes duplication of CPAN modules. (See Gentoo +# bug #251494). +CPANKEEP=" + Class/XSAccessor/Array.pm + POE/XS/Queue/Array.pm + + JSON/XS/VersionOneAndTwo.pm + Class/Accessor/ + Class/Accessor.pm + Class/C3.pm + Class/Data/Accessor.pm + Algorithm/C3.pm + Data/ + DBIx/ + File/BOM.pm + Net/UPnP/ + Net/UPnP.pm + POE/Queue/Array.pm + Proc/Background/ + Proc/Background.pm + Text/Unidecode/ + Text/Unidecode.pm + Tie/Cache/LRU/ + Tie/Cache/LRU.pm + Tie/LLHash.pm + Tie/RegexpHash.pm + URI/Find.pm + PAR/ + PAR.pm + enum.pm + " + +PREFS="/var/lib/squeezecenter/prefs/squeezecenter.prefs" +LIVE_PREFS="/var/lib/squeezecenter/prefs/server.prefs" +DOCDIR="/usr/share/doc/squeezecenter-${PV}" +SHAREDIR="/usr/share/squeezecenter" +LIBDIR="/usr/lib/squeezecenter" +DBUSER="squeezecenter" +OLDPLUGINSDIR=/opt/squeezecenter/Plugins +NEWPLUGINSDIR=/var/lib/squeezecenter/Plugins + +pkg_setup() { + # Sox has optional OGG support, so make sure it has been built that way + if use ogg; then + if ! built_with_use media-sound/sox ogg; then + eerror "media-sound/sox not built with USE=ogg" + die "media-sound/sox not built with USE=ogg" + fi + fi + + # Create the user and group if not already present + enewgroup squeezecenter + enewuser squeezecenter -1 -1 "/dev/null" squeezecenter +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Apply patches + epatch "${FILESDIR}/mDNSResponder-gentoo.patch" + epatch "${FILESDIR}/${P}-build-perl-modules-gentoo.patch" + epatch "${FILESDIR}/${P}-aac-transcode-gentoo.patch" + epatch "${FILESDIR}/${P}-json-xs-gentoo.patch" +} + +src_compile() { + einfo "Building required Perl modules (some warnings are normal here) ..." + echo -e "\n${S}\n${WORKDIR}" | Bin/build-perl-modules.pl || die "Unable to build Perl modules" +} + +src_install() { + + # The main Perl executables + exeinto /usr/sbin + newexe slimserver.pl squeezecenter-server + newexe scanner.pl squeezecenter-scanner + newexe cleanup.pl squeezecenter-cleanup + + # Get the Perl package name and version + eval `perl '-V:package'` + eval `perl '-V:version'` + + # The custom OS module for Gentoo - provides OS-specific path details + cp "${FILESDIR}/gentoo-filepaths.pm" "Slim/Utils/OS/Custom.pm" || die "Unable to install Gentoo custom OS module" + + # The server Perl modules + dodir "/usr/lib/${package}/vendor_perl/${version}" + cp -r Slim "${D}/usr/lib/${package}/vendor_perl/${version}" || die "Unable to install server Perl modules" + + # Compiled CPAN module go under lib as they are arch-specific + dodir "/usr/lib/squeezecenter/CPAN" + cp -r CPAN/arch "${D}/usr/lib/squeezecenter/CPAN" || die "Unable to install compiled CPAN modules" + + # Preseve some of the SqueezeCenter-packaged CPAN modules that Gentoo + # doesn't provide ebuilds for. + for ITEM in ${CPANKEEP}; do + dodir "/usr/lib/squeezecenter/CPAN/$(dirname ${ITEM})" + cp -r "CPAN/${ITEM}" "${D}/usr/lib/squeezecenter/CPAN/${ITEM}" || die "Unable to preserve CPAN item ${ITEM}" + done + + # Various directories of architecture-independent static files + dodir "${SHAREDIR}" + cp -r Firmware "${D}/${SHAREDIR}" || die "Unable to install firmware" + cp -r Graphics "${D}/${SHAREDIR}" || die "Unable to install Graphics" + cp -r HTML "${D}/${SHAREDIR}" || die "Unable to install HTML" + cp -r IR "${D}/${SHAREDIR}" || die "Unable to install IR" + cp -r SQL "${D}/${SHAREDIR}" || die "Unable to install SQL" + + # Architecture-dependent static files + dodir "${LIBDIR}" + cp -r lib/* "${D}/${LIBDIR}" || die "Unable to install architecture-dependent files" + + # Strings and version identification + insinto "${SHAREDIR}" + doins strings.txt + doins revision.txt + + # Documentation + dodoc Changelog*.html + dodoc Installation.txt + dodoc License*.txt + newdoc "${FILESDIR}/Gentoo-plugins-README.txt" Gentoo-plugins-README.txt + + # Configuration files + insinto /etc/squeezecenter + doins convert.conf + doins types.conf + doins modules.conf + + # Install init scripts + newconfd "${FILESDIR}/squeezecenter.conf.d" squeezecenter + newinitd "${FILESDIR}/squeezecenter.init.d" squeezecenter + + # Install default preferences + insinto /var/lib/squeezecenter/prefs + newins "${FILESDIR}/squeezecenter.prefs" squeezecenter.prefs + fowners squeezecenter:squeezecenter /var/lib/squeezecenter/prefs + fperms 770 /var/lib/squeezecenter/prefs + + # Install the SQL configuration scripts + insinto "${SHAREDIR}/SQL/mysql" + doins "${FILESDIR}/dbdrop-gentoo.sql" + doins "${FILESDIR}/dbcreate-gentoo.sql" + + # Initialize run directory (where the PID file lives) + dodir /var/run/squeezecenter + fowners squeezecenter:squeezecenter /var/run/squeezecenter + fperms 770 /var/run/squeezecenter + + # Initialize server cache directory + dodir /var/lib/squeezecenter/cache + fowners squeezecenter:squeezecenter /var/lib/squeezecenter/cache + fperms 770 /var/lib/squeezecenter/cache + + # Initialize the log directory + dodir /var/log/squeezecenter + fowners squeezecenter:squeezecenter /var/log/squeezecenter + fperms 770 /var/log/squeezecenter + touch "${D}/var/log/squeezecenter/server.log" + touch "${D}/var/log/squeezecenter/scanner.log" + touch "${D}/var/log/squeezecenter/perfmon.log" + fowners squeezecenter:squeezecenter /var/log/squeezecenter/server.log + fowners squeezecenter:squeezecenter /var/log/squeezecenter/scanner.log + fowners squeezecenter:squeezecenter /var/log/squeezecenter/perfmon.log + + # Initialise the user-installed plugins directory + dodir "${NEWPLUGINSDIR}" + + # Install logrotate support + insinto /etc/logrotate.d + newins "${FILESDIR}/squeezecenter.logrotate.d" squeezecenter + + # Install Avahi support (if USE flag is set) + if use avahi; then + insinto /etc/avahi/services + newins "${FILESDIR}/avahi-squeezecenter.service" squeezecenter.service + fi +} + +sc_starting_instr() { + elog "SqueezeCenter can be started with the following command:" + elog "\t/etc/init.d/squeezecenter start" + elog "" + elog "SqueezeCenter can be automatically started on each boot with the" + elog "following command:" + elog "\trc-update add squeezecenter default" + elog "" + elog "You might want to examine and modify the following configuration" + elog "file before starting SqueezeCenter:" + elog "\t/etc/conf.d/squeezecenter" + elog "" + + # Discover the port number from the preferences, but if it isn't there + # then report the standard one. + httpport=$(gawk '$1 == "httpport:" { print $2 }' "${ROOT}${LIVE_PREFS}" 2>/dev/null) + elog "You may access and configure SqueezeCenter by browsing to:" + elog "\thttp://localhost:${httpport:-9000}/" +} + +pkg_postinst() { + # FLAC and LAME are quite useful (but not essential) for SqueezeCenter - + # if they're not enabled then make sure the user understands that. + if ! use flac; then + ewarn "'flac' USE flag is not set. Although not essential, FLAC is required" + ewarn "for playing lossless WAV and FLAC (for Squeezebox 1), and for" + ewarn "playing other less common file types (if you have a Squeezebox 2, 3," + ewarn "Receiver or Transporter)." + ewarn "For maximum flexibility you are recommended to set the 'flac' USE flag". + ewarn "" + fi + if ! use lame; then + ewarn "'lame' USE flag is not set. Although not essential, LAME is" + ewarn "required if you want to limit the bandwidth your Squeezebox or" + ewarn "Transporter uses when streaming audio." + ewarn "For maximum flexibility you are recommended to set the 'lame' USE flag". + ewarn "" + fi + + # Album art requires PNG and JPEG support from GD, so if it's not there + # then warn the user. It's not mandatory as the user may not be using + # album art. + if ! built_with_use dev-perl/GD jpeg || \ + ! built_with_use dev-perl/GD png || \ + ! built_with_use media-libs/gd jpeg || \ + ! built_with_use media-libs/gd png; then + ewarn "For correct operation of album art through SqueezeCenter's web" + ewarn "interface the GD library and Perl module must be built with PNG" + ewarn "and JPEG support. If necessary you can add the following lines" + ewarn "to the file /etc/portage/package.use:" + ewarn "\tdev-perl/GD jpeg png" + ewarn "\tmedia-libs/gd jpeg png" + ewarn "And then rebuild those packages with:" + ewarn "\temerge --newuse dev-perl/GD media-libs/gd" + ewarn "" + fi + + # Point user to database configuration step + elog "If this is a new installation of SqueezeCenter then the database" + elog "must be configured prior to use. This can be done by running the" + elog "following command:" + elog "\temerge --config =${CATEGORY}/${PF}" + + # Remind user to configure Avahi if necessary + if use avahi; then + elog "" + elog "Avahi support installed. Remember to edit the folowing file if" + elog "you run SqueezeCenter's web interface on a port other than 9000:" + elog "\t/etc/avahi/services/squeezecenter.service" + fi + + elog "" + sc_starting_instr +} + +sc_remove_db_prefs() { + MY_PREFS=$1 + + einfo "Configuring SqueezeCenter database preferences (${MY_PREFS}) ..." + TMPPREFS="${T}"/squeezecenter-prefs-$$ + touch "${ROOT}${MY_PREFS}" + sed -e '/^dbusername:/d' -e '/^dbpassword:/d' -e '/^dbsource:/d' < "${ROOT}${MY_PREFS}" > "${TMPPREFS}" + mv "${TMPPREFS}" "${ROOT}${MY_PREFS}" + chown squeezecenter:squeezecenter "${ROOT}${MY_PREFS}" + chmod 660 "${ROOT}${MY_PREFS}" +} + +sc_update_prefs() { + MY_PREFS=$1 + MY_DBUSER=$2 + MY_DBUSER_PASSWD=$3 + + echo "dbusername: ${MY_DBUSER}" >> "${ROOT}${MY_PREFS}" + echo "dbpassword: ${MY_DBUSER_PASSWD}" >> "${ROOT}${MY_PREFS}" + echo "dbsource: dbi:mysql:database=${MY_DBUSER};mysql_socket=/var/run/mysqld/mysqld.sock" >> "${ROOT}${MY_PREFS}" +} + +pkg_config() { + einfo "Press ENTER to create the SqueezeCenter database and set proper" + einfo "permissions on it. You will be prompted for the MySQL 'root' user's" + einfo "password during this process (note that the MySQL 'root' user is" + einfo "independent of the Linux 'root' user and so may have a different" + einfo "password)." + einfo "" + einfo "If you already have a SqueezeCenter database set up then this" + einfo "process will clear the existing database (your music files will not," + einfo "however, be affected)." + einfo "" + einfo "Alternatively, press Control-C to abort now..." + read + + # Get the MySQL root password from the user (not echoed to the terminal) + einfo "The MySQL 'root' user password is required to create the" + einfo "SqueezeCenter user and database." + DONE=0 + while [ $DONE -eq 0 ]; do + trap "stty echo; echo" EXIT + stty -echo + read -p "MySQL root password: " ROOT_PASSWD; echo + stty echo + trap ":" EXIT + echo quit | mysql --user=root --password="${ROOT_PASSWD}" >/dev/null 2>&1 && DONE=1 + if [ $DONE -eq 0 ]; then + eerror "Incorrect MySQL root password, or MySQL is not running" + fi + done + + # Get the new password for the SqueezeCenter MySQL database user, and + # have it re-entered to confirm it. We should trivially check it's not + # the same as the MySQL root password. + einfo "A new MySQL user will be added to own the SqueezeCenter database." + einfo "Please enter the password for this new user (${DBUSER})." + DONE=0 + while [ $DONE -eq 0 ]; do + trap "stty echo; echo" EXIT + stty -echo + read -p "MySQL ${DBUSER} password: " DBUSER_PASSWD; echo + stty echo + trap ":" EXIT + if [ -z "$DBUSER_PASSWD" ]; then + eerror "The password should not be blank; try again." + elif [ "$DBUSER_PASSWD" == "$ROOT_PASSWD" ]; then + eerror "The ${DBUSER} password should be different to the root password" + else + DONE=1 + fi + done + + # Drop the existing database and user - note we don't care about errors + # from this as it probably just indicates that the database wasn't + # yet present. + einfo "Dropping old SqueezeCenter database and user ..." + sed -e "s/__DATABASE__/${DBUSER}/" -e "s/__DBUSER__/${DBUSER}/" < "${SHAREDIR}/SQL/mysql/dbdrop-gentoo.sql" | mysql --user=root --password="${ROOT_PASSWD}" >/dev/null 2>&1 + + # Drop and create the SqueezeCenter user and database. + einfo "Creating SqueezeCenter MySQL user and database (${DBUSER}) ..." + sed -e "s/__DATABASE__/${DBUSER}/" -e "s/__DBUSER__/${DBUSER}/" -e "s/__DBPASSWORD__/${DBUSER_PASSWD}/" < "${SHAREDIR}/SQL/mysql/dbcreate-gentoo.sql" | mysql --user=root --password="${ROOT_PASSWD}" || die "Unable to create MySQL database and user" + + # Remove the existing MySQL preferences from SqueezeCenter (if any). + sc_remove_db_prefs "${PREFS}" + [ -f "${LIVE_PREFS}" ] && sc_remove_db_prefs ${LIVE_PREFS} + + # Insert the external MySQL configuration into the preferences. + sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" + [ -f "${LIVE_PREFS}" ] && sc_update_prefs "${LIVE_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" + + # Phew - all done. Give some tips on what to do now. + einfo "Database configuration complete." + einfo "" + sc_starting_instr +} + +pkg_preinst() { + # Warn the user if there are old plugins that he may need to migrate + if [ -d "${OLDPLUGINSDIR}" ]; then + if [ ! -z "$(ls ${OLDPLUGINSDIR})" ]; then + ewarn "Note: It appears that plugins are installed in the old location of:" + ewarn "${OLDPLUGINSDIR}" + ewarn "If these are to be used then they must be migrated to the new location:" + ewarn "${NEWPLUGINSDIR}" + ewarn "" + fi + fi +} |