## ## lyx.spec -- OpenPKG RPM Specification ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH ## Copyright (c) 2000-2003 The OpenPKG Project ## Copyright (c) 2000-2003 Ralf S. Engelschall ## ## Permission to use, copy, modify, and distribute this software for ## any purpose with or without fee is hereby granted, provided that ## the above copyright notice and this permission notice appear in all ## copies. ## ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ## SUCH DAMAGE. ## # package versions %define V_lyx 1.3.2 %define V_xforms 1.0 # package information Name: lyx Summary: Graphical frontend for LaTeX (nearly WYSIWYG) URL: http://www.lyx.org/ Vendor: The LyX Team Packager: The OpenPKG Project Distribution: OpenPKG [EVAL] Group: Print License: GPL Version: %{V_lyx} Release: 20030506 # package options %option with_qt no # list of sources Source0: ftp://ftp.lyx.org/pub/lyx/stable/lyx-%{V_lyx}.tar.gz Source1: http://savannah.nongnu.org/download/xforms/stable.pkg/%{V_xforms}/xforms-%{V_xforms}.tar.gz Patch0: lyx.patch Patch1: xforms.patch # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} BuildPreReq: OpenPKG, openpkg >= 20030103, make, gcc, perl BuildPreReq: X11, tetex, gettext, libiconv %if "%{with_qt}" == "yes" BuildPreReq: qt %else BuildPreReq: jpeg, tiff, xpm %endif PreReq: OpenPKG, openpkg >= 20030103, X11, tetex, tetex::with_x11 = yes PreReq: gv, ghostscript, ghostscript::with_x11 = yes AutoReq: no AutoReqProv: no %description LyX is an advanced open source document processor that encourages an approach to writing based on the structure of your documents, not their appearance. LyX lets you concentrate on writing, leaving details of visual layout to the software. %prep %setup -q %patch0 -p1 %if "%{with_qt}" != "yes" %setup -q -T -D -a 1 ( cd xforms-%{V_xforms} %patch1 -p0 ) || exit 1 %endif %build x11_bin=`%{l_prefix}/etc/rc --query x11_bindir` x11_inc=`%{l_prefix}/etc/rc --query x11_incdir` x11_lib=`%{l_prefix}/etc/rc --query x11_libdir` %if "%{with_qt}" != "yes" ( cd xforms-%{V_xforms} %{l_shtool} subst \ -e 's;@l_prefix@;%{l_prefix};g' \ Imakefile */Imakefile PATH=$x11_bin:$PATH imake -DHasGcc2 -UHasSunC -DUseInstalled -I$x11_lib/X11/config %{l_make} Makefiles %{l_make} includes %{l_make} depend %{l_make} %{l_mflags} %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT ) || exit 1 %endif ( cd lyx-%{V_lyx} %if "%{with_qt}" == "yes" echo "qt_cv_libname=qt" >config.cache EXTRALIBS="-lqt -lXft -lGL -lXinerama" %endif CC="%{l_cc}" \ CXX="%{l_cxx}" \ CFLAGS="%{l_cflags -O}" \ CXXFLAGS="%{l_cxxflags -O}" \ CPPFLAGS="%{l_cppflags}" \ LDFLAGS="%{l_ldflags}" \ ./configure \ --cache-file=./config.cache \ --prefix=%{l_prefix} \ --with-libiconv-prefix=%{l_prefix} \ --with-x \ --x-includes=$x11_inc \ --x-libraries=$x11_lib \ --disable-shared \ %if "%{with_qt}" == "yes" --with-qt-dir=%{l_prefix} \ --with-qt-libraries="%{l_prefix}/lib" \ --with-qt-includes="%{l_prefix}/include/qt" \ --with-frontend=qt \ %else --with-frontend=xforms \ --with-extra-lib=$RPM_BUILD_ROOT%{l_prefix}/lib \ --with-extra-inc=$RPM_BUILD_ROOT%{l_prefix}/include/X11 \ %endif --without-aiksaurus %{l_make} %{l_mflags -O} LIBS="$LIBS $EXTRALIBS" ) || exit 1 %install ( cd lyx-%{V_lyx} %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true ) || exit 1 %if "%{with_qt}" == "yes" %else rm -rf $RPM_BUILD_ROOT%{l_prefix}/include rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib %endif # preset known helper applications %{l_shtool} subst \ -e 's;^\(\\converter latex lyx \).*;\1 "reLyx -f $$i" "";' \ -e 's;^\(\\converter literate lyx \).*;\1 "noweb2lyx $$i $$o" "";' \ -e 's;^\(\\viewer dvi \).*;\1 "xdvi";' \ -e 's;^\(\\viewer pdf \).*;\1 "gv";' \ -e 's;^\(\\viewer ps \).*;\1 "gv -swap";' \ -e 's;^\(\\viewer eps \).*;\1 "gv";' \ -e 's;^\(\\pscommand \).*;\1 "gs";' \ $RPM_BUILD_ROOT%{l_prefix}/share/lyx/lyxrc.defaults %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} %files -f files %clean rm -rf $RPM_BUILD_ROOT