2011-11-25 17:45:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# This script builds a maintainance LyX distribution according to
|
|
|
|
# the procedure outlined at:
|
|
|
|
# http://wiki.lyx.org/Devel/ReleaseProcedure
|
|
|
|
# It also includes several other tests, to make sure the packages
|
|
|
|
# works as it should.
|
|
|
|
|
2017-08-21 21:16:07 +00:00
|
|
|
# This has been checked with shellcheck. It complains about a lot
|
|
|
|
# of missing quotes, but we know, e.g., that $VERSION will not have
|
|
|
|
# spaces in it. RH chose not to fix that stuff.
|
|
|
|
#
|
|
|
|
# That said, the variables $BASE and $SRCDIR will cause problems if
|
|
|
|
# they have spaces in them, but RH did not fix that, either, since
|
|
|
|
# he thinks spaces in directory names are just a bad idea.
|
|
|
|
|
2011-11-25 17:45:26 +00:00
|
|
|
# A few variables need to be set, here at the top.
|
2012-06-25 13:33:27 +00:00
|
|
|
#
|
|
|
|
# Where we will do our work
|
2011-11-25 17:45:26 +00:00
|
|
|
BASE="/cvs/lyx/lyx-release";
|
2012-06-25 13:33:27 +00:00
|
|
|
# Where our git repository lives
|
|
|
|
SRCDIR="/cvs/lyx/lyx-20";
|
2011-11-25 17:45:26 +00:00
|
|
|
# editor
|
|
|
|
if [ -z "$EDITOR" ]; then EDITOR=vi; fi
|
2012-06-25 13:33:27 +00:00
|
|
|
# Options to make, when we compile
|
2011-11-25 17:45:26 +00:00
|
|
|
MAKEOPTS="-j4";
|
|
|
|
|
2012-06-25 13:33:27 +00:00
|
|
|
# Determine LyX version
|
2011-11-25 17:45:26 +00:00
|
|
|
cd $SRCDIR/
|
2012-11-04 02:10:40 +00:00
|
|
|
VERSION=$(head configure.ac | grep AC_INIT | perl -e 'while (<>) {m/AC_INIT\(LyX,([^,]+)/; print $1;}');
|
2011-11-25 17:45:26 +00:00
|
|
|
|
|
|
|
echo "This is version $VERSION.";
|
|
|
|
echo -n "Ready to build source packages...";
|
|
|
|
read
|
|
|
|
|
2012-06-25 13:33:27 +00:00
|
|
|
echo "Exporting clean tree...";
|
2011-11-25 17:45:26 +00:00
|
|
|
rm -Rf $BASE/lyx-export/
|
2012-06-25 13:33:27 +00:00
|
|
|
git checkout-index -a -f --prefix=$BASE/lyx-export/
|
2011-11-25 17:45:26 +00:00
|
|
|
cd $BASE/lyx-export/
|
|
|
|
./autogen.sh
|
|
|
|
rm -Rf $BASE/lyx-build/
|
|
|
|
mkdir $BASE/lyx-build/
|
|
|
|
cd $BASE/lyx-build/
|
|
|
|
|
2012-06-25 13:33:27 +00:00
|
|
|
echo "Building distribution...";
|
2011-11-25 17:45:26 +00:00
|
|
|
$BASE/lyx-export/configure --enable-build-type=rel
|
|
|
|
if ! make lyxdist; then
|
|
|
|
echo "Couldn't make distribution!";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Packages created:";
|
|
|
|
cp -v lyx-$VERSION.tar.{gz,xz} $BASE;
|
|
|
|
|
|
|
|
echo -n "Ready to build signatures...";
|
|
|
|
read
|
|
|
|
|
|
|
|
gpg -b lyx-$VERSION.tar.gz
|
|
|
|
gpg -b lyx-$VERSION.tar.xz
|
|
|
|
|
|
|
|
echo "Signatures created:"
|
|
|
|
cp -v lyx-$VERSION.tar.*.sig $BASE;
|
|
|
|
|
2012-06-25 13:33:27 +00:00
|
|
|
echo -n "Ready to test compilation...";
|
2011-11-25 17:45:26 +00:00
|
|
|
read
|
|
|
|
|
|
|
|
rm -Rf $BASE/lyx-test/
|
|
|
|
mkdir $BASE/lyx-test/
|
|
|
|
cd $BASE/lyx-test/
|
|
|
|
tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null
|
|
|
|
if ! cd lyx-$VERSION; then
|
|
|
|
echo "Unable to enter build directory!";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
./configure --enable-build-type=rel
|
|
|
|
|
|
|
|
if make $MAKEOPTS; then
|
|
|
|
echo "Compilation complete.";
|
|
|
|
echo -n "Ready to run LyX...";
|
|
|
|
read
|
|
|
|
src/lyx -userdir /tmp/lyx-test
|
|
|
|
else
|
|
|
|
echo "Compilation errors!!";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
LASTNUM=$(echo $VERSION | sed -e 's/.*\.//');
|
2017-08-21 21:16:07 +00:00
|
|
|
LAST=$((LASTNUM - 1));
|
2011-11-25 17:45:26 +00:00
|
|
|
FIRST=$(echo $VERSION | sed -e 's/[0-9]*$//');
|
|
|
|
ORIGINAL=${FIRST}0;
|
|
|
|
LAST=$FIRST$LAST;
|
|
|
|
|
2012-06-25 13:33:27 +00:00
|
|
|
if [ ! -d "$BASE/lyx-patch/" ]; then
|
|
|
|
mkdir "$BASE/lyx-patch/" || exit 1;
|
|
|
|
fi
|
2011-11-25 17:45:26 +00:00
|
|
|
|
2017-08-21 21:16:07 +00:00
|
|
|
if [ ! -d "$BASE/lyx-patch/lyx-$LAST" ]; then
|
2012-06-25 13:33:27 +00:00
|
|
|
echo "Can't find directory for last version $LAST.";
|
2014-01-31 14:37:38 +00:00
|
|
|
echo "See if you can fix this in $BASE/lyx-patch/.";
|
|
|
|
echo "Try that, if you like, and then we'll continue.";
|
|
|
|
echo "We'll try to download from the LyX site if that does not work.";
|
2012-06-25 13:33:27 +00:00
|
|
|
read;
|
2014-01-31 14:37:38 +00:00
|
|
|
|
2017-08-21 21:16:07 +00:00
|
|
|
if [ ! -d "$BASE/lyx-patch/lyx-$LAST" ]; then
|
2014-01-31 14:37:38 +00:00
|
|
|
echo "Will try to download from LyX site....";
|
|
|
|
pushd $BASE/lyx-patch/;
|
|
|
|
wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz;
|
2018-06-19 21:53:36 +00:00
|
|
|
wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz.sig
|
|
|
|
gpg -q --verify lyx-$LAST.tar.gz.sig
|
|
|
|
if ! [ $? == 0 ]; then
|
|
|
|
echo "Signature wrong!"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
rm lyx-$LAST.tar.gz.sig
|
2014-01-31 14:37:38 +00:00
|
|
|
tar -zxvf lyx-$LAST.tar.gz;
|
|
|
|
if [ ! -f lyx-$LAST.tar.gz ]; then
|
|
|
|
echo "Still unable to find directory for last version $LAST.";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
popd;
|
2012-06-25 13:33:27 +00:00
|
|
|
fi
|
2011-11-25 17:45:26 +00:00
|
|
|
fi
|
|
|
|
|
2012-06-25 13:33:27 +00:00
|
|
|
echo -n "Ready to make patch against $LAST...";
|
|
|
|
read
|
|
|
|
|
|
|
|
cd $BASE/lyx-patch/;
|
|
|
|
tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null;
|
|
|
|
|
2011-11-25 17:45:26 +00:00
|
|
|
diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION > patch
|
|
|
|
|
|
|
|
echo -n "Please check the patch...";
|
|
|
|
read
|
|
|
|
$EDITOR patch;
|
|
|
|
|
|
|
|
NUMFIX="th";
|
|
|
|
if [ "$LASTNUM" = "1" ]; then
|
|
|
|
NUMFIX="st";
|
|
|
|
elif [ "$LASTNUM" = "2" ]; then
|
|
|
|
NUMFIX="nd";
|
|
|
|
fi
|
|
|
|
NUM="$LASTNUM$NUMFIX";
|
|
|
|
cat $BASE/lyx-export/development/tools/patch-preamble | \
|
|
|
|
sed -e "s/VERSION/$VERSION/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble;
|
|
|
|
echo -n "Please verify the patch preamble...";
|
|
|
|
read
|
|
|
|
$EDITOR patch-preamble;
|
|
|
|
|
|
|
|
PATCH="patch-$VERSION";
|
2014-01-31 14:37:38 +00:00
|
|
|
cat patch-preamble $BASE/lyx-export/ANNOUNCE patch >$PATCH;
|
2011-11-25 17:45:26 +00:00
|
|
|
gzip -c $PATCH > $PATCH.gz
|
2012-06-25 13:33:27 +00:00
|
|
|
if [ -f $PATCH.gz.sig ]; then
|
|
|
|
rm $PATCH.gz.sig;
|
|
|
|
fi
|
2011-11-25 17:45:26 +00:00
|
|
|
gpg -b $PATCH.gz
|
|
|
|
xz -zc $PATCH > $PATCH.xz
|
2012-11-04 02:10:40 +00:00
|
|
|
if [ -f $PATCH.xz.sig ]; then
|
|
|
|
rm $PATCH.xz.sig;
|
|
|
|
fi
|
2011-11-25 17:45:26 +00:00
|
|
|
gpg -b $PATCH.xz
|
|
|
|
|
|
|
|
echo -n "Patch and signatures created...";
|
2012-06-25 13:33:27 +00:00
|
|
|
cp -v $PATCH.gz $PATCH.gz.sig $PATCH.xz $PATCH.xz.sig $BASE;
|
2011-11-25 17:45:26 +00:00
|
|
|
|
|
|
|
|