diff options
author | Joe Peterson <lavajoe@gentoo.org> | 2008-05-01 12:39:48 +0000 |
---|---|---|
committer | Joe Peterson <lavajoe@gentoo.org> | 2008-05-01 12:39:48 +0000 |
commit | fb3f83d1a48ecc870374c6d6bb0f5e2088912f65 (patch) | |
tree | 26e812c80d38bd0e7f2513e0a5ce9f9d460e87d6 /media-sound | |
parent | version bump (diff) | |
download | historical-fb3f83d1a48ecc870374c6d6bb0f5e2088912f65.tar.gz historical-fb3f83d1a48ecc870374c6d6bb0f5e2088912f65.tar.bz2 historical-fb3f83d1a48ecc870374c6d6bb0f5e2088912f65.zip |
Remove 7.0 betas
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'media-sound')
5 files changed, 0 insertions, 1244 deletions
diff --git a/media-sound/squeezecenter/Manifest b/media-sound/squeezecenter/Manifest index 313e4f57bd09..ad20952f8d7d 100644 --- a/media-sound/squeezecenter/Manifest +++ b/media-sound/squeezecenter/Manifest @@ -6,16 +6,8 @@ AUX squeezecenter-7.0.conf.d 903 RMD160 e3ef773ec921e47ddb749c56ea0c87b32d4399d7 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 AUX squeezecenter-7.0.prefs 126 RMD160 b715267b10e2bc63eaa7da5aa9dd3177dc0e46ee SHA1 3354ce16a5dd453d71c475a8487b43fec34084c2 SHA256 19c74a3838f78c6a076220e749c236564d085c4ef095fa0f77bbb1be74532b2d -DIST squeezecenter-7.0-17126-noCPAN.tgz 18427888 RMD160 e1359825b540e3dddbac6a15d882e35541bec68c SHA1 3b80831a940879e60de28ccebc24bf12e048c1e7 SHA256 45954c769564018b4937c113880db3818ec2465717a5bbe22002ffd42846ae6d -DIST squeezecenter-7.0-17379-noCPAN.tgz 18460808 RMD160 6099c7da31137eb53126bb98c462b8a108fb0066 SHA1 85f7b4551c07b5dac369bad766af878a125980c0 SHA256 8b54b125703f517075df2d31297b23c26c603b17eec8f17b44d723d40aa33812 -DIST squeezecenter-7.0-17600-noCPAN.tgz 18462171 RMD160 d1c9eb9cd340f6f8f02ecb65c198d2301cf70d95 SHA1 b4fc8f6e634f231b4adc709d424f5437a18fea09 SHA256 0826ac1a6ad09adcac03f5921045124fc55a732fa8afc83420afc86f3189890e -DIST squeezecenter-7.0-17707-noCPAN.tgz 18463160 RMD160 5b2b4ab367504bf724d03bfaa150bd8eacf3cda5 SHA1 7c1017417b783faa67a6a5286d37bf96437ff620 SHA256 830b86204965cb7ffe7c9c59f69256d91d1016479820366a7641c25592df08cd DIST squeezecenter-7.0-noCPAN.tgz 18464419 RMD160 dfb51cde6250223610023907e570597ffde67ac2 SHA1 5e09017ae51a9a0229a117fc97145ead8213436f SHA256 78bbb0c0e296b1d19dee1f5c9d88f996f7cd43808f8798f2baded6dd2c334df7 EBUILD squeezecenter-7.0-r1.ebuild 11583 RMD160 e127874e5c9c21ec6743fb2ece61914aed00949b SHA1 5918a38b7374a41cef9beec13f31b3cc3938104b SHA256 d320f958424910197d01056148a94e0fb1b650bf1249da021994f2d2e1f700ed EBUILD squeezecenter-7.0.ebuild 11579 RMD160 8ffb5dda92413cd2a6466283afcd6792a31c77d9 SHA1 17c63b5ae4dfc28a5c024ec2caf45aeeb5f6df5b SHA256 23f32bf95a46d4f3fbb919bc4b43a76f4719f3424f9bb502fcbf21f486d34fd4 -EBUILD squeezecenter-7.0_beta20080203.ebuild 11461 RMD160 c36937b0745aa6a1a9de710c41a11789d69b867d SHA1 70095eed48e0efe032d1ae89e0be999f69bcf101 SHA256 3e14aa3211aaabb3bface62453ba22d6a0e72d6c73209823f2ee889f9d890442 -EBUILD squeezecenter-7.0_beta20080210.ebuild 11461 RMD160 b61585021619704f9e20f7dd341313babcdc0938 SHA1 fd4c0159d08ce655df9ddabfe08352c80d99a012 SHA256 c745fba7cf04379ceaf55effa3c954b0960dbb24cc585a9fb12b5d012b7ac85b -EBUILD squeezecenter-7.0_beta20080217.ebuild 11471 RMD160 c70b178d0e65d442057ef9bdc48c0742b6bd9ba8 SHA1 526eb15697137052dcfcb62d66a605a610573e01 SHA256 752f76568d31ee02dd19173a13c221e2a94ea0412e4e359f673221b97860e26e -EBUILD squeezecenter-7.0_beta20080224.ebuild 11471 RMD160 6d2ba2ea46dde4861f9f96ca06fa2c2872bb5817 SHA1 d657b015d3bc7544147c53def63fd396c32f1b70 SHA256 b147682e4ddcdf3fe29ccd8983ca6f7144a7ebf1c8d460beb435f0ece73bf08a MISC ChangeLog 2810 RMD160 e8bf50876a2fd66a049fb606980e8d2a5f7d59e3 SHA1 d445a0f989b03ac9996769fbc8a337443158f9ec SHA256 a5b38bc85113d30fe274531de20b8be56ad93ae47c7d748078f3bec72e2a6ec7 MISC metadata.xml 790 RMD160 c75ebb0eda5fdc93127d453d975acebc50bec589 SHA1 e9cd926018accadcd17691d24ae22ca2620e0c30 SHA256 d886ca6099eb5d1a95fa1f5cb833b91eac229c5c1df478f73e52f6d3b1a5e135 diff --git a/media-sound/squeezecenter/squeezecenter-7.0_beta20080203.ebuild b/media-sound/squeezecenter/squeezecenter-7.0_beta20080203.ebuild deleted file mode 100644 index f6339a97921e..000000000000 --- a/media-sound/squeezecenter/squeezecenter-7.0_beta20080203.ebuild +++ /dev/null @@ -1,309 +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.0_beta20080203.ebuild,v 1.1 2008/02/03 21:38:16 lavajoe Exp $ - -inherit eutils - -SVN_VER="17126" -MAJOR_VER="${PV:0:3}" -MY_SRC_DIR="SqueezeCenter_${MAJOR_VER}_v${PV:8:4}-${PV:12:2}-${PV:14:2}" -MY_P="squeezecenter-${MAJOR_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/${MY_SRC_DIR}/${MY_P}.tgz" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~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}" - -INSTROOT="/opt" -PREFS="/etc/squeezecenter.prefs" -CACHED_PREFS="/var/cache/squeezecenter/prefs/server.prefs" -DBUSER="squeezecenter" - -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 "${INSTROOT}/squeezecenter" squeezecenter || die -} - -src_unpack() { - unpack ${A} - cd "${S}" - - # Apply patches - epatch "${FILESDIR}/mDNSResponder-${MAJOR_VER}-gentoo.patch" - - # Remove bundled binaries that are supplied by other ebuilds - einfo "Removing binaries provided by other ebuilds ..." - rm "${S}"/Bin/*/mDNSResponderPosix || die # net-misc/mDNSResponder - rm "${S}"/Bin/*/alac || die # media-sound/alac_decoder - rm "${S}"/Bin/*/flac || die # media-libs/flac - rm "${S}"/Bin/*/sox || die # media-sound/sox - rm "${S}"/Bin/*/wvunpack || die # media-sound/wavpack - rm "${S}"/Bin/*/mppdec || die # media-sound/musepack-tools - - # Remove bundled MySQL as we depend on an external instance - einfo "Removing bundled MySQL ..." - rm -r "${S}"/MySQL || die - rm "${S}"/Bin/*/mysqld || die # virtual/mysql -} - -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() { - # Copy all files. - dodir "${INSTROOT}/squeezecenter" - cp -r * "${D}/${INSTROOT}/squeezecenter" - - # Install init scripts. - newconfd "${FILESDIR}/squeezecenter-${MAJOR_VER}.conf.d" squeezecenter - newinitd "${FILESDIR}/squeezecenter-${MAJOR_VER}.init.d" squeezecenter - - # Install default preferences. - insinto /etc - newins "${FILESDIR}/squeezecenter-${MAJOR_VER}.prefs" squeezecenter.prefs - - # Install the SQL configuration scripts. - insinto "${INSTROOT}/squeezecenter/SQL/mysql" - doins "${FILESDIR}/dbdrop-${MAJOR_VER}-gentoo.sql" - doins "${FILESDIR}/dbcreate-${MAJOR_VER}-gentoo.sql" - - # Initialize /var/{cache,run}. - keepdir /var/{cache,run}/squeezecenter - fowners squeezecenter:squeezecenter /var/{cache,run}/squeezecenter - fperms 770 /var/{cache,run}/squeezecenter - - # Initialize /var/log. - 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 - - # 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}${CACHED_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 "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}/" < "${INSTROOT}/squeezecenter/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}/" < "${INSTROOT}/squeezecenter/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 "${CACHED_PREFS}" ] && sc_remove_db_prefs ${CACHED_PREFS} - - # Insert the external MySQL configuration into the preferences. - sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - [ -f "${CACHED_PREFS}" ] && sc_update_prefs "${CACHED_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - - # Phew - all done. - # Give some tips on what to do now. - einfo "Database configuration complete." - einfo "" - sc_starting_instr -} diff --git a/media-sound/squeezecenter/squeezecenter-7.0_beta20080210.ebuild b/media-sound/squeezecenter/squeezecenter-7.0_beta20080210.ebuild deleted file mode 100644 index 9fbb61c03e99..000000000000 --- a/media-sound/squeezecenter/squeezecenter-7.0_beta20080210.ebuild +++ /dev/null @@ -1,309 +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.0_beta20080210.ebuild,v 1.1 2008/02/11 20:38:46 lavajoe Exp $ - -inherit eutils - -SVN_VER="17379" -MAJOR_VER="${PV:0:3}" -MY_SRC_DIR="SqueezeCenter_${MAJOR_VER}_v${PV:8:4}-${PV:12:2}-${PV:14:2}" -MY_P="squeezecenter-${MAJOR_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/${MY_SRC_DIR}/${MY_P}.tgz" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~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}" - -INSTROOT="/opt" -PREFS="/etc/squeezecenter.prefs" -CACHED_PREFS="/var/cache/squeezecenter/prefs/server.prefs" -DBUSER="squeezecenter" - -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 "${INSTROOT}/squeezecenter" squeezecenter || die -} - -src_unpack() { - unpack ${A} - cd "${S}" - - # Apply patches - epatch "${FILESDIR}/mDNSResponder-${MAJOR_VER}-gentoo.patch" - - # Remove bundled binaries that are supplied by other ebuilds - einfo "Removing binaries provided by other ebuilds ..." - rm "${S}"/Bin/*/mDNSResponderPosix || die # net-misc/mDNSResponder - rm "${S}"/Bin/*/alac || die # media-sound/alac_decoder - rm "${S}"/Bin/*/flac || die # media-libs/flac - rm "${S}"/Bin/*/sox || die # media-sound/sox - rm "${S}"/Bin/*/wvunpack || die # media-sound/wavpack - rm "${S}"/Bin/*/mppdec || die # media-sound/musepack-tools - - # Remove bundled MySQL as we depend on an external instance - einfo "Removing bundled MySQL ..." - rm -r "${S}"/MySQL || die - rm "${S}"/Bin/*/mysqld || die # virtual/mysql -} - -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() { - # Copy all files. - dodir "${INSTROOT}/squeezecenter" - cp -r * "${D}/${INSTROOT}/squeezecenter" - - # Install init scripts. - newconfd "${FILESDIR}/squeezecenter-${MAJOR_VER}.conf.d" squeezecenter - newinitd "${FILESDIR}/squeezecenter-${MAJOR_VER}.init.d" squeezecenter - - # Install default preferences. - insinto /etc - newins "${FILESDIR}/squeezecenter-${MAJOR_VER}.prefs" squeezecenter.prefs - - # Install the SQL configuration scripts. - insinto "${INSTROOT}/squeezecenter/SQL/mysql" - doins "${FILESDIR}/dbdrop-${MAJOR_VER}-gentoo.sql" - doins "${FILESDIR}/dbcreate-${MAJOR_VER}-gentoo.sql" - - # Initialize /var/{cache,run}. - keepdir /var/{cache,run}/squeezecenter - fowners squeezecenter:squeezecenter /var/{cache,run}/squeezecenter - fperms 770 /var/{cache,run}/squeezecenter - - # Initialize /var/log. - 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 - - # 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}${CACHED_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 "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}/" < "${INSTROOT}/squeezecenter/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}/" < "${INSTROOT}/squeezecenter/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 "${CACHED_PREFS}" ] && sc_remove_db_prefs ${CACHED_PREFS} - - # Insert the external MySQL configuration into the preferences. - sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - [ -f "${CACHED_PREFS}" ] && sc_update_prefs "${CACHED_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - - # Phew - all done. - # Give some tips on what to do now. - einfo "Database configuration complete." - einfo "" - sc_starting_instr -} diff --git a/media-sound/squeezecenter/squeezecenter-7.0_beta20080217.ebuild b/media-sound/squeezecenter/squeezecenter-7.0_beta20080217.ebuild deleted file mode 100644 index 7e8635dd046f..000000000000 --- a/media-sound/squeezecenter/squeezecenter-7.0_beta20080217.ebuild +++ /dev/null @@ -1,309 +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.0_beta20080217.ebuild,v 1.1 2008/02/19 03:43:15 lavajoe Exp $ - -inherit eutils - -SVN_VER="17600" -MAJOR_VER="${PV:0:3}" -MY_SRC_DIR="SqueezeCenter_${MAJOR_VER}_v${PV:8:4}-${PV:12:2}-${PV:14:2}" -MY_P="squeezecenter-${MAJOR_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/${MY_SRC_DIR}/${MY_P}.tgz" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~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}" - -INSTROOT="/opt" -PREFS="/etc/squeezecenter.prefs" -CACHED_PREFS="/var/cache/squeezecenter/prefs/server.prefs" -DBUSER="squeezecenter" - -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 "${INSTROOT}/squeezecenter" squeezecenter || die -} - -src_unpack() { - unpack ${A} - cd "${S}" - - # Apply patches - epatch "${FILESDIR}/mDNSResponder-${MAJOR_VER}-gentoo.patch" - - # Remove bundled binaries that are supplied by other ebuilds - einfo "Removing binaries provided by other ebuilds ..." - rm "${S}"/Bin/*/mDNSResponderPosix || die # net-misc/mDNSResponder - rm "${S}"/Bin/*/alac || die # media-sound/alac_decoder - rm "${S}"/Bin/*/flac || die # media-libs/flac - rm "${S}"/Bin/*/sox || die # media-sound/sox - rm "${S}"/Bin/*/wvunpack || die # media-sound/wavpack - rm "${S}"/Bin/*/mppdec || die # media-sound/musepack-tools - - # Remove bundled MySQL as we depend on an external instance - einfo "Removing bundled MySQL ..." - rm -r "${S}"/MySQL || die - rm "${S}"/Bin/*/mysqld || die # virtual/mysql -} - -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() { - # Copy all files. - dodir "${INSTROOT}/squeezecenter" - cp -r * "${D}/${INSTROOT}/squeezecenter" - - # Install init scripts. - newconfd "${FILESDIR}/squeezecenter-${MAJOR_VER}.conf.d" squeezecenter - newinitd "${FILESDIR}/squeezecenter-${MAJOR_VER}.init.d" squeezecenter - - # Install default preferences. - insinto /etc - newins "${FILESDIR}/squeezecenter-${MAJOR_VER}.prefs" squeezecenter.prefs - - # Install the SQL configuration scripts. - insinto "${INSTROOT}/squeezecenter/SQL/mysql" - doins "${FILESDIR}/dbdrop-${MAJOR_VER}-gentoo.sql" - doins "${FILESDIR}/dbcreate-${MAJOR_VER}-gentoo.sql" - - # Initialize /var/{cache,run}. - keepdir /var/{cache,run}/squeezecenter - fowners squeezecenter:squeezecenter /var/{cache,run}/squeezecenter - fperms 770 /var/{cache,run}/squeezecenter - - # Initialize /var/log. - 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 - - # 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}${CACHED_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}/" < "${INSTROOT}/squeezecenter/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}/" < "${INSTROOT}/squeezecenter/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 "${CACHED_PREFS}" ] && sc_remove_db_prefs ${CACHED_PREFS} - - # Insert the external MySQL configuration into the preferences. - sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - [ -f "${CACHED_PREFS}" ] && sc_update_prefs "${CACHED_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - - # Phew - all done. - # Give some tips on what to do now. - einfo "Database configuration complete." - einfo "" - sc_starting_instr -} diff --git a/media-sound/squeezecenter/squeezecenter-7.0_beta20080224.ebuild b/media-sound/squeezecenter/squeezecenter-7.0_beta20080224.ebuild deleted file mode 100644 index e194918b51a3..000000000000 --- a/media-sound/squeezecenter/squeezecenter-7.0_beta20080224.ebuild +++ /dev/null @@ -1,309 +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.0_beta20080224.ebuild,v 1.1 2008/02/24 23:37:32 lavajoe Exp $ - -inherit eutils - -SVN_VER="17707" -MAJOR_VER="${PV:0:3}" -MY_SRC_DIR="SqueezeCenter_${MAJOR_VER}_v${PV:8:4}-${PV:12:2}-${PV:14:2}" -MY_P="squeezecenter-${MAJOR_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/${MY_SRC_DIR}/${MY_P}.tgz" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~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}" - -INSTROOT="/opt" -PREFS="/etc/squeezecenter.prefs" -CACHED_PREFS="/var/cache/squeezecenter/prefs/server.prefs" -DBUSER="squeezecenter" - -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 "${INSTROOT}/squeezecenter" squeezecenter || die -} - -src_unpack() { - unpack ${A} - cd "${S}" - - # Apply patches - epatch "${FILESDIR}/mDNSResponder-${MAJOR_VER}-gentoo.patch" - - # Remove bundled binaries that are supplied by other ebuilds - einfo "Removing binaries provided by other ebuilds ..." - rm "${S}"/Bin/*/mDNSResponderPosix || die # net-misc/mDNSResponder - rm "${S}"/Bin/*/alac || die # media-sound/alac_decoder - rm "${S}"/Bin/*/flac || die # media-libs/flac - rm "${S}"/Bin/*/sox || die # media-sound/sox - rm "${S}"/Bin/*/wvunpack || die # media-sound/wavpack - rm "${S}"/Bin/*/mppdec || die # media-sound/musepack-tools - - # Remove bundled MySQL as we depend on an external instance - einfo "Removing bundled MySQL ..." - rm -r "${S}"/MySQL || die - rm "${S}"/Bin/*/mysqld || die # virtual/mysql -} - -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() { - # Copy all files. - dodir "${INSTROOT}/squeezecenter" - cp -r * "${D}/${INSTROOT}/squeezecenter" - - # Install init scripts. - newconfd "${FILESDIR}/squeezecenter-${MAJOR_VER}.conf.d" squeezecenter - newinitd "${FILESDIR}/squeezecenter-${MAJOR_VER}.init.d" squeezecenter - - # Install default preferences. - insinto /etc - newins "${FILESDIR}/squeezecenter-${MAJOR_VER}.prefs" squeezecenter.prefs - - # Install the SQL configuration scripts. - insinto "${INSTROOT}/squeezecenter/SQL/mysql" - doins "${FILESDIR}/dbdrop-${MAJOR_VER}-gentoo.sql" - doins "${FILESDIR}/dbcreate-${MAJOR_VER}-gentoo.sql" - - # Initialize /var/{cache,run}. - keepdir /var/{cache,run}/squeezecenter - fowners squeezecenter:squeezecenter /var/{cache,run}/squeezecenter - fperms 770 /var/{cache,run}/squeezecenter - - # Initialize /var/log. - 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 - - # 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}${CACHED_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}/" < "${INSTROOT}/squeezecenter/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}/" < "${INSTROOT}/squeezecenter/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 "${CACHED_PREFS}" ] && sc_remove_db_prefs ${CACHED_PREFS} - - # Insert the external MySQL configuration into the preferences. - sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - [ -f "${CACHED_PREFS}" ] && sc_update_prefs "${CACHED_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" - - # Phew - all done. - # Give some tips on what to do now. - einfo "Database configuration complete." - einfo "" - sc_starting_instr -} |