| 1 |
#!/bin/bash |
| 2 |
. bash_helper_functions |
| 3 |
|
| 4 |
# If the first argument to this script is the word major then the |
| 5 |
# major version number is updated and the minor is set back to 0. |
| 6 |
|
| 7 |
report_failure () |
| 8 |
{ |
| 9 |
echo " **** failed to complete **** " |
| 10 |
exit 1 |
| 11 |
} |
| 12 |
|
| 13 |
|
| 14 |
./testenv_rel || report_failure |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
REVNUM_FILE=.logger_revnum |
| 19 |
CHANGESET_ID=`git rev-parse HEAD` |
| 20 |
|
| 21 |
rm -rf release || report_failure |
| 22 |
mkdir release || report_failure |
| 23 |
|
| 24 |
|
| 25 |
if [ "$1" = "major" ] |
| 26 |
then |
| 27 |
MAJOR_NUM=`echo $MAJOR_NUM+1|bc` |
| 28 |
MINOR_NUM=0 |
| 29 |
else |
| 30 |
MINOR_NUM=`echo $MINOR_NUM+1|bc` |
| 31 |
fi; |
| 32 |
set_dlib_version MAJOR $MAJOR_NUM |
| 33 |
set_dlib_version MINOR $MINOR_NUM |
| 34 |
set_dlib_version PATCH 0 |
| 35 |
|
| 36 |
RELEASE=${MAJOR_NUM}.${MINOR_NUM} |
| 37 |
# Commit changes to the version numbers so that the makedocs script will use them. |
| 38 |
echo Create git tags and commit release |
| 39 |
git commit -a -m "Created release v$RELEASE" || report_failure |
| 40 |
git tag v$RELEASE || report_failure |
| 41 |
|
| 42 |
./makedocs makerel || exit 1 |
| 43 |
|
| 44 |
echo $CHANGESET_ID > $REVNUM_FILE |
| 45 |
set_dlib_version PATCH 99 |
| 46 |
git commit -a -m "Record last changeset and set PATCH version to 99" |
| 47 |
|
| 48 |
|
| 49 |
cd release || report_failure |
| 50 |
RELDIR=`echo dlib-$RELEASE` |
| 51 |
mkdir $RELDIR |
| 52 |
cd $RELDIR || report_failure |
| 53 |
cp -r ../../docs/cache/* . || report_failure |
| 54 |
|
| 55 |
echo Version: $RELEASE >> README.md |
| 56 |
echo "Date: `date`" >> README.md |
| 57 |
echo Git commit ID: $CHANGESET_ID >> README.md |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
WEBPAGE=`echo dlib_webpage-$RELEASE.tar` |
| 62 |
SOURCE_ZIP=`echo $RELDIR.zip` |
| 63 |
SOURCE_TAR=`echo $RELDIR.tar` |
| 64 |
tar -C ../../docs/chm -cf - docs/ documentation.html | tar -xf - || report_failure |
| 65 |
cd .. || report_failure |
| 66 |
|
| 67 |
tar -cf $SOURCE_TAR $RELDIR || report_failure |
| 68 |
# flip everything to MS-DOS line endings |
| 69 |
#find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" -or -name "*.py" | xargs flip -m |
| 70 |
find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" -or -name "*.py" | xargs unix2dos &> /dev/null |
| 71 |
|
| 72 |
zip -r9 $SOURCE_ZIP $RELDIR > /dev/null || report_failure |
| 73 |
tar -C ../docs -cf $WEBPAGE web || report_failure |
| 74 |
bzip2 $SOURCE_TAR || report_failure |
| 75 |
bzip2 $WEBPAGE || report_failure |
| 76 |
|
| 77 |
rm -rf $RELDIR |
| 78 |
|
| 79 |
# Don't make the chm doc file since hhc.exe doesn't run in any copy of wine anymore :( |
| 80 |
#wine ../docs/chm/htmlhelp/hhc.exe ../docs/chm/lib.hhp |
| 81 |
#mv ../docs/chm/help.chm dlib_documentation-$RELEASE.chm || report_failure |
| 82 |
|
| 83 |
|
| 84 |
mkdir v$RELEASE |
| 85 |
#mv dlib_documentation-$RELEASE.chm v$RELEASE |
| 86 |
mv $SOURCE_TAR.bz2 v$RELEASE |
| 87 |
mv $SOURCE_ZIP v$RELEASE |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|