2001-08-19 03:42:36 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-05-12 14:13:38 +04:00
|
|
|
# makesrcdist - make a distribution of FLTK.
|
2001-08-19 03:42:36 +04:00
|
|
|
#
|
2014-10-30 15:42:54 +03:00
|
|
|
# There are 3 different modes of operation, dependent on commandline arguments:
|
|
|
|
#
|
|
|
|
# (1) Create snapshot:
|
|
|
|
#
|
|
|
|
# makesrcdist [snapshot]
|
|
|
|
#
|
|
|
|
# Use no arguments or "snapshot" (verbatim).
|
|
|
|
#
|
|
|
|
# (2) Create distribution tarballs for test and verification:
|
|
|
|
#
|
|
|
|
# makesrcdist <version>
|
|
|
|
#
|
|
|
|
# Use a version number as argument, e.g. "1.3.3" or "1.3.4rc2".
|
|
|
|
# This can be used for local testing.
|
|
|
|
#
|
2018-10-18 19:21:45 +03:00
|
|
|
# Note: the release tarballs will be created from the current
|
|
|
|
# 'HEAD' revision of your local Git repository.
|
|
|
|
#
|
2014-10-30 15:42:54 +03:00
|
|
|
# (3) Create distribution tarballs (final):
|
|
|
|
#
|
|
|
|
# makesrcdist <version> tag
|
|
|
|
#
|
2018-10-18 19:21:45 +03:00
|
|
|
# Same as (2), but create Git tag with version number.
|
2014-10-30 15:42:54 +03:00
|
|
|
# Enter "tag" (verbatim) as 2nd argument.
|
2018-10-18 19:21:45 +03:00
|
|
|
# This will create the Git tag "release-<version>" for the
|
|
|
|
# current revision in the (local) FLTK Git repository and export the
|
2014-10-30 15:42:54 +03:00
|
|
|
# FLTK sources from this tag for creation of distribution files.
|
|
|
|
#
|
2018-10-18 19:21:45 +03:00
|
|
|
# Note: You need to 'git push' the Git tag manually when you
|
|
|
|
# are satisfied with the result. You may use:
|
|
|
|
# $ git push origin release-<version>
|
|
|
|
# where '<version>' is the version number (argument #1)
|
|
|
|
#
|
2014-10-30 15:42:54 +03:00
|
|
|
# Note: define FLTK_TAR if you want to use a different compatible tar
|
|
|
|
# command than "tar", e.g. to use "gtar" (bash syntax):
|
|
|
|
# $ export FLTK_TAR="gtar"
|
|
|
|
#
|
|
|
|
|
|
|
|
TAR="tar"
|
|
|
|
if test "x$FLTK_TAR" != "x"; then
|
|
|
|
TAR="$FLTK_TAR"
|
|
|
|
fi
|
|
|
|
|
2018-10-18 19:21:45 +03:00
|
|
|
# These are the release and snapshot download URL's currently in use:
|
2014-10-30 15:42:54 +03:00
|
|
|
|
2019-02-12 16:07:53 +03:00
|
|
|
DOWNLOAD='https://www.fltk.org/pub/fltk'
|
|
|
|
SNAPSHOT='https://www.fltk.org/pub/fltk/snapshots'
|
2018-10-18 19:21:45 +03:00
|
|
|
|
|
|
|
DATE="`date +'%Y%m%d'`"
|
|
|
|
|
|
|
|
# VS = short version number ('major.minor'), for instance '1.4'.
|
|
|
|
# Note: VS is used only for snapshot generation
|
2021-02-20 15:45:47 +03:00
|
|
|
# fltk_version = full version number w/o 'rcN' (from file fltk_version.dat)
|
2018-10-18 19:21:45 +03:00
|
|
|
|
2021-02-20 15:45:47 +03:00
|
|
|
fltk_version="`cat fltk_version.dat`"
|
|
|
|
VS="`echo $fltk_version | cut -f 1-2 -d '.'`"
|
2001-08-19 03:42:36 +04:00
|
|
|
|
|
|
|
echo "Getting distribution..."
|
|
|
|
|
2014-10-30 15:42:54 +03:00
|
|
|
if test $# = 0 -o "x$1" = "xsnapshot"; then
|
2018-10-18 19:21:45 +03:00
|
|
|
echo Getting snapshot revision...
|
|
|
|
rev="`git rev-parse --short=8 HEAD`"
|
2019-02-12 16:07:53 +03:00
|
|
|
version="${VS}-${rev}"
|
2018-10-18 19:21:45 +03:00
|
|
|
fileversion="${VS}.x-${DATE}-$rev"
|
2014-10-30 15:42:54 +03:00
|
|
|
fileurl="$SNAPSHOT/fltk-$fileversion.tar.gz"
|
2001-08-19 03:42:36 +04:00
|
|
|
else
|
2010-12-29 20:08:28 +03:00
|
|
|
if test ! -e "documentation/html/"; then
|
2011-01-04 21:28:01 +03:00
|
|
|
echo "ERROR: Please generate the HTML documentation before distributing:"
|
|
|
|
echo " autoconf"
|
|
|
|
echo " ./configure"
|
2011-01-05 15:55:10 +03:00
|
|
|
echo " cd documentation; make dist"
|
2010-12-29 20:08:28 +03:00
|
|
|
exit
|
2011-01-04 22:06:02 +03:00
|
|
|
fi
|
2011-01-04 21:28:01 +03:00
|
|
|
if test ! -e "documentation/fltk.pdf"; then
|
|
|
|
echo "ERROR: Please generate the PDF documentation before distributing:"
|
|
|
|
echo " autoconf"
|
|
|
|
echo " ./configure"
|
2011-01-05 15:55:10 +03:00
|
|
|
echo " cd documentation; make dist"
|
2011-01-04 21:28:01 +03:00
|
|
|
exit
|
2011-01-04 22:06:02 +03:00
|
|
|
fi
|
2006-01-15 21:02:44 +03:00
|
|
|
rev="1"
|
2001-08-19 04:09:06 +04:00
|
|
|
version=$1
|
2006-01-15 21:02:44 +03:00
|
|
|
fileversion=$1
|
2014-10-30 15:42:54 +03:00
|
|
|
fileurl="$DOWNLOAD/$version/fltk-$fileversion-source.tar.gz"
|
|
|
|
|
2019-02-12 16:07:53 +03:00
|
|
|
if test "x$2" = "xtag"; then
|
2018-10-18 19:21:45 +03:00
|
|
|
echo "Creating Git tag 'release-$version' ..."
|
2019-02-12 16:07:53 +03:00
|
|
|
git tag -a -m "Release $version" release-$version || exit 1
|
2014-10-30 15:42:54 +03:00
|
|
|
fi
|
2001-08-19 04:09:06 +04:00
|
|
|
fi
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2019-02-12 16:07:53 +03:00
|
|
|
# Debug:
|
|
|
|
# echo "fltk_version = $fltk_version"
|
|
|
|
# echo "version = $version"
|
|
|
|
# echo "fileversion = $fileversion"
|
|
|
|
# echo "fileurl = $fileurl"
|
|
|
|
|
|
|
|
echo Exporting $fltk_version to /tmp/fltk-$version/...
|
2006-01-15 21:02:44 +03:00
|
|
|
rm -rf /tmp/fltk-$version
|
2018-10-18 19:21:45 +03:00
|
|
|
mkdir /tmp/fltk-$version
|
|
|
|
git archive --format=tar HEAD | $TAR -C /tmp/fltk-$version -x --
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2014-10-30 15:42:54 +03:00
|
|
|
if test $# != 0 -a "x$1" != "xsnapshot"; then
|
2011-01-04 22:12:44 +03:00
|
|
|
echo "Copying HTML and PDF documentation..."
|
2010-12-29 20:08:28 +03:00
|
|
|
cp -r documentation/html /tmp/fltk-$version/documentation/
|
2011-01-04 22:12:44 +03:00
|
|
|
cp documentation/fltk.pdf /tmp/fltk-$version/documentation/
|
2010-12-29 20:08:28 +03:00
|
|
|
fi
|
|
|
|
|
2006-01-15 21:02:44 +03:00
|
|
|
echo Applying version number...
|
|
|
|
cd /tmp/fltk-$version
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2006-01-15 21:02:44 +03:00
|
|
|
sed -e '1,$s/@VERSION@/'$version'/' \
|
|
|
|
-e '1,$s/@RELEASE@/'$rev'/' \
|
2019-02-12 16:07:53 +03:00
|
|
|
-e '1,$s#^Source:.*#Source: '$fileurl'#' \
|
2006-01-15 21:02:44 +03:00
|
|
|
<fltk.spec.in >fltk.spec
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2006-01-15 21:02:44 +03:00
|
|
|
echo Creating configure script...
|
|
|
|
autoconf -f
|
2002-08-25 15:20:46 +04:00
|
|
|
|
2013-09-24 13:10:04 +04:00
|
|
|
echo Creating config.guess and config.sub \(ignore any other errors\)...
|
2019-02-12 16:07:53 +03:00
|
|
|
automake --add-missing --copy 2>/dev/null
|
2013-09-24 13:10:04 +04:00
|
|
|
|
2006-01-15 21:02:44 +03:00
|
|
|
echo Cleaning developer files...
|
2010-12-29 18:54:21 +03:00
|
|
|
rm -rf OpenGL autom4te* bc5 config forms glut images packages themes
|
2001-08-19 03:42:36 +04:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
2014-10-30 15:42:54 +03:00
|
|
|
if test $# != 0 -a "x$1" != "xsnapshot"; then
|
2010-12-29 20:08:28 +03:00
|
|
|
echo "Making HTML docs distribution..."
|
2014-10-30 15:42:54 +03:00
|
|
|
$TAR czf fltk-$fileversion-docs-html.tar.gz fltk-$version/documentation/html/
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2010-12-29 20:08:28 +03:00
|
|
|
echo "Making PDF docs distribution..."
|
2014-10-30 15:42:54 +03:00
|
|
|
$TAR czf fltk-$fileversion-docs-pdf.tar.gz fltk-$version/documentation/fltk.pdf
|
2010-12-29 20:08:28 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Removing documentation..."
|
|
|
|
rm -rf fltk-$version/documentation/html/
|
|
|
|
rm -f fltk-$version/documentation/fltk.pdf
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2019-02-12 16:07:53 +03:00
|
|
|
echo "Making UNIX (.tar.gz) distribution..."
|
2014-10-30 15:42:54 +03:00
|
|
|
$TAR czf fltk-$fileversion-source.tar.gz fltk-$version
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2019-02-12 16:07:53 +03:00
|
|
|
echo "Making UNIX (.tar.bz2) distribution..."
|
|
|
|
$TAR cjf fltk-$fileversion-source.tar.bz2 fltk-$version
|
2001-08-19 03:42:36 +04:00
|
|
|
|
2019-02-12 16:07:53 +03:00
|
|
|
# echo "Making Windows (.zip) distribution..."
|
|
|
|
# rm -f fltk-$fileversion-source.zip
|
|
|
|
# zip -r9 fltk-$fileversion-source.zip fltk-$version
|
2001-08-19 03:42:36 +04:00
|
|
|
|
|
|
|
echo "Removing distribution directory..."
|
|
|
|
|
|
|
|
rm -rf fltk-$version
|
|
|
|
|
2019-02-12 16:07:53 +03:00
|
|
|
# Create MD5 sums
|
|
|
|
|
|
|
|
out="`pwd`/fltk-$fileversion-md5sums.txt"
|
|
|
|
echo "Creating MD5 sums in $out"
|
|
|
|
rm -f $out
|
|
|
|
touch $out
|
|
|
|
|
|
|
|
# make sure the order is source - html - pdf
|
|
|
|
|
|
|
|
for f in source docs-html docs-pdf; do
|
|
|
|
if [ -f fltk-$fileversion-$f.tar.bz2 ] ; then
|
|
|
|
md5sum fltk-$fileversion-$f.tar.bz2 >> $out
|
|
|
|
fi
|
|
|
|
if [ -f fltk-$fileversion-$f.tar.gz ] ; then
|
|
|
|
md5sum fltk-$fileversion-$f.tar.gz >> $out
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
sed -e"s# # $fltk_version fltk/$fltk_version/#" -i $out
|
|
|
|
|
2018-10-18 19:21:45 +03:00
|
|
|
if test "x$2" = "xtag"; then
|
|
|
|
echo ""
|
|
|
|
echo "Don't forget to push the Git tag"
|
2019-02-12 16:07:53 +03:00
|
|
|
echo "(assuming your remote Git repository is 'origin'):"
|
2018-10-18 19:21:45 +03:00
|
|
|
echo ""
|
2019-02-12 16:07:53 +03:00
|
|
|
echo "Use: \$ git push origin release-$version"
|
2018-10-18 19:21:45 +03:00
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
2003-05-26 20:23:08 +04:00
|
|
|
echo "Done!"
|