]> git.lyx.org Git - lyx.git/blob - development/tools/lyx-build
listerrors.lyx : Update a link.
[lyx.git] / development / tools / lyx-build
1 #!/bin/bash
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
6 # works as it should.
7 # Note that this is for svn, not for git.
8
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";
14 # editor 
15 if [ -z "$EDITOR" ]; then EDITOR=vi; fi
16 # options to make, when we compile
17 MAKEOPTS="-j4";
18
19
20 cd $SRCDIR/
21 VERSION=$(head configure.ac | grep AC_INIT | perl -e 'while (<>) {m/(\d\.\d+\.\d+)/; print $1;}');
22
23 echo "This is version $VERSION.";
24 echo -n "Ready to build source packages...";
25 read
26
27 echo "Running svn export...";
28 rm -Rf $BASE/lyx-export/
29 svn export . $BASE/lyx-export/
30 cd $BASE/lyx-export/
31 ./autogen.sh
32 rm -Rf $BASE/lyx-build/
33 mkdir $BASE/lyx-build/
34 cd $BASE/lyx-build/
35
36 $BASE/lyx-export/configure --enable-build-type=rel
37 if ! make lyxdist; then
38   echo "Couldn't make distribution!";
39   exit 1;
40 fi
41
42 echo "Packages created:";
43 cp -v lyx-$VERSION.tar.{gz,xz} $BASE;
44
45 echo -n "Ready to build signatures...";
46 read
47
48 gpg -b lyx-$VERSION.tar.gz
49 gpg -b lyx-$VERSION.tar.xz
50
51 echo "Signatures created:"
52 cp -v lyx-$VERSION.tar.*.sig $BASE;
53
54 echo -n "Ready to test compilation.";
55 read
56
57 rm -Rf $BASE/lyx-test/
58 mkdir $BASE/lyx-test/
59 cd $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!";
63   exit 1;
64 fi
65
66 ./configure --enable-build-type=rel
67
68 if make $MAKEOPTS; then
69   echo "Compilation complete.";
70   echo -n "Ready to run LyX...";
71   read
72   src/lyx -userdir /tmp/lyx-test
73 else
74   echo "Compilation errors!!";
75   exit 1;
76 fi
77
78 LASTNUM=$(echo $VERSION | sed -e 's/.*\.//');
79 LAST=$(($LASTNUM - 1));
80 FIRST=$(echo $VERSION | sed -e 's/[0-9]*$//');
81 ORIGINAL=${FIRST}0;
82 LAST=$FIRST$LAST;
83 echo "Last version was $LAST.";
84 echo -n "Ready to make patch...";
85 read
86
87 cd $BASE/lyx-patch/;
88 tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null;
89
90 if [ ! -d lyx-$LAST ]; then 
91   echo "Can't find directory for last version $LAST!";
92   exit 1;
93 fi
94
95 diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION > patch
96
97 echo -n "Please check the patch...";
98 read
99 $EDITOR patch;
100
101 NUMFIX="th";
102 if [ "$LASTNUM" = "1" ]; then
103   NUMFIX="st";
104 elif [ "$LASTNUM" = "2" ]; then
105   NUMFIX="nd";
106 fi
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...";
111 read
112 $EDITOR patch-preamble;
113
114 PATCH="patch-$VERSION";
115 cat patch-preamble patch >$PATCH;
116 gzip -c $PATCH > $PATCH.gz
117 rm $PATCH.gz.sig;
118 gpg -b $PATCH.gz
119 xz -zc $PATCH > $PATCH.xz
120 rm $PATCH.xz.sig;
121 gpg -b $PATCH.xz
122
123 echo -n "Patch and signatures created...";
124 cp -v $PATCH.gz $PATCH.xz $BASE;
125
126