#!/bin/bash module=$1 shift version=$1 shift modulebasedir=$1 shift name="$*" if test -z $module then echo Please specify a module exit 1 fi if test -z "$version" then echo Please specify a version exit 1 fi if test -z "$modulebasedir" then echo "Please specify a module base dir (root of your checkout)" exit 1 fi #if test -z "$name" #then # echo Please specify a release name # exit 1 #fi if test ! -d $modulebasedir/gstreamer then echo $modulebasedir does not contain a "gstreamer" directory exit 1 fi moduledir=$modulebasedir/$module if test ! -e $moduledir/Makefile then echo $moduledir/Makefile not found - run autogen.sh exit 1 fi if test -e $moduledir/$module.doap then # FIXME: we could be smarter, e.g. insert a skeleton entry and spawn an editor grep "$version" "$moduledir/$module.doap" >/dev/null || { echo "No mention of version $version in $module.doap file, please update first." exit 1; } fi # check misc. environment variables we'll be using later if test "x$EDITOR" = "x"; then echo "EDITOR environment variable not set." if [ -x /usr/bin/editor ] ; then echo "Using /usr/bin/editor instead" export EDITOR="/usr/bin/editor" else echo "No /usr/bin/editor either. Giving up." exit 1 fi fi if test "x$REAL_NAME" = "x" ; then echo "REAL_NAME environment variable not set." export REAL_NAME=`git config user.name` if test "x$REAL_NAME" = "x" ; then echo "git config --get user.name not set either" exit 1 else echo "Set REAL_NAME from git config --get user.name to: $REAL_NAME" fi fi if test "x$EMAIL_ADDRESS" = "x" ; then echo "EMAIL_ADDRESS environment variable not set." export EMAIL_ADDRESS=`git config user.email` if test "x$EMAIL_ADDRESS" = "x" ; then echo "git config --get user.email not set either" exit 1 else echo "Set EMAIL_ADDRESS from git config --get user.email to: $EMAIL_ADDRESS" fi fi echo "Updating checkout" pushd $moduledir > /dev/null 2>&1 git pull popd release=src/htdocs/releases/$module/$version template=src/htdocs/releases/$module/template.xml if test ! -e $template then echo "No template $template !" exit 1 fi if test ! -s $release.xml then echo "Creating $release.xml" cp $template $release.xml case $version in *.0 ) sed -i -e 's/a new release/a new feature release/' $release.xml ;; * ) sed -i -e 's/a new release/a new bug-fix release/' $release.xml ;; esac fi echo "Updating $release.xml" perl -i -p -e "s@@$version@" $release.xml if test -n "$name"; then perl -i -p -e "s@@$name@" $release.xml fi # update Changelog cd $moduledir echo "Regenerating ChangeLog in $PWD" # Check CHANGELOG_START tag exists if ! git rev-parse CHANGELOG_START then echo "No CHANGELOG_START tag in module" exit 1 fi cd - pushd $moduledir > /dev/null 2>&1 changelog=ChangeLog python2 common/gen-changelog.py > $changelog git add $changelog popd echo "Updating contributors" changelog=$moduledir/ChangeLog if test ! -e $changelog then echo "No changelog $changelog found" else bin/update-contributors $changelog $release.xml fi echo "Updating bugs" if [ $module == "gst-validate" ]; then product="gst-devtools" sub_component="validate" else product=$module sub_component="" fi python2 bin/bugzilla $product $version GStreamer $release.xml $sub_component # update releases Makefile.am makefileam=src/htdocs/releases/$module/Makefile.am if grep "($version)" $makefileam > /dev/null 2>&1 then echo already changed $makefileam else echo Updating $makefileam perl -i.bak -p -e "s@(releases =)@\$1 $version@" $makefileam fi # Mark for committing git add $makefileam # update configure.ac configureac=$moduledir/configure.ac echo "Press Enter to update configure.ac's version and libtool versioning." read $EDITOR $configureac || { echo "Error editing $configureac" exit 1 } echo "Rebuilding to update version numbering" pushd $moduledir > /dev/null 2>&1 make > out 2>&1 || ( echo "Build failed"; exit 1 ) make win32-update >> out 2>&1 || ( echo "Failed updating win32 config.h"; exit 1 ) popd changelog=$moduledir/ChangeLog if grep "=== release $version ===" $changelog > /dev/null 2>&1 then echo already changed $changelog else echo Updating $changelog mv $changelog $changelog.bak echo "=== release $version ===" > $changelog echo >> $changelog echo "`date +%Y-%m-%d` $REAL_NAME <$EMAIL_ADDRESS>" >> $changelog echo >> $changelog echo -e "\t* configure.ac:" >> $changelog if test -n "$name"; then echo -e "\t releasing $version, \"$name\"" >> $changelog; else echo -e "\t releasing $version" >> $changelog; fi; echo >> $changelog cat $changelog.bak >> $changelog pushd $moduledir > /dev/null 2>&1 git add ChangeLog popd fi echo "Now press Enter to edit the next .xml file and update the list of features and API changes" read $EDITOR $release.xml || { echo "Error editing $release.xml" exit 1 } # Mark for committing git add $release.xml echo "Building website" make # if the next line causes problems for you, you are not building the # web site as per the README/HACKING file with different src/build dir release=htdocs/releases/$module/$version echo "Copying RELEASE" cp $release $moduledir/RELEASE || { echo "Error copying $release $moduledir/RELEASE." echo "Maybe there was a problem creating $release , maybe because" echo "there is a syntax error in $release.xml or some other problem" echo "occured when rebuilding www/htdocs/releases/$module" exit 1 } # FIXME: we should be able to generate most of the NEWS entries automatically # just like we do for the RELEASE file. echo "Press Enter to update NEWS with information from RELEASE" read $EDITOR $moduledir/NEWS $release # we check for the inspect subdir, so this is skipped for e.g. gst-libav if test -d $moduledir/docs/plugins/inspect then echo "Updating plugin documentation files" pushd $moduledir/docs/plugins > /dev/null 2>&1 make update make clean make popd fi echo "Rolling release tarballs" pushd $moduledir > /dev/null 2>&1 make release > "/tmp/gst-make-release-$module-$version.log" 2>&1 || exit 1 popd # not needed any more, make release does that now # mv $moduledir/$module-$version.tar.* data/src/$module tail -n 8 "/tmp/gst-make-release-$module-$version.log" if [ -d $moduledir/docs ]; then echo "Press Enter to update docs on website (or enter 'no' to skip)" read do_commit if test "x$do_commit" != "xno"; then pushd $moduledir/docs > /dev/null 2>&1 make upload > "/tmp/gst-make-upload-$module-$version.log" 2>&1 popd fi else echo "Not updating docs on website - no docs directory" fi if test -d $moduledir/po then echo "Press Enter to commit updates to .po files (or enter 'no' to skip)" read do_commit if test "x$do_commit" != "xno"; then pushd $moduledir > /dev/null 2>&1 git commit -m "Update .po files" po/*.po popd fi fi pushd $moduledir > /dev/null 2>&1 git diff --color > release.diff echo "Press Enter to review the git diff" less -R release.diff popd # print sha256sum and links (again, even though 'make release' does that too) echo echo "=======================================================================" echo cat data/src/$module/$module-$version.tar.xz.sha256sum echo echo "http://gstreamer.freedesktop.org/src/$module/$module-$version.tar.xz" echo echo "=======================================================================" echo