]> git.lyx.org Git - lyx.git/blobdiff - development/tools/lyx-build
Add support for mixed-encoded biblatex files
[lyx.git] / development / tools / lyx-build
index 971d9d2a87434479ede34ca4b9a08dd0202bb209..e78eaa7502c8d8c0fb336f07008b34d3d5ecd8ac 100755 (executable)
@@ -5,6 +5,14 @@
 # It also includes several other tests, to make sure the packages
 # works as it should.
 
+# 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.
+
 # A few variables need to be set, here at the top. 
 #
 # Where we will do our work
@@ -18,7 +26,7 @@ MAKEOPTS="-j4";
 
 # Determine LyX version
 cd $SRCDIR/
-VERSION=$(head configure.ac | grep AC_INIT | perl -e 'while (<>) {m/(\d\.\d+\.\d+)/; print $1;}');
+VERSION=$(head configure.ac | grep AC_INIT | perl -e 'while (<>) {m/AC_INIT\(LyX,([^,]+)/; print $1;}');
 
 echo "This is version $VERSION.";
 echo -n "Ready to build source packages...";
@@ -34,7 +42,7 @@ mkdir $BASE/lyx-build/
 cd $BASE/lyx-build/
 
 echo "Building distribution...";
-$BASE/lyx-export/configure --enable-build-type=rel
+$BASE/lyx-export/configure --enable-build-type=rel --enable-qt5
 if ! make lyxdist; then
   echo "Couldn't make distribution!";
   exit 1;
@@ -64,7 +72,7 @@ if ! cd lyx-$VERSION; then
   exit 1;
 fi
 
-./configure --enable-build-type=rel
+./configure --enable-build-type=rel --enable-qt5
 
 if make $MAKEOPTS; then
   echo "Compilation complete.";
@@ -77,7 +85,7 @@ else
 fi
 
 LASTNUM=$(echo $VERSION | sed -e 's/.*\.//');
-LAST=$(($LASTNUM - 1));
+LAST=$((LASTNUM - 1));
 FIRST=$(echo $VERSION | sed -e 's/[0-9]*$//');
 ORIGINAL=${FIRST}0;
 LAST=$FIRST$LAST;
@@ -86,15 +94,30 @@ if [ ! -d "$BASE/lyx-patch/" ]; then
        mkdir "$BASE/lyx-patch/" || exit 1;
 fi
 
-if [ ! -d lyx-$LAST ]; then 
+if [ ! -d "$BASE/lyx-patch/lyx-$LAST" ]; then 
   echo "Can't find directory for last version $LAST.";
-  echo "Will try to download from LyX site....";
+  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.";
   read;
-  wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz;
-  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;
+
+  if [ ! -d "$BASE/lyx-patch/lyx-$LAST" ]; then 
+    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;
+    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
+    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;
   fi
 fi
 
@@ -124,14 +147,16 @@ read
 $EDITOR patch-preamble;
 
 PATCH="patch-$VERSION";
-cat patch-preamble patch >$PATCH;
+cat patch-preamble $BASE/lyx-export/ANNOUNCE patch >$PATCH;
 gzip -c $PATCH > $PATCH.gz
 if [ -f $PATCH.gz.sig ]; then
   rm $PATCH.gz.sig;
 fi
 gpg -b $PATCH.gz
 xz -zc $PATCH > $PATCH.xz
-rm $PATCH.xz.sig;
+if [ -f $PATCH.xz.sig ]; then
+       rm $PATCH.xz.sig;
+fi
 gpg -b $PATCH.xz
 
 echo -n "Patch and signatures created...";