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/squeezecenter: ChangeLog squeezecenter-7.1.0.ebuild squeezecenter-7.0.2_beta20080530.ebuild squeezecenter-7.0-r1.ebuild squeezecenter-7.0.ebuild
Date: Sun, 03 Aug 2008 04:35:33
Message-Id: E1KPVJZ-0007HF-JS@stork.gentoo.org
1 lavajoe 08/08/03 04:35:29
2
3 Modified: ChangeLog
4 Added: squeezecenter-7.1.0.ebuild
5 Removed: squeezecenter-7.0.2_beta20080530.ebuild
6 squeezecenter-7.0-r1.ebuild
7 squeezecenter-7.0.ebuild
8 Log:
9 Add version 7.1.0; remove old versions
10 (Portage version: 2.1.4.4)
11
12 Revision Changes Path
13 1.20 media-sound/squeezecenter/ChangeLog
14
15 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/squeezecenter/ChangeLog?rev=1.20&view=markup
16 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/squeezecenter/ChangeLog?rev=1.20&content-type=text/plain
17 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/squeezecenter/ChangeLog?r1=1.19&r2=1.20
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v
22 retrieving revision 1.19
23 retrieving revision 1.20
24 diff -u -r1.19 -r1.20
25 --- ChangeLog 29 Jul 2008 22:29:00 -0000 1.19
26 +++ ChangeLog 3 Aug 2008 04:35:28 -0000 1.20
27 @@ -1,6 +1,18 @@
28 # ChangeLog for media-sound/squeezecenter
29 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v 1.19 2008/07/29 22:29:00 lavajoe Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/ChangeLog,v 1.20 2008/08/03 04:35:28 lavajoe Exp $
32 +
33 +*squeezecenter-7.1.0 (03 Aug 2008)
34 +
35 + 03 Aug 2008; Joe Peterson <lavajoe@g.o>
36 + +files/filepaths-7.1-gentoo.patch, +files/mDNSResponder-7.1-gentoo.patch,
37 + +files/Gentoo-plugins-README.txt, +files/avahi-squeezecenter.service,
38 + +files/dbcreate-gentoo.sql, +files/dbdrop-gentoo.sql,
39 + +files/squeezecenter.conf.d, +files/squeezecenter.init.d,
40 + +files/squeezecenter.logrotate.d, +files/squeezecenter.prefs,
41 + -squeezecenter-7.0.ebuild, -squeezecenter-7.0-r1.ebuild,
42 + -squeezecenter-7.0.2_beta20080530.ebuild, +squeezecenter-7.1.0.ebuild:
43 + Add version 7.1.0; remove old versions
44
45 29 Jul 2008; Joe Peterson <lavajoe@g.o> metadata.xml:
46 Add local use flags to metadata
47
48
49
50 1.1 media-sound/squeezecenter/squeezecenter-7.1.0.ebuild
51
52 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/squeezecenter/squeezecenter-7.1.0.ebuild?rev=1.1&view=markup
53 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/squeezecenter/squeezecenter-7.1.0.ebuild?rev=1.1&content-type=text/plain
54
55 Index: squeezecenter-7.1.0.ebuild
56 ===================================================================
57 # Copyright 1999-2008 Gentoo Foundation
58 # Distributed under the terms of the GNU General Public License v2
59 # $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/squeezecenter-7.1.0.ebuild,v 1.1 2008/08/03 04:35:29 lavajoe Exp $
60
61 inherit eutils
62
63 MAJOR_VER="${PV:0:3}"
64 MINOR_VER="${PV:4:1}"
65 SRC_DIR="SqueezeCenter_v${MAJOR_VER}.${MINOR_VER}"
66 MY_P="squeezecenter-${MAJOR_VER}-noCPAN"
67
68 DESCRIPTION="Logitech SqueezeCenter music server"
69 HOMEPAGE="http://www.slimdevices.com/pi_features.html"
70 SRC_URI="http://www.slimdevices.com/downloads/${SRC_DIR}/${MY_P}.tgz"
71 LICENSE="GPL-2"
72 SLOT="0"
73 KEYWORDS="~amd64 ~ppc ~x86"
74 IUSE="lame wavpack musepack alac ogg bonjour flac avahi"
75
76 # Note: dev-perl/module-build necessary because of SC bug#5882
77 # (http://bugs.slimdevices.com/show_bug.cgi?id=5882).
78 DEPEND="
79 dev-perl/File-Which
80 dev-perl/module-build
81 virtual/logger
82 virtual/mysql
83 avahi? ( net-dns/avahi )
84 ogg? ( media-sound/sox )
85 "
86 # Note: dev-perl/GD necessary because of SC bug#6143
87 # (http://bugs.slimdevices.com/show_bug.cgi?id=6143).
88 RDEPEND="${DEPEND}
89 >=dev-lang/perl-5.8.8
90 >=dev-perl/GD-2.35
91 >=app-admin/sudo-1.6.8
92 alac? ( media-sound/alac_decoder )
93 lame? ( media-sound/lame )
94 wavpack? ( media-sound/wavpack )
95 bonjour? ( net-misc/mDNSResponder )
96 flac? ( media-libs/flac )
97 musepack? ( media-sound/musepack-tools )
98 "
99
100 S="${WORKDIR}/${MY_P}"
101
102 PREFS="/var/lib/squeezecenter/prefs/squeezecenter.prefs"
103 LIVE_PREFS="/var/lib/squeezecenter/prefs/server.prefs"
104 DOCDIR="/usr/share/doc/squeezecenter-${MAJOR_VER}.${MINOR_VER}"
105 SHAREDIR="/usr/share/squeezecenter"
106 LIBDIR="/usr/lib/squeezecenter"
107 DBUSER="squeezecenter"
108 OLDPLUGINSDIR=/opt/squeezecenter/Plugins
109 NEWPLUGINSDIR=/var/lib/squeezecenter/Plugins
110
111 pkg_setup() {
112 # Sox has optional OGG support, so make sure it has been built that way
113 if use ogg; then
114 if ! built_with_use media-sound/sox ogg; then
115 eerror "media-sound/sox not built with USE=ogg"
116 die "media-sound/sox not built with USE=ogg"
117 fi
118 fi
119
120 # Create the user and group if not already present
121 enewgroup squeezecenter || die
122 enewuser squeezecenter -1 -1 "/dev/null" squeezecenter || die
123 }
124
125 src_unpack() {
126 unpack ${A}
127 cd "${S}"
128
129 # Apply patches
130 epatch "${FILESDIR}/mDNSResponder-${MAJOR_VER}-gentoo.patch"
131 epatch "${FILESDIR}/filepaths-${MAJOR_VER}-gentoo.patch"
132 }
133
134 src_compile() {
135 einfo "Building required Perl modules (some warnings are normal here) ..."
136 mkdir "${T}/sc_compile"
137 echo -e "\n${S}\n${T}/sc_compile" | Bin/build-perl-modules.pl || die "Unable to build Perl modules"
138 }
139
140 src_install() {
141
142 # The main Perl executables
143 exeinto /usr/sbin
144 newexe slimserver.pl squeezecenter-server
145 newexe scanner.pl squeezecenter-scanner
146
147 # Get the Perl package name and version
148 eval `perl '-V:package'`
149 eval `perl '-V:version'`
150
151 # The server Perl modules
152 dodir "/usr/lib/${package}/vendor_perl/${version}"
153 cp -r Slim "${D}/usr/lib/${package}/vendor_perl/${version}"
154
155 # Various directories of architecture-independent static files
156 dodir "${SHAREDIR}"
157 cp -r Firmware "${D}/${SHAREDIR}"
158 cp -r Graphics "${D}/${SHAREDIR}"
159 cp -r HTML "${D}/${SHAREDIR}"
160 cp -r IR "${D}/${SHAREDIR}"
161 cp -r SQL "${D}/${SHAREDIR}"
162 cp -r CPAN "${D}/${SHAREDIR}"
163
164 # Architecture-dependent static files
165 dodir "${LIBDIR}"
166 cp -r lib/* "${D}/${LIBDIR}"
167
168 # Strings and version identification
169 insinto "${SHAREDIR}"
170 doins strings.txt
171 doins revision.txt
172
173 # Documentation
174 dodoc Changelog*.html
175 dodoc Installation.txt
176 dodoc License*.txt
177 newdoc "${FILESDIR}/Gentoo-plugins-README.txt" Gentoo-plugins-README.txt
178
179 # Configuration files
180 insinto /etc/squeezecenter
181 doins convert.conf
182 doins types.conf
183 doins modules.conf
184
185 # Install init scripts
186 newconfd "${FILESDIR}/squeezecenter.conf.d" squeezecenter
187 newinitd "${FILESDIR}/squeezecenter.init.d" squeezecenter
188
189 # Install default preferences
190 insinto /var/lib/squeezecenter/prefs
191 newins "${FILESDIR}/squeezecenter.prefs" squeezecenter.prefs
192 fowners squeezecenter:squeezecenter /var/lib/squeezecenter/prefs
193 fperms 770 /var/lib/squeezecenter/prefs
194
195 # Install the SQL configuration scripts
196 insinto "${SHAREDIR}/SQL/mysql"
197 doins "${FILESDIR}/dbdrop-gentoo.sql"
198 doins "${FILESDIR}/dbcreate-gentoo.sql"
199
200 # Initialize run directory (where the PID file lives)
201 dodir /var/run/squeezecenter
202 fowners squeezecenter:squeezecenter /var/run/squeezecenter
203 fperms 770 /var/run/squeezecenter
204
205 # Initialize server cache directory
206 dodir /var/lib/squeezecenter/cache
207 fowners squeezecenter:squeezecenter /var/lib/squeezecenter/cache
208 fperms 770 /var/lib/squeezecenter/cache
209
210 # Initialize the log directory
211 dodir /var/log/squeezecenter
212 fowners squeezecenter:squeezecenter /var/log/squeezecenter
213 fperms 770 /var/log/squeezecenter
214 touch "${D}/var/log/squeezecenter/server.log"
215 touch "${D}/var/log/squeezecenter/scanner.log"
216 touch "${D}/var/log/squeezecenter/perfmon.log"
217 fowners squeezecenter:squeezecenter /var/log/squeezecenter/server.log
218 fowners squeezecenter:squeezecenter /var/log/squeezecenter/scanner.log
219 fowners squeezecenter:squeezecenter /var/log/squeezecenter/perfmon.log
220
221 # Initialise the user-installed plugins directory
222 dodir "${NEWPLUGINSDIR}"
223
224 # Install logrotate support
225 insinto /etc/logrotate.d
226 newins "${FILESDIR}/squeezecenter.logrotate.d" squeezecenter
227
228 # Install Avahi support (if USE flag is set)
229 if use avahi; then
230 insinto /etc/avahi/services
231 newins "${FILESDIR}/avahi-squeezecenter.service" squeezecenter.service
232 fi
233 }
234
235 sc_starting_instr() {
236 elog "SqueezeCenter can be started with the following command:"
237 elog "\t/etc/init.d/squeezecenter start"
238 elog ""
239 elog "SqueezeCenter can be automatically started on each boot with the"
240 elog "following command:"
241 elog "\trc-update add squeezecenter default"
242 elog ""
243 elog "You might want to examine and modify the following configuration"
244 elog "file before starting SqueezeCenter:"
245 elog "\t/etc/conf.d/squeezecenter"
246 elog ""
247
248 # Discover the port number from the preferences, but if it isn't there
249 # then report the standard one.
250 httpport=$(gawk '$1 == "httpport:" { print $2 }' "${ROOT}${LIVE_PREFS}" 2>/dev/null)
251 elog "You may access and configure SqueezeCenter by browsing to:"
252 elog "\thttp://localhost:${httpport:-9000}/"
253 }
254
255 pkg_postinst() {
256 # FLAC and LAME are quite useful (but not essential) for SqueezeCenter -
257 # if they're not enabled then make sure the user understands that.
258 if ! use flac; then
259 ewarn "'flac' USE flag is not set. Although not essential, FLAC is required"
260 ewarn "for playing lossless WAV and FLAC (for Squeezebox 1), and for"
261 ewarn "playing other less common file types (if you have a Squeezebox 2, 3,"
262 ewarn "Receiver or Transporter)."
263 ewarn "For maximum flexibility you are recommended to set the 'flac' USE flag".
264 ewarn ""
265 fi
266 if ! use lame; then
267 ewarn "'lame' USE flag is not set. Although not essential, LAME is"
268 ewarn "required if you want to limit the bandwidth your Squeezebox or"
269 ewarn "Transporter uses when streaming audio."
270 ewarn "For maximum flexibility you are recommended to set the 'lame' USE flag".
271 ewarn ""
272 fi
273
274 # Album art requires PNG and JPEG support from GD, so if it's not there
275 # then warn the user. It's not mandatory as the user may not be using
276 # album art.
277 if ! built_with_use dev-perl/GD jpeg || \
278 ! built_with_use dev-perl/GD png || \
279 ! built_with_use media-libs/gd jpeg || \
280 ! built_with_use media-libs/gd png; then
281 ewarn "For correct operation of album art through SqueezeCenter's web"
282 ewarn "interface the GD library and Perl module must be built with PNG"
283 ewarn "and JPEG support. If necessary you can add the following lines"
284 ewarn "to the file /etc/portage/package.use:"
285 ewarn "\tdev-perl/GD jpeg png"
286 ewarn "\tmedia-libs/gd jpeg png"
287 ewarn "And then rebuild those packages with:"
288 ewarn "\temerge --newuse dev-perl/GD media-libs/gd"
289 ewarn ""
290 fi
291
292 # Point user to database configuration step
293 elog "If this is a new installation of SqueezeCenter then the database"
294 elog "must be configured prior to use. This can be done by running the"
295 elog "following command:"
296 elog "\temerge --config =${CATEGORY}/${PF}"
297
298 # Remind user to configure Avahi if necessary
299 if use avahi; then
300 elog ""
301 elog "Avahi support installed. Remember to edit the folowing file if"
302 elog "you run SqueezeCenter's web interface on a port other than 9000:"
303 elog "\t/etc/avahi/services/squeezecenter.service"
304 fi
305
306 elog ""
307 sc_starting_instr
308 }
309
310 sc_remove_db_prefs() {
311 MY_PREFS=$1
312
313 einfo "Configuring SqueezeCenter database preferences (${MY_PREFS}) ..."
314 TMPPREFS="${T}"/squeezecenter-prefs-$$
315 touch "${ROOT}${MY_PREFS}"
316 sed -e '/^dbusername:/d' -e '/^dbpassword:/d' -e '/^dbsource:/d' < "${ROOT}${MY_PREFS}" > "${TMPPREFS}"
317 mv "${TMPPREFS}" "${ROOT}${MY_PREFS}"
318 chown squeezecenter:squeezecenter "${ROOT}${MY_PREFS}"
319 chmod 660 "${ROOT}${MY_PREFS}"
320 }
321
322 sc_update_prefs() {
323 MY_PREFS=$1
324 MY_DBUSER=$2
325 MY_DBUSER_PASSWD=$3
326
327 echo "dbusername: ${MY_DBUSER}" >> "${ROOT}${MY_PREFS}"
328 echo "dbpassword: ${MY_DBUSER_PASSWD}" >> "${ROOT}${MY_PREFS}"
329 echo "dbsource: dbi:mysql:database=${MY_DBUSER};mysql_socket=/var/run/mysqld/mysqld.sock" >> "${ROOT}${MY_PREFS}"
330 }
331
332 pkg_config() {
333 einfo "Press ENTER to create the SqueezeCenter database and set proper"
334 einfo "permissions on it. You will be prompted for the MySQL 'root' user's"
335 einfo "password during this process (note that the MySQL 'root' user is"
336 einfo "independent of the Linux 'root' user and so may have a different"
337 einfo "password)."
338 einfo ""
339 einfo "If you already have a SqueezeCenter database set up then this"
340 einfo "process will clear the existing database (your music files will not,"
341 einfo "however, be affected)."
342 einfo ""
343 einfo "Alternatively, press Control-C to abort now..."
344 read
345
346 # Get the MySQL root password from the user (not echoed to the terminal)
347 einfo "The MySQL 'root' user password is required to create the"
348 einfo "SqueezeCenter user and database."
349 DONE=0
350 while [ $DONE -eq 0 ]; do
351 trap "stty echo; echo" EXIT
352 stty -echo
353 read -p "MySQL root password: " ROOT_PASSWD; echo
354 stty echo
355 trap ":" EXIT
356 echo quit | mysql --user=root --password="${ROOT_PASSWD}" >/dev/null 2>&1 && DONE=1
357 if [ $DONE -eq 0 ]; then
358 eerror "Incorrect MySQL root password, or MySQL is not running"
359 fi
360 done
361
362 # Get the new password for the SqueezeCenter MySQL database user, and
363 # have it re-entered to confirm it. We should trivially check it's not
364 # the same as the MySQL root password.
365 einfo "A new MySQL user will be added to own the SqueezeCenter database."
366 einfo "Please enter the password for this new user (${DBUSER})."
367 DONE=0
368 while [ $DONE -eq 0 ]; do
369 trap "stty echo; echo" EXIT
370 stty -echo
371 read -p "MySQL ${DBUSER} password: " DBUSER_PASSWD; echo
372 stty echo
373 trap ":" EXIT
374 if [ -z "$DBUSER_PASSWD" ]; then
375 eerror "The password should not be blank; try again."
376 elif [ "$DBUSER_PASSWD" == "$ROOT_PASSWD" ]; then
377 eerror "The ${DBUSER} password should be different to the root password"
378 else
379 DONE=1
380 fi
381 done
382
383 # Drop the existing database and user - note we don't care about errors
384 # from this as it probably just indicates that the database wasn't
385 # yet present.
386 einfo "Dropping old SqueezeCenter database and user ..."
387 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
388
389 # Drop and create the SqueezeCenter user and database.
390 einfo "Creating SqueezeCenter MySQL user and database (${DBUSER}) ..."
391 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"
392
393 # Remove the existing MySQL preferences from SqueezeCenter (if any).
394 sc_remove_db_prefs "${PREFS}"
395 [ -f "${LIVE_PREFS}" ] && sc_remove_db_prefs ${LIVE_PREFS}
396
397 # Insert the external MySQL configuration into the preferences.
398 sc_update_prefs "${PREFS}" "${DBUSER}" "${DBUSER_PASSWD}"
399 [ -f "${LIVE_PREFS}" ] && sc_update_prefs "${LIVE_PREFS}" "${DBUSER}" "${DBUSER_PASSWD}"
400
401 # Phew - all done. Give some tips on what to do now.
402 einfo "Database configuration complete."
403 einfo ""
404 sc_starting_instr
405 }
406
407 pkg_preinst() {
408 # Warn the user if there are old plugins that he may need to migrate
409 if [ -d "${OLDPLUGINSDIR}" ]; then
410 if [ ! -z "$(ls ${OLDPLUGINSDIR})" ]; then
411 ewarn "Note: It appears that plugins are installed in the old location of:"
412 ewarn "${OLDPLUGINSDIR}"
413 ewarn "If these are to be used then they must be migrated to the new location:"
414 ewarn "${NEWPLUGINSDIR}"
415 ewarn ""
416 fi
417 fi
418 }