diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2013-04-14 15:17:12 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-04-14 17:12:35 +0100 |
commit | 35495dd48fb1d2c529b712ab01d47a8ee8989af8 (patch) | |
tree | 76ec23cdfe72eab5a5fbc379caca5653a41f977f /update-autogen | |
parent | aed87ae3f28b85b24eff734937b85473828e297d (diff) | |
download | gstreamer-common-35495dd48fb1d2c529b712ab01d47a8ee8989af8.tar.gz |
update-autogen: new tool to generate module autogen.sh files from a common template
Maybe one day an autogen.sh consisting of just 'autoreconf' will
be enough. Until then, let's try to at least use consistent autogen.sh
in the different modules. This tool will hopefully help with that.
The autogen.sh.in template is currently based on the autogen.sh
from core. There are changes in other modules which should probably
be merged into that.
One bug has already been fixed: touch gstreamer-1.0.pot not -0.10.pot
Diffstat (limited to 'update-autogen')
-rwxr-xr-x | update-autogen | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/update-autogen b/update-autogen new file mode 100755 index 0000000..d267556 --- /dev/null +++ b/update-autogen @@ -0,0 +1,48 @@ +#!/bin/bash + +if [ ! -f "common/update-autogen" ]; then + echo "Run ./common/update-autogen from the top-level source directory of a GStreamer module"; + exit 1; +fi + +if ! ls -1 *.doap 2>/dev/null >/dev/null; then + echo "Could not find *.doap file"; + exit 1; +fi + +PACKAGE=`ls -1 *.doap | head -n1 | sed -e 's/.doap$//'` + +#echo "Package: $PACKAGE" + +DIR=`mktemp -d` +if [[ $? != 0 ]]; then + echo "Could not create temp dir"; + exit 1; +fi + +TEMP_AUTOGEN_SH="$DIR/autogen.sh" +echo "\ +#!/bin/sh +# +# $PACKAGE autogen.sh +# +# Run this to generate all the initial makefiles, etc. +# +# This file has been generated from common/autogen.sh.in via common/update-autogen + +" > $TEMP_AUTOGEN_SH + +sed \ + -e "s/@API_VERSION@/1.0/g" \ + -e "s/@PACKAGE@/$PACKAGE/g" \ + -e "s/@SRCFILE@/$PACKAGE.doap/g" < common/autogen.sh.in >> $TEMP_AUTOGEN_SH + +chmod +x $TEMP_AUTOGEN_SH + +mv $TEMP_AUTOGEN_SH autogen.sh || { + echo "Failed to update autogen.sh" + exit 1; +} +rmdir $DIR + +echo "Updated $PACKAGE autogen.sh" |