# Options to make, when we compile
MAKEOPTS="-j4";
+PKGNUM="";
+while getopts ":m:p:" opt; do
+ case $opt in
+ m ) MAKEOPTS="$OPTARG";;
+ p ) PKGNUM="$OPTARG";;
+ \? ) echo "Unknown option $opt"; exit 1;;
+ esac
+done
+shift $(($OPTIND - 1));
+
# Determine LyX version
cd $SRCDIR/
VERSION=$(head configure.ac | grep AC_INIT | perl -e 'while (<>) {m/AC_INIT\(LyX,([^,]+)/; print $1;}');
+VERSION_BASE="$VERSION";
+
+if [ -n "$PKGNUM" ]; then
+ VERSION="$VERSION-$PKGNUM";
+fi
echo "This is version $VERSION.";
echo -n "Ready to build source packages...";
fi
echo "Packages created:";
+if [ -n "$PKGNUM" ]; then
+ mv lyx-$VERSION_BASE.tar.gz lyx-$VERSION.tar.gz;
+ mv lyx-$VERSION_BASE.tar.xz lyx-$VERSION.tar.xz;
+fi
cp -v lyx-$VERSION.tar.{gz,xz} $BASE;
echo -n "Ready to build signatures...";
rm -Rf $BASE/lyx-test/
mkdir $BASE/lyx-test/
cd $BASE/lyx-test/
-tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null
-if ! cd lyx-$VERSION; then
+tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz
+if ! cd lyx-$VERSION_BASE; then
echo "Unable to enter build directory!";
exit 1;
fi
exit 1;
fi
-LASTNUM=$(echo $VERSION | sed -e 's/.*\.//');
-LAST=$(($LASTNUM - 1));
-FIRST=$(echo $VERSION | sed -e 's/[0-9]*$//');
+LASTNUM=$(echo $VERSION_BASE | sed -e 's/.*\.//');
+LAST=$((LASTNUM - 1));
+FIRST=$(echo $VERSION_BASE | sed -e 's/[0-9]*$//');
ORIGINAL=${FIRST}0;
LAST=$FIRST$LAST;
fi
NUM="$LASTNUM$NUMFIX";
cat $BASE/lyx-export/development/tools/patch-preamble | \
-sed -e "s/VERSION/$VERSION/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble;
+sed -e "s/VERSION/$VERSION_BASE/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble;
echo -n "Please verify the patch preamble...";
read
$EDITOR patch-preamble;
-This is patch-2.0.1, the 1st maintenance patch against LyX 2.0.0.
-You need the source of lyx 2.0.0 to apply this patch.
+This is patch-VERSION, the NUM maintenance patch against LyX ORIGINAL.
+You need the source of lyx LAST to apply this patch.
This patch should be applied like this
- cd lyx-2.0.0
+ cd lyx-LAST
make distclean
- zcat patch-2.0.0.gz | patch -p1
+ zcat patch-VERSION.gz | patch -p1
and then LyX can be build as usual.
If you want to skip the 'distclean' step, make sure to re-run configure.