2 # This script builds a maintainance LyX distribution according to
3 # the procedure outlined at:
4 # http://wiki.lyx.org/Devel/ReleaseProcedure
5 # It also includes several other tests, to make sure the packages
7 # Note that this is for svn, not for git.
9 # A few variables need to be set, here at the top.
10 # where all the source trees live
11 BASE="/cvs/lyx/lyx-release";
12 # where the svn directory lives
13 SRCDIR="/cvs/lyx/lyx-pristine";
15 if [ -z "$EDITOR" ]; then EDITOR=vi; fi
16 # options to make, when we compile
21 VERSION=$(head configure.ac | grep AC_INIT | perl -e 'while (<>) {m/(\d\.\d+\.\d+)/; print $1;}');
23 echo "This is version $VERSION.";
24 echo -n "Ready to build source packages...";
27 echo "Running svn export...";
28 rm -Rf $BASE/lyx-export/
29 svn export . $BASE/lyx-export/
32 rm -Rf $BASE/lyx-build/
33 mkdir $BASE/lyx-build/
36 $BASE/lyx-export/configure --enable-build-type=rel
37 if ! make lyxdist; then
38 echo "Couldn't make distribution!";
42 echo "Packages created:";
43 cp -v lyx-$VERSION.tar.{gz,xz} $BASE;
45 echo -n "Ready to build signatures...";
48 gpg -b lyx-$VERSION.tar.gz
49 gpg -b lyx-$VERSION.tar.xz
51 echo "Signatures created:"
52 cp -v lyx-$VERSION.tar.*.sig $BASE;
54 echo -n "Ready to test compilation.";
57 rm -Rf $BASE/lyx-test/
60 tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null
61 if ! cd lyx-$VERSION; then
62 echo "Unable to enter build directory!";
66 ./configure --enable-build-type=rel
68 if make $MAKEOPTS; then
69 echo "Compilation complete.";
70 echo -n "Ready to run LyX...";
72 src/lyx -userdir /tmp/lyx-test
74 echo "Compilation errors!!";
78 LASTNUM=$(echo $VERSION | sed -e 's/.*\.//');
79 LAST=$(($LASTNUM - 1));
80 FIRST=$(echo $VERSION | sed -e 's/[0-9]*$//');
83 echo "Last version was $LAST.";
84 echo -n "Ready to make patch...";
88 tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null;
90 if [ ! -d lyx-$LAST ]; then
91 echo "Can't find directory for last version $LAST!";
95 diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION > patch
97 echo -n "Please check the patch...";
102 if [ "$LASTNUM" = "1" ]; then
104 elif [ "$LASTNUM" = "2" ]; then
107 NUM="$LASTNUM$NUMFIX";
108 cat $BASE/lyx-export/development/tools/patch-preamble | \
109 sed -e "s/VERSION/$VERSION/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble;
110 echo -n "Please verify the patch preamble...";
112 $EDITOR patch-preamble;
114 PATCH="patch-$VERSION";
115 cat patch-preamble patch >$PATCH;
116 gzip -c $PATCH > $PATCH.gz
119 xz -zc $PATCH > $PATCH.xz
123 echo -n "Patch and signatures created...";
124 cp -v $PATCH.gz $PATCH.xz $BASE;