summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Peterson <lavajoe@gentoo.org>2008-09-20 15:37:15 +0000
committerJoe Peterson <lavajoe@gentoo.org>2008-09-20 15:37:15 +0000
commit0878680fec4eac8258d6ca0ac1e3cf373b288acb (patch)
treeb8ef0f58b44f05dbdd12cfcb91c2edda4c0343f9
parentstable amd64, bug 238185 (diff)
downloadhistorical-0878680fec4eac8258d6ca0ac1e3cf373b288acb.tar.gz
historical-0878680fec4eac8258d6ca0ac1e3cf373b288acb.tar.bz2
historical-0878680fec4eac8258d6ca0ac1e3cf373b288acb.zip
Remove old versions
Package-Manager: portage-2.2_rc8/cvs/Linux 2.6.26-gentoo-r1 i686
-rw-r--r--media-sound/squeezecenter/ChangeLog6
-rw-r--r--media-sound/squeezecenter/Manifest14
-rw-r--r--media-sound/squeezecenter/squeezecenter-7.1.0.ebuild362
-rw-r--r--media-sound/squeezecenter/squeezecenter-7.2.0.ebuild362
4 files changed, 6 insertions, 738 deletions
diff --git a/media-sound/squeezecenter/ChangeLog b/media-sound/squeezecenter/ChangeLog
index 68022d9d880e..9ea95e5d072d 100644
--- a/media-sound/squeezecenter/ChangeLog
+++ b/media-sound/squeezecenter/ChangeLog
@@ -1,6 +1,10 @@
# 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.26 2008/09/20 13:06:46 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v 1.27 2008/09/20 15:37:15 lavajoe Exp $
+
+ 20 Sep 2008; Joe Peterson <lavajoe@gentoo.org>
+ -squeezecenter-7.1.0.ebuild, -squeezecenter-7.2.0.ebuild:
+ Remove old versions
20 Sep 2008; Markus Meier <maekke@gentoo.org>
squeezecenter-7.1.0-r1.ebuild:
diff --git a/media-sound/squeezecenter/Manifest b/media-sound/squeezecenter/Manifest
index b029b54494b4..b314ff9dd03c 100644
--- a/media-sound/squeezecenter/Manifest
+++ b/media-sound/squeezecenter/Manifest
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX Gentoo-plugins-README.txt 981 RMD160 d5efb4a5d704ff6b4c3de49b7143cbb9bc132445 SHA1 c3aedb74c3f5b7a54a3bad278750ed1632241e1d SHA256 6f84ab8159022447d3f434afb6403947ae9514fec55f33c9e74257ff75735428
AUX avahi-squeezecenter.service 326 RMD160 174b4a900bea817b3b1995449c1c0a0f3f96cacb SHA1 b84fa32fc82c84cb749d8aed2cc4f1367937a4bc SHA256 868102c1b4eb5e497e8a0f899c794023643018b66e8f3855b772908647b59b2d
AUX dbcreate-gentoo.sql 165 RMD160 36fe87c398aee02890710f970245032488b857bb SHA1 e86a26c73addb4b74c345ec70155f2b9d079075b SHA256 d8cf85879e74dc1e429251f5bd4ae7f99e2a460fa668c0abde2c2725b90f10a1
@@ -16,15 +13,6 @@ AUX squeezecenter.prefs 126 RMD160 b715267b10e2bc63eaa7da5aa9dd3177dc0e46ee SHA1
DIST squeezecenter-7.1-noCPAN.tgz 18785895 RMD160 6826dcdb906f343c5221ab8ff55ac3fe560fd4cc SHA1 6e51608286c238970a4facb26fc1acb3adb6ed07 SHA256 6229d6c96f290ab360351ea993733b2bb6bba352ca97e62d40d1b1f802f0afa8
DIST squeezecenter-7.2-noCPAN.tgz 22652662 RMD160 e7fdafdb0a91dcde7df403e458bba63f50692122 SHA1 e4b5d2bcb4cbeeb033710a380d121a4927e025f9 SHA256 306c68e427b4ee88babea353b6d00491dceb1d48f8db3c4bbeecd38342fe663c
EBUILD squeezecenter-7.1.0-r1.ebuild 13053 RMD160 d35c5cd93efff0d3c58995acdd1fedcd246a5a8b SHA1 deaebcba8c0bc867e5e73469348d24774d8a56ad SHA256 7598cdb9f9e76a3f66bbc168cd50447ee2bd3d7a40fbcdf8b250582a561d8de7
-EBUILD squeezecenter-7.1.0.ebuild 12674 RMD160 001546a8aa26df6b09eb435eeb6ba3a7091845e5 SHA1 ea4612604eb95b6c31c59b6b88ff7026d4fe52f5 SHA256 f1709c6749d4c5785743d8b66c560e2d074977c93251ed86fe9cc753bd7a3b97
EBUILD squeezecenter-7.2.0-r1.ebuild 13030 RMD160 bd5795cbb4571d3f254749f5c47e1833b2522793 SHA1 bafba5edd8203ea017b960a6a3beebb5724ace02 SHA256 9315390f38a6e6c8dd5472e1004de330fb6c8504dd0fcd4a1f264eab98b77bde
-EBUILD squeezecenter-7.2.0.ebuild 12648 RMD160 727b0e1e55a99313a7a9848ba06fbe62e3ee08f8 SHA1 00b4abe79cd506aac6c7274515223fd5cbe58121 SHA256 3fd4a3dfc9b96a4514d161d497104cd36b8c83463157f710d98a0927b9070c3e
-MISC ChangeLog 5979 RMD160 083aac2cd5b6a368268e55a061c8a3bb06237a94 SHA1 09e3ba5d83ab8b34bcc64ec8b0e6546d7d5ff1ab SHA256 c53539cb8d0f1de6094ae97f3c9e78a77899b404076e119fa0866a4663e0ad1a
+MISC ChangeLog 6112 RMD160 785ad4cb240bef4860af50b645414eef36bc516f SHA1 2584fd8d978c9c99431693ee8cb2efd4c6fb88be SHA256 4334acff3304ebfecee3980ecb7a2b761e81b89fb46ac3d5ec0688da79ca1434
MISC metadata.xml 1030 RMD160 e1d4c5948b583040d153fb5c504855d018d64930 SHA1 533aa2ee17648b8b6beaf0c63cf897ffff97a40d SHA256 8796af3188ab311eb971bdefe726ef47e9d7d39dab6956e22ab51acbc90a77c9
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.9 (GNU/Linux)
-
-iEYEARECAAYFAkjU9bYACgkQkKaRLQcq0GK/fACgq8rnYxZpqR7+Y7qLHrYcUr7t
-5wUAn0BuRuHVCy03Wuni+8yskjsDz+Pg
-=QvoZ
------END PGP SIGNATURE-----
diff --git a/media-sound/squeezecenter/squeezecenter-7.1.0.ebuild b/media-sound/squeezecenter/squeezecenter-7.1.0.ebuild
deleted file mode 100644
index aef9e302b845..000000000000
--- a/media-sound/squeezecenter/squeezecenter-7.1.0.ebuild
+++ /dev/null
@@ -1,362 +0,0 @@
-# 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.1.0.ebuild,v 1.2 2008/09/10 20:02:16 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}-noCPAN"
-
-DESCRIPTION="Logitech SqueezeCenter music server"
-HOMEPAGE="http://www.slimdevices.com/pi_features.html"
-SRC_URI="http://www.slimdevices.com/downloads/${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
- enewuser squeezecenter -1 -1 "/dev/null" squeezecenter
-}
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
-
- # Apply patches
- epatch "${FILESDIR}/mDNSResponder-${MAJOR_VER}-gentoo.patch"
- epatch "${FILESDIR}/filepaths-${MAJOR_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-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
-}
diff --git a/media-sound/squeezecenter/squeezecenter-7.2.0.ebuild b/media-sound/squeezecenter/squeezecenter-7.2.0.ebuild
deleted file mode 100644
index 08c41ffda362..000000000000
--- a/media-sound/squeezecenter/squeezecenter-7.2.0.ebuild
+++ /dev/null
@@ -1,362 +0,0 @@
-# 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.2.0.ebuild,v 1.2 2008/09/10 19:55:53 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}-noCPAN"
-
-DESCRIPTION="Logitech SqueezeCenter music server"
-HOMEPAGE="http://www.slimdevices.com/pi_features.html"
-SRC_URI="http://www.slimdevices.com/downloads/${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
- enewuser squeezecenter -1 -1 "/dev/null" squeezecenter
-}
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
-
- # Apply patches
- epatch "${FILESDIR}/mDNSResponder-gentoo.patch"
- epatch "${FILESDIR}/filepaths-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-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
-}