Change getmuxlist back to bash script and make python soft dep. Also some minor improvements to bundle code.

This commit is contained in:
Adam Sutton 2012-09-03 11:33:03 +01:00
parent ebf95d7951
commit 4f5f23a6d7
4 changed files with 31 additions and 32 deletions

View file

@ -34,6 +34,13 @@ CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
LDFLAGS += -lrt -ldl -lpthread
#
# Other config
#
BUNDLE_FLAGS-${CONFIG_ZLIB} = -z
BUNDLE_FLAGS = ${BUNDLE_FLAGS-yes}
#
# Binaries/Scripts
#
@ -243,4 +250,4 @@ $(BUILDDIR)/bundle.o: $(BUILDDIR)/bundle.c
$(BUILDDIR)/bundle.c:
@mkdir -p $(dir $@)
$(MKBUNDLE) -o $@ -d ${BUILDDIR}/bundle.d -z $(BUNDLES)
$(MKBUNDLE) -o $@ -d ${BUILDDIR}/bundle.d $(BUNDLE_FLAGS) $(BUNDLES)

16
configure vendored
View file

@ -47,10 +47,8 @@ check_cc_option sse2
#
# Python
#
check_py || die 'No PYTHON binary found'
check_py_import zlib pyzlib || die "Python module missing: zlib"
check_py_import tarfile pytar || die "Python module missing: tarfile"
# Note: the above could/should be made optional
check_py || echo 'WARN: no python binary found'
check_py_import gzip pygzip
#
# SSL
@ -75,11 +73,9 @@ fi
#
# Bundling
#
if enabled_or_auto bundle; then
if enabled zlib; then
enable bundle
elif enabled bundle; then
die "Zlib development support not found (use --disable-bundle)"
if enabled bundle; then
if enabled zlib && ! enabled pygzip; then
die "Python gzip module not found (use --disable-zlib or --disable-bundle)"
fi
fi
@ -100,7 +96,7 @@ fi
if enabled linuxdvb && enabled dvbscan; then
if [ ! -d ${ROOTDIR}/data/dvb-scan ]; then
echo -n "Fetching dvb-scan files... "
${PYTHON} ${ROOTDIR}/support/getmuxlist &> /dev/null || die "Failed to fetch dvb-scan files (use --disable-dvbscan to skip)"
${ROOTDIR}/support/getmuxlist &> /dev/null || die "Failed to fetch dvb-scan files (use --disable-dvbscan to skip)"
echo "done"
fi
fi

View file

@ -364,7 +364,7 @@ fb_file *fb_open2
/* Inflate the file */
if (fb->f.orig != -1 && decompress) {
#if ENABLE_BUNDLE
#if (ENABLE_ZLIB && ENABLE_BUNDLE)
ret->gzip = 0;
ret->size = fb->f.orig;
ret->buf = _fb_inflate(fb->f.data, fb->f.size, fb->f.orig);

View file

@ -1,30 +1,26 @@
#!/usr/bin/env python
#!/bin/bash
#
# Retrieve the latest dvb-apps scan files
#
import os, sys, shutil, glob, urllib2, tarfile
url = 'http://linuxtv.org/hg/dvb-apps/archive/tip.tar.bz2'
tmp = '/tmp/getmuxlist.%d' % os.getpid()
out = os.path.abspath(os.path.dirname(sys.argv[0]) + '/../data/dvb-scan')
URL=http://linuxtv.org/hg/dvb-apps/archive/tip.tar.bz2
TMP=/tmp/getmuxlist.$$
TVH=$(cd $(dirname $0)/..; pwd)/data/dvb-scan
# Get files
if os.path.exists(tmp):
shutil.rmtree(tmp)
os.makedirs(tmp)
tbz = tmp + '/dvb-apps.tar.bz2'
open(tbz, 'w').write(urllib2.urlopen(url).read())
tp = tarfile.open(tbz)
tp.extractall(tmp)
rm -rf $TMP
mkdir -p $TMP
cd $TMP
(wget -O - -q $URL | tar xj) || (curl $URL | tar xj)
cd dvb-apps*
# Copy to TVH
if os.path.exists(out):
shutil.rmtree(out)
os.makedirs(out)
for d in glob.glob('%s/dvb-apps*/util/scan/*' % tmp):
if os.path.isdir(d):
shutil.move(d, out)
rm -rf $TVH
mkdir -p $TVH
mv ./util/scan/* $TVH
# Cleanup
shutil.rmtree(tmp)
for f in $TVH/*; do
[ -f $f ] && rm -f $f
done
rm -rf $TMP