#!/bin/sh

## build script for lyx, which just summarizes some of the options I found useful
## this builds the qt frontend and puts the lyx-specific files in /usr/share/lyx

## set this to your qt installation directory (try echo $QDIR to see if the environment is
## set
#QTDIR=/usr/lib/qt-3.1

[ -d "$QTDIR" ] || exec echo "QTDIR $QTDIR is not a directory"

if [ -f /etc/fedora-release -o -f /etc/redhat-release ] ;then
 rpm -q qt-devel || exec \
    echo "Lyx requires the qt-devel rpm. Please install qt-devel for $(rpm -q qt)"
fi

## start configuring
./configure \
 --with-frontend=qt \
 --datadir=/usr/share/ \
 --with-extra-lib=$QTDIR/lib/ \
 --with-extra-inc=$QTDIR/include/ \
 &&  make && make install && \
 echo "Build successfull" || \
 echo "Something went wrong"