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