lyx/lyx.spec

133 lines
4.2 KiB
RPMSpec

#
# spec file for package lyx
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: lyx
#!BuildIgnore: lyx
BuildRequires: ImageMagick aspell-devel boost-devel fdupes gv hunspell-devel libdrm-devel libjpeg-devel libqt4-devel python sgmltool texlive-devel texlive-latex update-desktop-files
License: LGPLv2.1+
Group: Productivity/Publishing/TeX/Frontends
Requires: texlive-latex ImageMagick
AutoReqProv: on
Version: 2.0.0
Release: 6
Summary: LaTeX-Based WYSIWYG Editor
Url: http://www.lyx.org/
Source: ftp://ftp.lyx.org/pub/lyx/stable/2.0.x/lyx-2.0.0.tar.gz
Source1: lyx.desktop
Source2: lyx.png
Source3: lyxrc.dist
# hunspell pkgconfig support
# see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg169351.html
Patch0: lyx-2.0.0-hunspell_pkgconfig.patch
# xdg patch
# This was rejected by upstream (http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg133878.html)
Patch1: lyx-2.0.0rc1-xdg_open.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Recommends: texlive-xetex xindy
%description
LyX is a front-end for LaTeX under X11. It combines the comfortable use
of a word processor with the high quality of LaTeX typesetting.
Documents are displayed in a WYSIWYG-like way. User does not choose low
level attributes ("large italic") but high level layouts (styles) for
each paragraph. Of course, low level formatting is still possible.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
# Remove build time references so build-compare can do its work
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" src/LyX.cpp
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" src/LyX.cpp
%build
#%{?suse_update_config:%{suse_update_config -f config}}
./autogen.sh
export CFLAGS="$RPM_OPT_FLAGS -DHAVE_STRERROR"
export CXXFLAGS="$RPM_OPT_FLAGS -DHAVE_STRERROR"
TEXMF=%{_datadir}/texmf
%if %suse_version > 1020
TEXMF=$(kpsexpand '$TEXMFMAIN')
%if %suse_version > 1030
TEXMF=$(kpsexpand '$TEXMFDIST')
%endif
%endif
%configure \
--without-included-boost \
%if %suse_version < 1020
--with-extra-inc=/usr/X11R6/include/X11 \
%endif
--with-aspell --with-hunspell \
--with-frontend=qt4
make %{?jobs:-j%jobs}
%install
TEXMF=%{_datadir}/texmf
%if %suse_version > 1020
TEXMF=$(kpsexpand '$TEXMFMAIN')
%if %suse_version > 1030
TEXMF=$(kpsexpand '$TEXMFDIST')
%endif
%endif
make install DESTDIR=$RPM_BUILD_ROOT TEXMF=$TEXMF
# some defaults
install -p -m644 -D %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/lyx/lyxrc.dist
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}
pushd $RPM_BUILD_ROOT%{_datadir}/lyx/doc/
for i in *
do
ln -s %{_datadir}/lyx/doc/$i \
$RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}/
done
popd
cp ABOUT-NLS ANNOUNCE COPYING INSTALL* NEWS \
README README.localization RELEASE-NOTES UPGRADING \
$RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}/
mkdir -p $RPM_BUILD_ROOT$TEXMF/tex/latex
ln -s %{_datadir}/lyx/tex $RPM_BUILD_ROOT$TEXMF/tex/latex/lyx
%suse_update_desktop_file -i lyx Office WordProcessor
%fdupes -s $RPM_BUILD_ROOT
%find_lang %name
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %name.lang
%defattr(-,root,root)
%docdir %{_datadir}/lyx/doc
%doc %{_defaultdocdir}/lyx
/usr/bin/lyx
/usr/bin/lyxclient
/usr/bin/tex2lyx
%{_datadir}/applications/lyx.desktop
%{_datadir}/pixmaps/lyx.png
%{_datadir}/texmf/tex/latex/lyx
%{_datadir}/lyx
%doc %{_mandir}/man1/lyx.1.gz
%doc %{_mandir}/man1/lyxclient.1.gz
%doc %{_mandir}/man1/tex2lyx.1.gz
%changelog