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 "See if you can fix this in $BASE/lyx-patch/.";
92 echo "Try that, if you like, and then we'll continue.";
93 echo "We'll try to download from the LyX site if that does not work.";
96 if [ ! -d $BASE/lyx-patch/lyx-$LAST ]; then
97 echo "Will try to download from LyX site....";
98 pushd $BASE/lyx-patch/;
99 wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz;
100 tar -zxvf lyx-$LAST.tar.gz;
101 if [ ! -f lyx-$LAST.tar.gz ]; then
102 echo "Still unable to find directory for last version $LAST.";
109 echo -n "Ready to make patch against $LAST...";
113 tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null;
115 diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION > patch
117 echo -n "Please check the patch...";
122 if [ "$LASTNUM" = "1" ]; then
124 elif [ "$LASTNUM" = "2" ]; then
127 NUM="$LASTNUM$NUMFIX";
128 cat $BASE/lyx-export/development/tools/patch-preamble | \
129 sed -e "s/VERSION/$VERSION/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble;
130 echo -n "Please verify the patch preamble...";
132 $EDITOR patch-preamble;
134 PATCH="patch-$VERSION";
135 cat patch-preamble $BASE/lyx-export/ANNOUNCE patch >$PATCH;
136 gzip -c $PATCH > $PATCH.gz
137 if [ -f $PATCH.gz.sig ]; then
141 xz -zc $PATCH > $PATCH.xz
142 if [ -f $PATCH.xz.sig ]; then
147 echo -n "Patch and signatures created...";
148 cp -v $PATCH.gz $PATCH.gz.sig $PATCH.xz $PATCH.xz.sig $BASE;