Please, find attached the patch for lyx.spec file used for building RPMs. I have introduced two new macros at the top which enable the creation of new RPM with a different frontend by simply changing their definition. For example, to build xforms frontend (since the original spec file used Qt frontend), one just needs to redefine:
%define frontend xforms %define frontdep libforms >= 1.0 The rest of the spec file stays untouched and everything works great! I've built xforms and qt rpms without a problem. I had to enforce the consistent use of macros to achieve this though. I urge you to accept the patch -- it will make rpm builder's life much easier. One thing I have in my personal lyx.spec file that I didn't put here is the creation of lyx.desktop file, which creates a menu entry for both Gnome and KDE. It resides in %{_sysconfdir}/X11/applnk/Applications. However, I didn't know whether other Linux distributions use the same place to store .desktop files (on Red Hat it is /etc/X11/applnk), so I left it out. If you think it can be useful I can send the patch for that too. Best regards, -- Zvezdan Petkovic <[EMAIL PROTECTED]> http://www.cs.wm.edu/~zvezdan/
--- lyx.spec.orig Fri Feb 7 03:58:10 2003 +++ lyx.spec Wed Feb 19 17:51:37 2003 @@ -1,16 +1,19 @@ +%define frontend qt +%define frontdep qt >= 2.2.1 + Summary: A WYSIWYM (What You See Is What You Mean) frontend to LaTeX Name: lyx Version: 1.3.0 -Release: 1qt +Release: 1_%{frontend} License: see COPYING file -Group: X11/Editors -Url: http://www.lyx.org/ +Group: Applications/Publishing +URL: http://www.lyx.org/ Packager: Kayvan A. Sylvan <[EMAIL PROTECTED]> -Source: ftp://ftp.lyx.org/pub/lyx/stable/lyx-%{PACKAGE_VERSION}.tar.gz -BuildRoot: %{_tmppath}/%{name}-root -Icon: lyx.xpm -Prefix: /usr -Requires: qt >= 2.2.1, pspell, tetex-xdvi, tetex, tetex-latex +Source: ftp://ftp.lyx.org/pub/lyx/stable/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-root +Icon: %{name}.xpm +Prefix: %{_prefix} +Requires: %{frontdep}, pspell, tetex-xdvi, tetex, tetex-latex Obsoletes: tetex-lyx %description @@ -30,14 +33,15 @@ With LyX, the author can concentrate on the contents of his writing, and let the computer take care of the rest. -This is LyX built with the Qt frontend. +This is LyX built with the %{frontend} frontend. + %prep %setup %build unset LINGUAS || true -./configure --with-pspell --with-frontend=qt --prefix=%{_prefix} --mandir=%{_mandir} \ - --bindir=%{_bindir} --datadir=%{_datadir} \ +./configure --with-pspell --with-frontend=%{frontend} --prefix=%{_prefix} \ + --mandir=%{_mandir} --bindir=%{_bindir} --datadir=%{_datadir} \ --without-warnings --disable-debug --enable-optimization=-O2 make @@ -53,13 +57,13 @@ # TEXMF=%{_datadir}/texmf mkdir -p ${RPM_BUILD_ROOT}${TEXMF}/tex/latex -mv ${RPM_BUILD_ROOT}%{_datadir}/lyx/tex \ - ${RPM_BUILD_ROOT}/${TEXMF}/tex/latex/lyx +mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}/tex \ + ${RPM_BUILD_ROOT}/${TEXMF}/tex/latex/%{name} # # Miscellaneous files # -cp -a lib/images/lyx.xpm ${RPM_BUILD_ROOT}%{_datadir}/lyx/images/ +cp -a lib/images/%{name}.xpm ${RPM_BUILD_ROOT}%{_datadir}/%{name}/images/ cp lib/reLyX/README README.reLyX %clean @@ -78,14 +82,13 @@ # Now configure LyX # echo "Configuring LyX for your system..." -cd %{_datadir}/lyx +cd %{_datadir}/%{name} ./configure --srcdir # Fix reLyX perl program if the prefix is non-standard if [ "%{_prefix}" != "/usr" ] then - perl -pi -e "s!/usr/share/lyx!%{_datadir}/lyx!" \ - %{_bindir}/reLyX + perl -pi -e "s!/usr/share/%{name}!%{_datadir}/%{name}!" %{_bindir}/reLyX fi %postun