Lines 26-32
Link Here
|
26 |
# Note: common-sense currently required due to bundled EV (Gentoo bug#287257) |
26 |
# Note: common-sense currently required due to bundled EV (Gentoo bug#287257) |
27 |
DEPEND=" |
27 |
DEPEND=" |
28 |
!media-sound/squeezecenter |
28 |
!media-sound/squeezecenter |
29 |
virtual/logger |
|
|
30 |
virtual/mysql |
29 |
virtual/mysql |
31 |
avahi? ( net-dns/avahi ) |
30 |
avahi? ( net-dns/avahi ) |
32 |
>=dev-perl/common-sense-2.01 |
31 |
>=dev-perl/common-sense-2.01 |
Lines 35-41
Link Here
|
35 |
# (http://bugs.slimdevices.com/show_bug.cgi?id=6143). |
34 |
# (http://bugs.slimdevices.com/show_bug.cgi?id=6143). |
36 |
RDEPEND=" |
35 |
RDEPEND=" |
37 |
dev-perl/File-Which |
36 |
dev-perl/File-Which |
38 |
virtual/logger |
|
|
39 |
virtual/mysql |
37 |
virtual/mysql |
40 |
avahi? ( net-dns/avahi ) |
38 |
avahi? ( net-dns/avahi ) |
41 |
>=dev-lang/perl-5.8.8 |
39 |
>=dev-lang/perl-5.8.8 |
Lines 186-192
Link Here
|
186 |
# Build Audio::Scan and EV present because of bug#287264 and bug#287857. |
184 |
# Build Audio::Scan and EV present because of bug#287264 and bug#287857. |
187 |
src_compile() { |
185 |
src_compile() { |
188 |
einfo "Building bundled Perl modules (some warnings are normal here)..." |
186 |
einfo "Building bundled Perl modules (some warnings are normal here)..." |
189 |
"${FILESDIR}/build-modules.sh" "${DISTDIR}" || die "Unable to build Perl modules" |
187 |
bash "${FILESDIR}/build-modules.sh" "${DISTDIR}" || die "Unable to build Perl modules" |
190 |
} |
188 |
} |
191 |
|
189 |
|
192 |
src_install() { |
190 |
src_install() { |
Lines 203-208
Link Here
|
203 |
|
201 |
|
204 |
# The custom OS module for Gentoo - provides OS-specific path details |
202 |
# The custom OS module for Gentoo - provides OS-specific path details |
205 |
cp "${FILESDIR}/gentoo-filepaths.pm" "Slim/Utils/OS/Custom.pm" || die "Unable to install Gentoo custom OS module" |
203 |
cp "${FILESDIR}/gentoo-filepaths.pm" "Slim/Utils/OS/Custom.pm" || die "Unable to install Gentoo custom OS module" |
|
|
204 |
|
205 |
# Adjust gentoo-filepaths.pm to prefix |
206 |
sed -i -e "s|/usr|${EPREFIX}/usr|" "Slim/Utils/OS/Custom.pm" || die "sed failed" |
207 |
sed -i -e "s|/var|${EPREFIX}/var|" "Slim/Utils/OS/Custom.pm" || die "sed failed" |
208 |
sed -i -e "s|/etc|${EPREFIX}/etc|" "Slim/Utils/OS/Custom.pm" || die "sed failed" |
206 |
|
209 |
|
207 |
# The server Perl modules |
210 |
# The server Perl modules |
208 |
dodir "/usr/lib/${package}/vendor_perl/${version}" |
211 |
dodir "/usr/lib/${package}/vendor_perl/${version}" |
Lines 388-398
Link Here
|
388 |
|
391 |
|
389 |
einfo "Configuring Squeezebox Server database preferences (${MY_PREFS}) ..." |
392 |
einfo "Configuring Squeezebox Server database preferences (${MY_PREFS}) ..." |
390 |
TMPPREFS="${T}"/squeezeboxserver-prefs-$$ |
393 |
TMPPREFS="${T}"/squeezeboxserver-prefs-$$ |
391 |
touch "${EROOT}${MY_PREFS}" |
394 |
touch "${MY_PREFS}" |
392 |
sed -e '/^dbusername:/d' -e '/^dbpassword:/d' -e '/^dbsource:/d' < "${EROOT}${MY_PREFS}" > "${TMPPREFS}" |
395 |
sed -e '/^dbusername:/d' -e '/^dbpassword:/d' -e '/^dbsource:/d' < "${MY_PREFS}" > "${TMPPREFS}" |
393 |
mv "${TMPPREFS}" "${EROOT}${MY_PREFS}" |
396 |
mv "${TMPPREFS}" "${MY_PREFS}" |
394 |
chown squeezeboxserver:squeezeboxserver "${EROOT}${MY_PREFS}" |
397 |
chown squeezeboxserver:squeezeboxserver "${EROOT}${MY_PREFS}" |
395 |
chmod 660 "${EROOT}${MY_PREFS}" |
398 |
chmod 660 "${MY_PREFS}" |
396 |
} |
399 |
} |
397 |
|
400 |
|
398 |
sc_update_prefs() { |
401 |
sc_update_prefs() { |
Lines 400-408
Link Here
|
400 |
MY_DBUSER=$2 |
403 |
MY_DBUSER=$2 |
401 |
MY_DBUSER_PASSWD=$3 |
404 |
MY_DBUSER_PASSWD=$3 |
402 |
|
405 |
|
403 |
echo "dbusername: ${MY_DBUSER}" >> "${EROOT}${MY_PREFS}" |
406 |
echo "dbusername: ${MY_DBUSER}" >> "${MY_PREFS}" |
404 |
echo "dbpassword: ${MY_DBUSER_PASSWD}" >> "${EROOT}${MY_PREFS}" |
407 |
echo "dbpassword: ${MY_DBUSER_PASSWD}" >> "${MY_PREFS}" |
405 |
echo "dbsource: dbi:mysql:database=${MY_DBUSER};mysql_socket=/var/run/mysqld/mysqld.sock" >> "${EROOT}${MY_PREFS}" |
408 |
echo "dbsource: dbi:mysql:database=${MY_DBUSER};mysql_socket=${EPREFIX}/var/run/mysqld/mysqld.sock" >> "${MY_PREFS}" |
406 |
} |
409 |
} |
407 |
|
410 |
|
408 |
pkg_config() { |
411 |
pkg_config() { |
Lines 460-470
Link Here
|
460 |
# from this as it probably just indicates that the database wasn't |
463 |
# from this as it probably just indicates that the database wasn't |
461 |
# yet present. |
464 |
# yet present. |
462 |
einfo "Dropping old Squeezebox Server database and user ..." |
465 |
einfo "Dropping old Squeezebox Server database and user ..." |
463 |
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 |
466 |
sed -e "s/__DATABASE__/${DBUSER}/" -e "s/__DBUSER__/${DBUSER}/" < "${EPREFIX}${SHAREDIR}/SQL/mysql/dbdrop-gentoo.sql" | mysql --user=root --password="${ROOT_PASSWD}" >/dev/null 2>&1 |
464 |
|
467 |
|
465 |
# Drop and create the Squeezebox Server user and database. |
468 |
# Drop and create the Squeezebox Server user and database. |
466 |
einfo "Creating Squeezebox Server MySQL user and database (${DBUSER}) ..." |
469 |
einfo "Creating Squeezebox Server MySQL user and database (${DBUSER}) ..." |
467 |
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" |
470 |
sed -e "s/__DATABASE__/${DBUSER}/" -e "s/__DBUSER__/${DBUSER}/" -e "s/__DBPASSWORD__/${DBUSER_PASSWD}/" < "${EPREFIX}${SHAREDIR}/SQL/mysql/dbcreate-gentoo.sql" | mysql --user=root --password="${ROOT_PASSWD}" || die "Unable to create MySQL database and user" |
468 |
|
471 |
|
469 |
# Migrate old preferences, if present. |
472 |
# Migrate old preferences, if present. |
470 |
if [ -d "${OLDPREFSDIR}" ]; then |
473 |
if [ -d "${OLDPREFSDIR}" ]; then |
Lines 501-512
Link Here
|
501 |
fi |
504 |
fi |
502 |
|
505 |
|
503 |
# Remove the existing MySQL preferences from Squeezebox Server (if any). |
506 |
# Remove the existing MySQL preferences from Squeezebox Server (if any). |
504 |
sc_remove_db_prefs "${PREFS}" |
507 |
sc_remove_db_prefs "${EPREFIX}${PREFS}" |
505 |
[ -f "${LIVE_PREFS}" ] && sc_remove_db_prefs ${LIVE_PREFS} |
508 |
[ -f "${EPREFIX}${LIVE_PREFS}" ] && sc_remove_db_prefs "${EPREFIX}${LIVE_PREFS}" |
506 |
|
509 |
|
507 |
# Insert the external MySQL configuration into the preferences. |
510 |
# Insert the external MySQL configuration into the preferences. |
508 |
sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" |
511 |
sc_update_prefs "${EPREFIX}${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" |
509 |
[ -f "${LIVE_PREFS}" ] && sc_update_prefs "${LIVE_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" |
512 |
[ -f "${EPREFIX}${LIVE_PREFS}" ] && sc_update_prefs "${EPREFIX}${LIVE_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}" |
510 |
|
513 |
|
511 |
# Phew - all done. Give some tips on what to do now. |
514 |
# Phew - all done. Give some tips on what to do now. |
512 |
einfo "Database configuration complete." |
515 |
einfo "Database configuration complete." |