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
8 # A few variables need to be set, here at the top.
10 # Where we will do our work
11 BASE="/cvs/lyx/lyx-release";
12 # Where our git repository lives
13 SRCDIR="/cvs/lyx/lyx-20";
15 if [ -z "$EDITOR" ]; then EDITOR=vi; fi
16 # Options to make, when we compile
19 # Determine LyX version
21 VERSION=$(head configure.ac | grep AC_INIT | perl -e 'while (<>) {m/AC_INIT\(LyX,([^,]+)/; print $1;}');
23 echo "This is version $VERSION.";
24 echo -n "Ready to build source packages...";
27 echo "Exporting clean tree...";
28 rm -Rf $BASE/lyx-export/
29 git checkout-index -a -f --prefix=$BASE/lyx-export/
32 rm -Rf $BASE/lyx-build/
33 mkdir $BASE/lyx-build/
36 echo "Building distribution...";
37 $BASE/lyx-export/configure --enable-build-type=rel
38 if ! make lyxdist; then
39 echo "Couldn't make distribution!";
43 echo "Packages created:";
44 cp -v lyx-$VERSION.tar.{gz,xz} $BASE;
46 echo -n "Ready to build signatures...";
49 gpg -b lyx-$VERSION.tar.gz
50 gpg -b lyx-$VERSION.tar.xz
52 echo "Signatures created:"
53 cp -v lyx-$VERSION.tar.*.sig $BASE;
55 echo -n "Ready to test compilation...";
58 rm -Rf $BASE/lyx-test/
61 tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null
62 if ! cd lyx-$VERSION; then
63 echo "Unable to enter build directory!";
67 ./configure --enable-build-type=rel
69 if make $MAKEOPTS; then
70 echo "Compilation complete.";
71 echo -n "Ready to run LyX...";
73 src/lyx -userdir /tmp/lyx-test
75 echo "Compilation errors!!";
79 LASTNUM=$(echo $VERSION | sed -e 's/.*\.//');
80 LAST=$(($LASTNUM - 1));
81 FIRST=$(echo $VERSION | sed -e 's/[0-9]*$//');
85 if [ ! -d "$BASE/lyx-patch/" ]; then
86 mkdir "$BASE/lyx-patch/" || exit 1;
89 if [ ! -d $BASE/lyx-patch/lyx-$LAST ]; then
90 echo "Can't find directory for last version $LAST.";
91 echo "Will try to download from LyX site....";
93 pushd $BASE/lyx-patch/;
94 wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz;
95 tar -zxvf lyx-$LAST.tar.gz;
96 if [ ! -f lyx-$LAST.tar.gz ]; then
97 echo "Still unable to find directory for last version $LAST.";
103 echo -n "Ready to make patch against $LAST...";
107 tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null;
109 diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION > patch
111 echo -n "Please check the patch...";
116 if [ "$LASTNUM" = "1" ]; then
118 elif [ "$LASTNUM" = "2" ]; then
121 NUM="$LASTNUM$NUMFIX";
122 cat $BASE/lyx-export/development/tools/patch-preamble | \
123 sed -e "s/VERSION/$VERSION/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble;
124 echo -n "Please verify the patch preamble...";
126 $EDITOR patch-preamble;
128 PATCH="patch-$VERSION";
129 cat patch-preamble patch >$PATCH;
130 gzip -c $PATCH > $PATCH.gz
131 if [ -f $PATCH.gz.sig ]; then
135 xz -zc $PATCH > $PATCH.xz
136 if [ -f $PATCH.xz.sig ]; then
141 echo -n "Patch and signatures created...";
142 cp -v $PATCH.gz $PATCH.gz.sig $PATCH.xz $PATCH.xz.sig $BASE;