diff options
author | Joe Peterson <lavajoe@gentoo.org> | 2008-05-26 00:18:37 +0000 |
---|---|---|
committer | Joe Peterson <lavajoe@gentoo.org> | 2008-05-26 00:18:37 +0000 |
commit | 7368de7f3e1b7cec018b5205aa2f0f377bec79f9 (patch) | |
tree | 1884a88a35e24ff356d91f33a2ddd53d56e5f573 /media-sound/squeezecenter | |
parent | sec-policy: bump selinux policy (diff) | |
download | historical-7368de7f3e1b7cec018b5205aa2f0f377bec79f9.tar.gz historical-7368de7f3e1b7cec018b5205aa2f0f377bec79f9.tar.bz2 historical-7368de7f3e1b7cec018b5205aa2f0f377bec79f9.zip |
Add 7.0.2 beta nightly for 2008-05-24; introduce new file layout
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'media-sound/squeezecenter')
6 files changed, 627 insertions, 2 deletions
diff --git a/media-sound/squeezecenter/ChangeLog b/media-sound/squeezecenter/ChangeLog index da694763759c..805ca107063e 100644 --- a/media-sound/squeezecenter/ChangeLog +++ b/media-sound/squeezecenter/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for media-sound/squeezecenter # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v 1.16 2008/05/21 16:24:32 lavajoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v 1.17 2008/05/26 00:18:36 lavajoe Exp $ + +*squeezecenter-7.0.2_beta20080524 (26 May 2008) + + 26 May 2008; Joe Peterson <lavajoe@gentoo.org> + +files/Gentoo-plugins-7.0.2-README.txt, + +files/filepaths-7.0.2-gentoo.patch, +files/squeezecenter-7.0.2.init.d, + +squeezecenter-7.0.2_beta20080524.ebuild: + Add 7.0.2 beta nightly for 2008-05-24; introduce new file layout based on + the Gentoo file structure and using examples from squeezecenter on other + distros *squeezecenter-7.0.1 (21 May 2008) diff --git a/media-sound/squeezecenter/Manifest b/media-sound/squeezecenter/Manifest index 3ba39ac6a144..8fb214598365 100644 --- a/media-sound/squeezecenter/Manifest +++ b/media-sound/squeezecenter/Manifest @@ -1,7 +1,10 @@ +AUX Gentoo-plugins-7.0.2-README.txt 987 RMD160 cbdbf7e0dafa4affdfa3f065da90303faba990b5 SHA1 dacfca9ad45cc3c0550071f2f4a47af79c218ee4 SHA256 9c955110cc7890cd8d03eaf3bf5c4ca4dc3a42a3b7725fa325b6a2ee890a3707 AUX avahi-7.0-squeezecenter.service 326 RMD160 174b4a900bea817b3b1995449c1c0a0f3f96cacb SHA1 b84fa32fc82c84cb749d8aed2cc4f1367937a4bc SHA256 868102c1b4eb5e497e8a0f899c794023643018b66e8f3855b772908647b59b2d AUX dbcreate-7.0-gentoo.sql 165 RMD160 36fe87c398aee02890710f970245032488b857bb SHA1 e86a26c73addb4b74c345ec70155f2b9d079075b SHA256 d8cf85879e74dc1e429251f5bd4ae7f99e2a460fa668c0abde2c2725b90f10a1 AUX dbdrop-7.0-gentoo.sql 64 RMD160 bc60b46ea56642c28ffbd8731e120722e42b66a9 SHA1 a02eab2a62e67d81ff2ad3d3700cd7695f6d31c1 SHA256 0c8e1f3cddd54d6659a014dbcefa928f6d8b9174860cb07d53e01fe9940e8aba +AUX filepaths-7.0.2-gentoo.patch 5183 RMD160 80001d23df6d5f69fdd0df0aa88ee48a9f534ead SHA1 4384b956a28864a408904bd99d8ad556eaa724e7 SHA256 b5600e4b632e918b7506d99762951b6a60afefb6fa06ccd80383b1baee9ae828 AUX mDNSResponder-7.0-gentoo.patch 351 RMD160 4ea506094e6cc41a6bf7e3c88b32d3315650db3c SHA1 242f74c0f9c089ab557b70e833a91e6adf18a285 SHA256 31a439f64fa825ff7fda887f7a0dbccc1566cf6ba4e2379273cc4d967ca4886e +AUX squeezecenter-7.0.2.init.d 1314 RMD160 0589036fae6ef807563984673ef516150c4074e0 SHA1 20b2bbf62dda2deea24409aeed5d22d4a2886f61 SHA256 21bb48d50dc92a8be3bc74a6185114d99ef3ba2c4d594167b3d857ebfd534e2f AUX squeezecenter-7.0.conf.d 903 RMD160 e3ef773ec921e47ddb749c56ea0c87b32d4399d7 SHA1 f7aede39aca7f19772579caab9cc86f3b3769ff9 SHA256 bd64fd08949e8d1e56f9efc89a3fa141aa50ba851cedb9435be89c4b506c836a AUX squeezecenter-7.0.init.d 1294 RMD160 d62389c8deaea434c60c756d24744a4e983abfc6 SHA1 461c88b40634a4e3ed59a51ac1b92d40921a8c72 SHA256 9a5ba0c4bc38167fe0a8893f4447e1e3dac82465d27f6a1aaf65176ff03d35b6 AUX squeezecenter-7.0.logrotate.d 411 RMD160 6ebb2d8ffca4934f94819096c818c264b1333c2d SHA1 4d13464d59a0f56ab741ccbd135fcebb56f934ea SHA256 8462d5721f29c551bd68886e8a637d22b5e5b1d07b5c51b5390e10c13169a4a2 @@ -9,9 +12,11 @@ AUX squeezecenter-7.0.prefs 126 RMD160 b715267b10e2bc63eaa7da5aa9dd3177dc0e46ee DIST squeezecenter-7.0-noCPAN.tgz 18464419 RMD160 dfb51cde6250223610023907e570597ffde67ac2 SHA1 5e09017ae51a9a0229a117fc97145ead8213436f SHA256 78bbb0c0e296b1d19dee1f5c9d88f996f7cd43808f8798f2baded6dd2c334df7 DIST squeezecenter-7.0.1-19294-noCPAN.tgz 18522421 RMD160 0369e2f67854415879dd0486fc8e543e19692c52 SHA1 2bfd71a0f2a5b20ebeb2a167cd7ca15db5122c2c SHA256 72fc369ebc968be5a9f76d1767eb6d4b6e60f0bf20c53c32cfd40be20c39fbaf DIST squeezecenter-7.0.1-noCPAN.tgz 18552404 RMD160 30aa13ba0bb193cedc9b8e91f30bf065c70f0632 SHA1 05957d6354b466154a549c2ce0c237a3e783fe9d SHA256 c4e81549a7e3b46930d9db6ddd95a1bd3e96bd2c5b661352698382802360e798 +DIST squeezecenter-7.0.2-20137-noCPAN.tgz 18537012 RMD160 373fe29d7e9dca4a55c836ebe0aa5f719823124b SHA1 daf0deeb0f75f3a3ec063fd08dd07ddd8342da17 SHA256 f6cb5c577c8df27eee489c02b713beea4d32454099bb045920e1bdede129e1e4 EBUILD squeezecenter-7.0-r1.ebuild 11478 RMD160 c9ffa0569f01c22093b63b3a3ca997e3311faf29 SHA1 8357d9ad2bcd9ec32562835639efaf0926517bf4 SHA256 025c75e808250af17e0cb650ea15c800f5d446d8cd6ebb044176548f3c7fcf71 EBUILD squeezecenter-7.0.1.ebuild 11509 RMD160 674353d857021e75676ff78588306f59f2fe596b SHA1 102dae63dba1b2cbbc5c3c776e30408ba277e93c SHA256 d09d3f7c8d3be7e2ef53f736b89a2f747c920dfe2db7bf6941d7215bd3ffd78a EBUILD squeezecenter-7.0.1_beta20080501.ebuild 11508 RMD160 9930b271c37d3fe79198f5621336ac603cdfb54d SHA1 e437a0f06b67f5fa31ba8de4d357c165d84c2fad SHA256 29d3a925f98caa62612c298ac2435008b74a3884ca8deb2c23126313e3638d66 +EBUILD squeezecenter-7.0.2_beta20080524.ebuild 12909 RMD160 25135a09e98950d1fbd9e7ed85182c7bdb1b7fda SHA1 bb731f9afe4dc084453d0e65dfa6c8dcd22f50e7 SHA256 df5fddfa55808a6b3724d10fd3b5e772ef1d51f63b684886cec052f8cb2e6ec7 EBUILD squeezecenter-7.0.ebuild 11579 RMD160 8ffb5dda92413cd2a6466283afcd6792a31c77d9 SHA1 17c63b5ae4dfc28a5c024ec2caf45aeeb5f6df5b SHA256 23f32bf95a46d4f3fbb919bc4b43a76f4719f3424f9bb502fcbf21f486d34fd4 -MISC ChangeLog 3134 RMD160 daedb7c504f76ab354ba44685c564182a4fc5eb6 SHA1 8cdffa6558e337966f512b1826bb8ad4b1e2bffc SHA256 0fa1c220e95b362f3f7c2e10cf18af2d2f6a445053855f5ff8b6531a3c9fb5f1 +MISC ChangeLog 3554 RMD160 47e5291e74f5b61fdddc63f835799c47c6896e19 SHA1 44578202eb46b6d27b250cb07ec5c30a44f12cab SHA256 4ffff696963ab4458468f5c27933cd27a788ade4cfd9b98c99b7886a34095c97 MISC metadata.xml 790 RMD160 c75ebb0eda5fdc93127d453d975acebc50bec589 SHA1 e9cd926018accadcd17691d24ae22ca2620e0c30 SHA256 d886ca6099eb5d1a95fa1f5cb833b91eac229c5c1df478f73e52f6d3b1a5e135 diff --git a/media-sound/squeezecenter/files/Gentoo-plugins-7.0.2-README.txt b/media-sound/squeezecenter/files/Gentoo-plugins-7.0.2-README.txt new file mode 100644 index 000000000000..dd14cc682cdd --- /dev/null +++ b/media-sound/squeezecenter/files/Gentoo-plugins-7.0.2-README.txt @@ -0,0 +1,25 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/files/Gentoo-plugins-7.0.2-README.txt,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ + +The standard SqueezeCenter package is installed differently on Gentoo in order +that the installation complies with Gentoo's filesystem layout. These notes +are provided to give guidance for installing plugins within this modified +layout. + +INSTALLING PLUGINS + +The installation instructions of plugins should be followed but with the +following Gentoo specifics: + +* Plugins should be installed into the directory: + /var/lib/squeezecenter/Plugins +* Extension binaries (which sometimes accompany plugins) should be installed + into the directory: + /usr/lib/squeezecenter/Bin + +BACKGROUND + +Those interested can refer to the following for details of Gentoo's filesystem +standard: +http://devmanual.gentoo.org/general-concepts/filesystem/index.html diff --git a/media-sound/squeezecenter/files/filepaths-7.0.2-gentoo.patch b/media-sound/squeezecenter/files/filepaths-7.0.2-gentoo.patch new file mode 100644 index 000000000000..5d529afb8a13 --- /dev/null +++ b/media-sound/squeezecenter/files/filepaths-7.0.2-gentoo.patch @@ -0,0 +1,176 @@ +--- Slim/Utils/OSDetect.pm.old 2008-05-23 18:55:39.000000000 +0100 ++++ Slim/Utils/OSDetect.pm 2008-05-25 20:21:54.000000000 +0100 +@@ -1,6 +1,6 @@ + package Slim::Utils::OSDetect; + +-# $Id: filepaths-7.0.2-gentoo.patch,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ ++# $Id: filepaths-7.0.2-gentoo.patch,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ + + # SqueezeCenter Copyright 2001-2007 Logitech. + # This program is free software; you can redistribute it and/or +@@ -248,6 +248,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()) { + +@@ -432,6 +484,19 @@ + return isReadyNAS(); + } + ++sub isGentoo { ++ ++ # Initialize ++ my $OS = OS(); ++ my $details = details(); ++ ++ if ($details->{'osName'} eq 'Gentoo') { ++ return 1; ++ } ++ ++ return 0; ++} ++ + sub isRHorSUSE { + + # Initialize +@@ -553,6 +618,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'; +@@ -570,7 +639,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-05-23 21:57:18.000000000 +0100 ++++ Slim/Music/Import.pm 2008-05-23 21:57:59.000000000 +0100 +@@ -139,7 +139,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-05-23 21:23:18.000000000 +0100 ++++ Slim/bootstrap.pm 2008-05-24 17:01:16.000000000 +0100 +@@ -1,6 +1,6 @@ + package Slim::bootstrap; + +-# $Id: filepaths-7.0.2-gentoo.patch,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ ++# $Id: filepaths-7.0.2-gentoo.patch,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ + # + # SqueezeCenter Copyright 2001-2007 Logitech. + # This program is free software; you can redistribute it and/or +@@ -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-05-24 13:21:24.000000000 +0100 ++++ Slim/Utils/MySQLHelper.pm 2008-05-24 17:01:16.000000000 +0100 +@@ -1,6 +1,6 @@ + package Slim::Utils::MySQLHelper; + +-# $Id: filepaths-7.0.2-gentoo.patch,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ ++# $Id: filepaths-7.0.2-gentoo.patch,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ + + =head1 NAME + +@@ -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'; + } diff --git a/media-sound/squeezecenter/files/squeezecenter-7.0.2.init.d b/media-sound/squeezecenter/files/squeezecenter-7.0.2.init.d new file mode 100755 index 000000000000..e81616e9e183 --- /dev/null +++ b/media-sound/squeezecenter/files/squeezecenter-7.0.2.init.d @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/files/squeezecenter-7.0.2.init.d,v 1.1 2008/05/26 00:18:37 lavajoe Exp $ + +# These fit the SqueezeCenter ebuild and so shouldn't need to be changed; +# user-servicable parts go in /etc/conf.d/squeezecenter. +pidfile=/var/run/squeezecenter/squeezecenter.pid +logdir=/var/log/squeezecenter +varlibdir=/var/lib/squeezecenter +prefsdir=${varlibdir}/prefs +cachedir=${varlibdir}/cache +prefsfile=${prefsdir}/squeezecenter.prefs +scuser=squeezecenter + +depend() { + need net mysql +} + +start() { + ebegin "Starting SqueezeCenter" + + cd / + /usr/bin/nice --adjustment=${SC_NICENESS:-0} sudo -u ${scuser} \ + start-stop-daemon \ + --start --quiet \ + --name slimserver.pl \ + --exec /usr/sbin/squeezecenter-server -- \ + --quiet --daemon \ + --pidfile=${pidfile} \ + --cachedir=${cachedir} \ + --prefsfile=${prefsfile} \ + --prefsdir=${prefsdir} \ + --logdir=${logdir} \ + --audiodir=${SC_MUSIC_DIR} \ + --playlistdir=${SC_PLAYLISTS_DIR} \ + ${SC_OPTS} + + eend $? "Failed to start SqueezeCenter" +} + +stop() { + ebegin "Stopping SqueezeCenter" + start-stop-daemon -o --stop --quiet --pidfile ${pidfile} + eend $? "Failed to stop SqueezeCenter" +} diff --git a/media-sound/squeezecenter/squeezecenter-7.0.2_beta20080524.ebuild b/media-sound/squeezecenter/squeezecenter-7.0.2_beta20080524.ebuild new file mode 100644 index 000000000000..78d0cc59534c --- /dev/null +++ b/media-sound/squeezecenter/squeezecenter-7.0.2_beta20080524.ebuild @@ -0,0 +1,363 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/squeezecenter-7.0.2_beta20080524.ebuild,v 1.1 2008/05/26 00:18:36 lavajoe Exp $ + +inherit eutils + +SVN_VER="20137" +MAJOR_VER="${PV:0:3}" +MINOR_VER="${PV:4:1}" +SRC_DIR="SqueezeCenter_7.0_v${PV:10:4}-${PV:14:2}-${PV:16:2}" +MY_P="squeezecenter-${MAJOR_VER}.${MINOR_VER}-${SVN_VER}-noCPAN" + +DESCRIPTION="Logitech SqueezeCenter music server" +HOMEPAGE="http://www.slimdevices.com/pi_features.html" +SRC_URI="http://www.slimdevices.com/downloads/nightly/${SRC_DIR}/${MY_P}.tgz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="lame wavpack musepack alac ogg bonjour flac avahi" + +# 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 + dev-perl/module-build + virtual/logger + virtual/mysql + avahi? ( net-dns/avahi ) + ogg? ( media-sound/sox ) + " +# 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 + >=dev-perl/GD-2.35 + >=app-admin/sudo-1.6.8 + alac? ( media-sound/alac_decoder ) + lame? ( media-sound/lame ) + wavpack? ( media-sound/wavpack ) + bonjour? ( net-misc/mDNSResponder ) + flac? ( media-libs/flac ) + musepack? ( media-sound/musepack-tools ) + " + +S="${WORKDIR}/${MY_P}" + +PREFS="/var/lib/squeezecenter/prefs/squeezecenter.prefs" +LIVE_PREFS="/var/lib/squeezecenter/prefs/server.prefs" +DOCDIR="/usr/share/doc/squeezecenter-${MAJOR_VER}.${MINOR_VER}" +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 || die + enewuser squeezecenter -1 -1 "/dev/null" squeezecenter || die +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Apply patches + epatch "${FILESDIR}/mDNSResponder-${MAJOR_VER}-gentoo.patch" + epatch "${FILESDIR}/filepaths-${MAJOR_VER}.${MINOR_VER}-gentoo.patch" +} + +src_compile() { + einfo "Building required Perl modules (some warnings are normal here) ..." + mkdir "${T}/sc_compile" + echo -e "\n${S}\n${T}/sc_compile" | 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 + + # Get the Perl package name and version + eval `perl '-V:package'` + eval `perl '-V:version'` + + # The server Perl modules + dodir "/usr/lib/${package}/vendor_perl/${version}" + cp -r Slim "${D}/usr/lib/${package}/vendor_perl/${version}" + + # Various directories of architecture-independent static files + dodir "${SHAREDIR}" + cp -r Firmware "${D}/${SHAREDIR}" + cp -r Graphics "${D}/${SHAREDIR}" + cp -r HTML "${D}/${SHAREDIR}" + cp -r IR "${D}/${SHAREDIR}" + cp -r SQL "${D}/${SHAREDIR}" + cp -r CPAN "${D}/${SHAREDIR}" + + # Architecture-dependent static files + dodir "${LIBDIR}" + cp -r lib/* "${D}/${LIBDIR}" + + # 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-7.0.2-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-${MAJOR_VER}.conf.d" squeezecenter + newinitd "${FILESDIR}/squeezecenter-${MAJOR_VER}.${MINOR_VER}.init.d" squeezecenter + + # Install default preferences + insinto /var/lib/squeezecenter/prefs + newins "${FILESDIR}/squeezecenter-${MAJOR_VER}.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-${MAJOR_VER}-gentoo.sql" + doins "${FILESDIR}/dbcreate-${MAJOR_VER}-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-${MAJOR_VER}.logrotate.d" squeezecenter + + # Install Avahi support (if USE flag is set) + if use avahi; then + insinto /etc/avahi/services + newins "${FILESDIR}/avahi-${MAJOR_VER}-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-${MAJOR_VER}-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-${MAJOR_VER}-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 +} |