Gentoo Archives: gentoo-commits

From: "Joe Peterson (lavajoe)" <lavajoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/squeezeboxserver: ChangeLog squeezeboxserver-7.5.1.ebuild
Date: Sun, 27 Jun 2010 08:06:13
Message-Id: 20100627080610.5018F2CF8D@corvid.gentoo.org
1 lavajoe 10/06/27 08:06:10
2
3 Modified: ChangeLog
4 Added: squeezeboxserver-7.5.1.ebuild
5 Log:
6 Add new version 7.5.1
7 (Portage version: 2.1.8.3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.8 media-sound/squeezeboxserver/ChangeLog
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/squeezeboxserver/ChangeLog?rev=1.8&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/squeezeboxserver/ChangeLog?rev=1.8&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/squeezeboxserver/ChangeLog?r1=1.7&r2=1.8
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/media-sound/squeezeboxserver/ChangeLog,v
19 retrieving revision 1.7
20 retrieving revision 1.8
21 diff -u -r1.7 -r1.8
22 --- ChangeLog 10 Jun 2010 14:30:34 -0000 1.7
23 +++ ChangeLog 27 Jun 2010 08:06:09 -0000 1.8
24 @@ -1,6 +1,15 @@
25 # ChangeLog for media-sound/squeezeboxserver
26 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezeboxserver/ChangeLog,v 1.7 2010/06/10 14:30:34 lavajoe Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezeboxserver/ChangeLog,v 1.8 2010/06/27 08:06:09 lavajoe Exp $
29 +
30 +*squeezeboxserver-7.5.1 (27 Jun 2010)
31 +
32 + 27 Jun 2010; Joe Peterson <lavajoe@g.o>
33 + +squeezeboxserver-7.5.1.ebuild,
34 + +files/squeezeboxserver-7.5.1-build-perl-modules-gentoo.patch,
35 + +files/squeezeboxserver-7.5.1-squeezeslave.patch,
36 + +files/squeezeboxserver-7.5.1-uuid-gentoo.patch:
37 + Add new version 7.5.1
38
39 *squeezeboxserver-7.4.2-r2 (10 Jun 2010)
40
41
42
43
44 1.1 media-sound/squeezeboxserver/squeezeboxserver-7.5.1.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/squeezeboxserver/squeezeboxserver-7.5.1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/squeezeboxserver/squeezeboxserver-7.5.1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: squeezeboxserver-7.5.1.ebuild
50 ===================================================================
51 # Copyright 1999-2010 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/media-sound/squeezeboxserver/squeezeboxserver-7.5.1.ebuild,v 1.1 2010/06/27 08:06:10 lavajoe Exp $
54
55 EAPI="2"
56
57 inherit eutils
58
59 MAJOR_VER="${PV:0:3}"
60 MINOR_VER="${PV:4:1}"
61 BUILD_NUM="30836"
62 SRC_DIR="SqueezeboxServer_v${MAJOR_VER}.${MINOR_VER}"
63 MY_P="squeezeboxserver-${MAJOR_VER}.${MINOR_VER}-noCPAN"
64 MY_P_BUILD_NUM="squeezeboxserver-${MAJOR_VER}.${MINOR_VER}-${BUILD_NUM}-noCPAN"
65
66 DESCRIPTION="Logitech SqueezeboxServer music server"
67 HOMEPAGE="http://www.logitechsqueezebox.com/support/download-squeezebox-server.html"
68 LICENSE="GPL-2"
69 SLOT="0"
70 KEYWORDS="~amd64 ~x86"
71 IUSE="lame wavpack ogg flac aac"
72
73 # Note: EV present because of bug#287857.
74 SRC_URI="http://downloads.slimdevices.com/${SRC_DIR}/${MY_P}.tgz
75 mirror://gentoo/SqueezeboxServer-EV-3.8.tar.gz"
76
77 # Note: common-sense currently required due to bundled EV (Gentoo bug#287257)
78 DEPEND="
79 !media-sound/squeezecenter
80 virtual/logger
81 virtual/mysql
82 >=dev-perl/common-sense-2.01
83 "
84 # Note: dev-perl/GD necessary because of SC bug#6143
85 # (http://bugs.slimdevices.com/show_bug.cgi?id=6143).
86 RDEPEND="
87 dev-perl/File-Which
88 virtual/logger
89 virtual/mysql
90 >=dev-lang/perl-5.8.8
91 ~dev-perl/Audio-Scan-0.82
92 >=dev-perl/GD-2.41
93 >=virtual/perl-IO-Compress-2.015
94 >=dev-perl/YAML-Syck-1.05
95 >=dev-perl/DBD-mysql-4.00.5
96 >=dev-perl/DBI-1.607
97 >=dev-perl/Digest-SHA1-2.11
98 >=dev-perl/Encode-Detect-1.01
99 >=dev-perl/HTML-Parser-3.56
100 >=dev-perl/JSON-XS-2.2.3.1
101 >=dev-perl/Template-Toolkit-2.19
102 >=virtual/perl-Time-HiRes-1.97.15
103 >=dev-perl/XML-Parser-2.36
104 >=dev-perl/Cache-Cache-1.04
105 >=dev-perl/Class-Data-Inheritable-0.08
106 >=dev-perl/Class-Inspector-1.23
107 >=dev-perl/File-Next-1.02
108 >=virtual/perl-File-Temp-0.20
109 >=dev-perl/File-Which-0.05
110 >=perl-core/i18n-langtags-0.35
111 >=dev-perl/IO-String-1.08
112 >=dev-perl/Log-Log4perl-1.13
113 >=dev-perl/libwww-perl-5.805
114 >=perl-core/CGI-3.29
115 >=dev-perl/TimeDate-1.16
116 >=dev-perl/Math-VecStat-0.08
117 >=dev-perl/Net-DNS-0.63
118 >=dev-perl/Path-Class-0.16
119 >=dev-perl/SQL-Abstract-1.56
120 >=dev-perl/SQL-Abstract-Limit-0.12
121 >=dev-perl/URI-1.35
122 >=dev-perl/XML-Simple-2.18
123 >=perl-core/version-0.76
124 >=dev-perl/Carp-Clan-5.9
125 >=dev-perl/Readonly-1.03
126 >=dev-perl/Carp-Assert-0.20
127 >=dev-perl/Class-Virtual-0.06
128 >=dev-perl/File-Slurp-9999.13
129 >=dev-perl/Exporter-Lite-0.02
130 >=dev-perl/Tie-IxHash-1.21
131 >=virtual/perl-Module-Pluggable-3.6
132 >=dev-perl/Archive-Zip-1.23
133 >=dev-perl/AnyEvent-5.2
134 >=dev-perl/Sub-Name-0.04
135 >=dev-perl/Module-Find-0.08
136 >=dev-perl/Class-Accessor-0.31
137 >=dev-perl/Class-XSAccessor-1.05
138 >=dev-perl/AutoXS-Header-1.02
139 >=dev-perl/Scope-Guard-0.03
140 >=dev-perl/Class-C3-XS-0.13
141 >=dev-perl/Class-C3-0.21
142 >=dev-perl/Class-C3-Componentised-1.0006
143 >=dev-perl/File-ReadBackwards-1.04
144 ~dev-perl/DBIx-Class-0.08120
145 >=dev-perl/JSON-XS-VersionOneAndTwo-0.31
146 >=dev-perl/MRO-Compat-0.11
147 >=dev-perl/PAR-0.994
148 >=dev-perl/enum-1.016
149 >=dev-perl/URI-Find-20100211
150 >=dev-perl/Algorithm-C3-0.08
151 >=dev-perl/Text-Unidecode-0.04
152 >=dev-perl/Net-UPnP-1.4.2
153 >=dev-perl/File-BOM-0.14
154 >=dev-perl/Proc-Background-1.10
155 >=dev-perl/Tie-Cache-LRU-20081023.2116
156 >=dev-perl/Tie-Cache-LRU-Expires-0.54
157 >=dev-perl/Data-Dump-1.15
158 >=dev-perl/Data-Page-2.02
159 >=dev-perl/Data-URIEncode-0.11
160 >=dev-perl/Tie-LLHash-1.003
161 >=dev-perl/Tie-RegexpHash-0.15
162 >=dev-perl/Data-UUID-1.202
163 lame? ( media-sound/lame )
164 wavpack? ( media-sound/wavpack )
165 flac? (
166 media-libs/flac
167 media-sound/sox[flac]
168 )
169 ogg? ( media-sound/sox[ogg] )
170 aac? ( media-libs/faad2 )
171 "
172
173 S="${WORKDIR}/${MY_P_BUILD_NUM}"
174
175 ETCDIR="/etc/squeezeboxserver"
176 PREFS="${ETCDIR}/squeezeboxserver.prefs"
177 PREFSDIR="${ETCDIR}/prefs"
178 DOCDIR="/usr/share/doc/squeezeboxserver-${PV}"
179 SHAREDIR="/usr/share/squeezeboxserver"
180 LIBDIR="/usr/$(get_libdir)/squeezeboxserver"
181 OLDDBUSER="squeezecenter"
182 DBUSER="squeezeboxserver"
183 VARLIBSBS="/var/lib/squeezeboxserver"
184 PLUGINSDIR="${VARLIBSBS}/Plugins"
185
186 # To support Migration
187 OLDETCDIR="/etc/squeezecenter"
188 OLDPREFSDIR="/var/lib/squeezecenter/prefs"
189 OLDPREFSFILE="${OLDPREFSDIR}/server.prefs"
190 OLDPLUGINSDIR="/var/lib/squeezecenter/Plugins"
191 MIGMARKER=".migrated"
192
193 pkg_setup() {
194 # Create the user and group if not already present
195 enewgroup squeezeboxserver
196 enewuser squeezeboxserver -1 -1 "/dev/null" squeezeboxserver
197 }
198
199 src_prepare() {
200 # Apply patches
201 epatch "${FILESDIR}/${P}-build-perl-modules-gentoo.patch"
202 epatch "${FILESDIR}/${P}-uuid-gentoo.patch"
203 epatch "${FILESDIR}/${P}-squeezeslave.patch"
204
205 # Copy in the module builder - can't run it from the files directory in case
206 # Portage is mounted 'noexec'.
207 cp "${FILESDIR}/build-modules.sh" "${S}" || die
208 chmod 555 "${S}/build-modules.sh" || die
209 }
210
211 # Building of EV present because of bug#287857.
212 src_compile() {
213 einfo "Building bundled Perl modules (some warnings are normal here)..."
214 "./build-modules.sh" "${DISTDIR}" || die "Unable to build Perl modules"
215 }
216
217 src_install() {
218
219 # The main Perl executables
220 exeinto /usr/sbin
221 newexe slimserver.pl squeezeboxserver || die "Failed to install server executable"
222 newexe scanner.pl squeezeboxserver-scanner || die "Failed to install scanner executable"
223 newexe cleanup.pl squeezeboxserver-cleanup || die "Failed to install cleanup executable"
224
225 # The custom OS module for Gentoo - provides OS-specific path details
226 cp "${FILESDIR}/gentoo-filepaths.pm" "Slim/Utils/OS/Custom.pm" || die "Unable to install Gentoo custom OS module"
227
228 # The server Perl modules
229 local installvendorlib
230 eval `perl '-V:installvendorlib'`
231 dodir "${installvendorlib}"
232 cp -r Slim "${D}${installvendorlib}" || die "Unable to install server Perl modules"
233
234 # Various directories of architecture-independent static files
235 dodir "${SHAREDIR}"
236 cp -r Firmware "${D}/${SHAREDIR}" || die "Unable to install firmware"
237 cp -r Graphics "${D}/${SHAREDIR}" || die "Unable to install Graphics"
238 cp -r HTML "${D}/${SHAREDIR}" || die "Unable to install HTML"
239 cp -r IR "${D}/${SHAREDIR}" || die "Unable to install IR"
240 cp -r SQL "${D}/${SHAREDIR}" || die "Unable to install SQL"
241
242 # Remove bundled modified AnyEvent - we depend on a newer version now
243 rm -r lib/AnyEvent.pm lib/AnyEvent || die "Unable to remove bundled AnyEvent"
244
245 # Architecture-dependent static files
246 dodir "${LIBDIR}"
247 cp -r lib/* "${D}${LIBDIR}" || die "Unable to install architecture-dependent files"
248
249 # Install compiled Perl modules because of bug#287857.
250 dodir "${LIBDIR}/CPAN/arch"
251 cp -r CPAN-arch/* "${D}${LIBDIR}/CPAN/arch" || die "Unable to install compiled CPAN modules"
252 cp -r CPAN-pm/* "${D}${LIBDIR}/CPAN" || die "Unable to install compiled CPAN modules"
253
254 # Strings and version identification
255 insinto "${SHAREDIR}"
256 doins strings.txt
257 doins revision.txt
258
259 # Documentation
260 dodoc Changelog*.html
261 dodoc Installation.txt
262 dodoc License*.txt
263 dodoc "${FILESDIR}/Gentoo-plugins-README.txt"
264 dodoc "${FILESDIR}/Gentoo-detailed-changelog.txt"
265
266 # Configuration files and preferences
267 insinto "${ETCDIR}"
268 doins convert.conf
269 doins types.conf
270 doins modules.conf
271 newins "${FILESDIR}/squeezeboxserver.prefs" squeezeboxserver.prefs
272
273 # Preferences directory
274 dodir "${PREFSDIR}"
275 fowners squeezeboxserver:squeezeboxserver "${PREFSDIR}"
276 fperms 770 "${PREFSDIR}"
277
278 # Install init scripts
279 newconfd "${FILESDIR}/squeezeboxserver.conf.d" squeezeboxserver
280 newinitd "${FILESDIR}/squeezeboxserver.init.d" squeezeboxserver
281
282 # Install the SQL configuration scripts
283 insinto "${SHAREDIR}/SQL/mysql"
284 doins "${FILESDIR}/dbdrop-gentoo.sql"
285 doins "${FILESDIR}/dbcreate-gentoo.sql"
286
287 # Initialize run directory (where the PID file lives)
288 dodir /var/run/squeezeboxserver
289 fowners squeezeboxserver:squeezeboxserver /var/run/squeezeboxserver
290 fperms 770 /var/run/squeezeboxserver
291
292 # Initialize server cache directory
293 dodir /var/lib/squeezeboxserver/cache
294 fowners squeezeboxserver:squeezeboxserver /var/lib/squeezeboxserver/cache
295 fperms 770 /var/lib/squeezeboxserver/cache
296
297 # Initialize the log directory
298 dodir /var/log/squeezeboxserver
299 fowners squeezeboxserver:squeezeboxserver /var/log/squeezeboxserver
300 fperms 770 /var/log/squeezeboxserver
301 touch "${D}/var/log/squeezeboxserver/server.log"
302 touch "${D}/var/log/squeezeboxserver/scanner.log"
303 touch "${D}/var/log/squeezeboxserver/perfmon.log"
304 fowners squeezeboxserver:squeezeboxserver /var/log/squeezeboxserver/server.log
305 fowners squeezeboxserver:squeezeboxserver /var/log/squeezeboxserver/scanner.log
306 fowners squeezeboxserver:squeezeboxserver /var/log/squeezeboxserver/perfmon.log
307
308 # Initialise the user-installed plugins directory
309 dodir "${PLUGINSDIR}"
310 fowners squeezeboxserver:squeezeboxserver "${PLUGINSDIR}"
311 fperms 770 "${PLUGINSDIR}"
312
313 # Install logrotate support
314 insinto /etc/logrotate.d
315 newins "${FILESDIR}/squeezeboxserver.logrotate.d" squeezeboxserver
316 }
317
318 sc_starting_instr() {
319 elog "Squeezebox Server can be started with the following command:"
320 elog "\t/etc/init.d/squeezeboxserver start"
321 elog ""
322 elog "Squeezebox Server can be automatically started on each boot with the"
323 elog "following command:"
324 elog "\trc-update add squeezeboxserver default"
325 elog ""
326 elog "You might want to examine and modify the following configuration"
327 elog "file before starting Squeezebox Server:"
328 elog "\t/etc/conf.d/squeezeboxserver"
329 elog ""
330
331 # Discover the port number from the preferences, but if it isn't there
332 # then report the standard one.
333 httpport=$(gawk '$1 == "httpport:" { print $2 }' "${ROOT}${LIVE_PREFS}" 2>/dev/null)
334 elog "You may access and configure Squeezebox Server by browsing to:"
335 elog "\thttp://localhost:${httpport:-9000}/"
336 }
337
338 pkg_postinst() {
339 # FLAC and LAME are quite useful (but not essential) for Squeezebox Server -
340 # if they're not enabled then make sure the user understands that.
341 if ! use flac; then
342 ewarn "'flac' USE flag is not set. Although not essential, FLAC is required"
343 ewarn "for playing lossless WAV and FLAC (for Squeezebox 1), and for"
344 ewarn "playing other less common file types (if you have a Squeezebox 2 or newer)."
345 ewarn "For maximum flexibility you are recommended to set the 'flac' USE flag".
346 ewarn ""
347 fi
348 if ! use lame; then
349 ewarn "'lame' USE flag is not set. Although not essential, LAME is"
350 ewarn "required if you want to limit the bandwidth your Squeezebox or"
351 ewarn "Transporter uses when streaming audio."
352 ewarn "For maximum flexibility you are recommended to set the 'lame' USE flag".
353 ewarn ""
354 fi
355
356 # Album art requires PNG and JPEG support from GD, so if it's not there
357 # then warn the user. It's not mandatory as the user may not be using
358 # album art.
359 if ! has_version dev-perl/GD[jpeg] || \
360 ! has_version dev-perl/GD[png] || \
361 ! has_version media-libs/gd[jpeg] || \
362 ! has_version media-libs/gd[png]; then
363 ewarn "For correct operation of album art through Squeezebox Server's web"
364 ewarn "interface the GD library and Perl module must be built with PNG"
365 ewarn "and JPEG support. If necessary you can add the following lines"
366 ewarn "to the file /etc/portage/package.use:"
367 ewarn "\tdev-perl/GD jpeg png"
368 ewarn "\tmedia-libs/gd jpeg png"
369 ewarn "And then rebuild those packages with:"
370 ewarn "\temerge --newuse dev-perl/GD media-libs/gd"
371 ewarn ""
372 fi
373
374 # Point user to database configuration step
375 elog "If this is a new installation of Squeezebox Server then the database"
376 elog "must be configured prior to use. This can be done by running the"
377 elog "following command:"
378 elog "\temerge --config =${CATEGORY}/${PF}"
379 elog "This command will also migrate old SqueezeCenter preferences and"
380 elog "plugins (if present)."
381
382 elog ""
383
384 ewarn "Note: If Squeezebox Server dies after the initial configuration"
385 ewarn " after an upgrade from a previous installation, try removing"
386 ewarn " /var/lib/squeezeboxserver and /etc/squeezeboxserver and"
387 ewarn " then reinstalling the package (note that old preferences"
388 ewarn " and plugins will be lost). See bug #307119."
389
390 elog ""
391
392 sc_starting_instr
393 }
394
395 sc_remove_db_prefs() {
396 MY_PREFS=$1
397
398 einfo "Configuring Squeezebox Server database preferences (${MY_PREFS}) ..."
399 TMPPREFS="${T}"/squeezeboxserver-prefs-$$
400 touch "${ROOT}${MY_PREFS}"
401 sed -e '/^dbusername:/d' -e '/^dbpassword:/d' -e '/^dbsource:/d' < "${ROOT}${MY_PREFS}" > "${TMPPREFS}"
402 mv "${TMPPREFS}" "${ROOT}${MY_PREFS}"
403 chown squeezeboxserver:squeezeboxserver "${ROOT}${MY_PREFS}"
404 chmod 660 "${ROOT}${MY_PREFS}"
405 }
406
407 sc_update_prefs() {
408 MY_PREFS=$1
409 MY_DBUSER=$2
410 MY_DBUSER_PASSWD=$3
411
412 echo "dbusername: ${MY_DBUSER}" >> "${ROOT}${MY_PREFS}"
413 echo "dbpassword: ${MY_DBUSER_PASSWD}" >> "${ROOT}${MY_PREFS}"
414 echo "dbsource: dbi:mysql:database=${MY_DBUSER};mysql_socket=/var/run/mysqld/mysqld.sock" >> "${ROOT}${MY_PREFS}"
415 }
416
417 pkg_config() {
418 einfo "Press ENTER to create the Squeezebox Server database and set proper"
419 einfo "permissions on it. You will be prompted for the MySQL 'root' user's"
420 einfo "password during this process (note that the MySQL 'root' user is"
421 einfo "independent of the Linux 'root' user and so may have a different"
422 einfo "password)."
423 einfo ""
424 einfo "If you already have a Squeezebox Server database set up then this"
425 einfo "process will clear the existing database (your music files will not,"
426 einfo "however, be affected)."
427 einfo ""
428 einfo "Alternatively, press Control-C to abort now..."
429 read
430
431 # Get the MySQL root password from the user (not echoed to the terminal)
432 einfo "The MySQL 'root' user password is required to create the"
433 einfo "Squeezebox Server user and database."
434 DONE=0
435 while [ $DONE -eq 0 ]; do
436 trap "stty echo; echo" EXIT
437 stty -echo
438 read -p "MySQL root password: " ROOT_PASSWD; echo
439 stty echo
440 trap ":" EXIT
441 echo quit | mysql --user=root --password="${ROOT_PASSWD}" >/dev/null 2>&1 && DONE=1
442 if [ $DONE -eq 0 ]; then
443 eerror "Incorrect MySQL root password, or MySQL is not running"
444 fi
445 done
446
447 # Get the new password for the Squeezebox Server MySQL database user, and
448 # have it re-entered to confirm it. We should trivially check it's not
449 # the same as the MySQL root password.
450 einfo "A new MySQL user will be added to own the Squeezebox Server database."
451 einfo "Please enter the password for this new user (${DBUSER})."
452 DONE=0
453 while [ $DONE -eq 0 ]; do
454 trap "stty echo; echo" EXIT
455 stty -echo
456 read -p "MySQL ${DBUSER} password: " DBUSER_PASSWD; echo
457 stty echo
458 trap ":" EXIT
459 if [ -z "$DBUSER_PASSWD" ]; then
460 eerror "The password should not be blank; try again."
461 elif [ "$DBUSER_PASSWD" == "$ROOT_PASSWD" ]; then
462 eerror "The ${DBUSER} password should be different to the root password"
463 else
464 DONE=1
465 fi
466 done
467
468 # Drop the existing database and user - note we don't care about errors
469 # from this as it probably just indicates that the database wasn't
470 # yet present.
471 einfo "Dropping old Squeezebox Server database and user ..."
472 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
473
474 # Drop and create the Squeezebox Server user and database.
475 einfo "Creating Squeezebox Server MySQL user and database (${DBUSER}) ..."
476 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"
477
478 # Migrate old preferences, if present.
479 if [ -d "${OLDPREFSFILE}" ]; then
480 if [ -f "${ETCDIR}/${MIGMARKER}" ]; then
481 einfo ""
482 einfo "Old preferences are present, but they appear to have been"
483 einfo "migrated before. If you would like to re-migrate the old"
484 einfo "SqueezeCenter preferences remove the following file, and"
485 einfo "then restart the configuration."
486 einfo "\t${ETCDIR}/${MIGMARKER}"
487 else
488 einfo "Migrating old SqueezeCenter preferences"
489 cp -r "${OLDPREFSDIR}" "${VARLIBSBS}"
490 mv "${VARLIBSBS}/prefs/server.prefs" "/etc/squeezeboxserver/squeezeboxserver.prefs"
491 chown -R squeezeboxserver:squeezeboxserver "${PREFSDIR}"
492 touch "${PREFSDIR}/${MIGMARKER}"
493 fi
494 fi
495
496 # Migrate old plugins, if present.
497 if [ -d "${OLDPLUGINSDIR}" ]; then
498 if [ -f "${PLUGINSDIR}/${MIGMARKER}" ]; then
499 einfo ""
500 einfo "Old plugins are present, but they appear to have been"
501 einfo "migrated before. If you would like to re-migrate the old"
502 einfo "SqueezeCenter preferences remove the following file, and"
503 einfo "then restart the configuration."
504 einfo "\t${PLUGINSDIR}/${MIGMARKER}"
505 else
506 einfo "Migrating old SqueezeCenter plugins"
507 cp -r "${OLDPLUGINSDIR}" "${VARLIBSBS}"
508 chown -R squeezeboxserver:squeezeboxserver "${PLUGINSDIR}"
509 touch "${PLUGINSDIR}/${MIGMARKER}"
510 fi
511 fi
512
513 # Remove the existing MySQL preferences from Squeezebox Server (if any).
514 sc_remove_db_prefs "${PREFS}"
515
516 # Insert the external MySQL configuration into the preferences.
517 sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}"
518
519 # Phew - all done. Give some tips on what to do now.
520 einfo "Database configuration complete."
521 einfo ""
522 sc_starting_instr
523 }
524
525 pkg_preinst() {
526 # Warn the user if there are old preferences that may need migrating.
527 if [ -d "${OLDPREFSDIR}" -a ! -f "${PREFSDIR}/${MIGMARKER}" ]; then
528 if [ ! -z "$(ls ${OLDPREFSDIR})" ]; then
529 ewarn "Note: It appears that old SqueezeCenter preferences are
530 installed at:"
531 ewarn "\t${OLDPREFSDIR}"
532 ewarn "These may be migrated by running the following command:"
533 ewarn "\temerge --config =${CATEGORY}/${PF}"
534 ewarn "(Please note that this will require your music collection to
535 be rescanned.)"
536 ewarn ""
537 fi
538 fi
539 }