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