summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-sound/squeezeboxserver/files/build-modules-7.5.1.sh')
-rwxr-xr-xmedia-sound/squeezeboxserver/files/build-modules-7.5.1.sh65
1 files changed, 65 insertions, 0 deletions
diff --git a/media-sound/squeezeboxserver/files/build-modules-7.5.1.sh b/media-sound/squeezeboxserver/files/build-modules-7.5.1.sh
new file mode 100755
index 000000000000..6da66cdf4cf0
--- /dev/null
+++ b/media-sound/squeezeboxserver/files/build-modules-7.5.1.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+#
+# $Id: build-modules-7.5.1.sh,v 1.3 2011/06/05 16:06:47 lavajoe Exp $
+#
+# This script builds all binary Perl modules required by Squeezebox Server.
+
+DISTDIR="$1"; shift
+D="$1"; shift
+
+# Build dir
+BUILD=$PWD
+
+# Require modules to pass tests
+RUN_TESTS=1
+
+FLAGS=""
+
+# $1 = module to build
+# $2 = Makefile.PL arg(s)
+function build_module {
+ tar zxvf $DISTDIR/SqueezeboxServer-$1.tar.gz || exit 1
+ cd $1
+
+ perl Makefile.PL PREFIX=$D $2
+ if [ $RUN_TESTS -eq 1 ]; then
+ make test
+ else
+ make
+ fi
+ if [ $? != 0 ]; then
+ if [ $RUN_TESTS -eq 1 ]; then
+ echo "make test failed, aborting"
+ else
+ echo "make failed, aborting"
+ fi
+ exit $?
+ fi
+ make install || exit 1
+ make clean || exit 1
+
+ cd ..
+ rm -rf $1
+}
+
+function build_all {
+ export PERL_MM_USE_DEFAULT=1
+ RUN_TESTS=0
+ build_module EV-3.8
+ RUN_TESTS=1
+ export PERL_MM_USE_DEFAULT=
+}
+
+# Build a single module if requested, or all
+if [ $1 ]; then
+ build $1
+else
+ build_all
+fi
+
+# Reset PERL5LIB
+export PERL5LIB=
+
+# clean out useless .bs/.packlist files, etc
+find $BUILD -name '*.bs' -exec rm -f {} \;
+find $BUILD -name '*.packlist' -exec rm -f {} \;