File lyx.spec of Package lyx

#
# spec file for package lyx
#
# Copyright (c) 2016 SUSE LINUX 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/
#


Name:           lyx
#!BuildIgnore: lyx
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bc
BuildRequires:  boost-devel
BuildRequires:  enchant-devel
BuildRequires:  fdupes
BuildRequires:  file-devel
BuildRequires:  hunspell-devel
BuildRequires:  libqt4-devel
BuildRequires:  python
BuildRequires:  update-desktop-files
BuildRequires:  zlib-devel
Version:        2.2.0
Release:        0
Summary:        WYSIWYM (What You See Is What You Mean) document processor
License:        GPL-2.0+
Group:          Productivity/Publishing/TeX/Frontends
Url:            http://www.lyx.org/
#
Distribution:   Publishing / openSUSE_13.1
#
Source:         ftp://ftp.lyx.org/pub/lyx/stable/2.2.x/lyx-%{version}.tar.xz
Source1:        lyxrc.dist
Source2:        lyx.keyring
Source3:        ftp://ftp.lyx.org/pub/lyx/stable/2.2.x/lyx-%{version}.tar.xz.sig
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       ImageMagick
Requires:       ghostscript
%if 0%{?suse_version} < 1230
Recommends:     texlive-latex
Recommends:     texlive-xetex
Recommends:     xindy
%else
# Goal is to recommend (roughly) everything that is supported in the GUI of LyX
# LyX can supoort everything of LaTeX in the preamble, but not everything is supported in the GUI
# I have ingored extra fonts and document classes
Recommends:     texlive-algorithms
Recommends:     texlive-arabi
Recommends:     texlive-bezos
Recommends:     texlive-bibtopic
Recommends:     texlive-braille
Recommends:     texlive-collection-fontsrecommended
Recommends:     texlive-collection-htmlxml
Recommends:     texlive-collection-latexrecommended
Recommends:     texlive-collection-luatex
Recommends:     texlive-collection-xetex
Recommends:     texlive-covington
Recommends:     texlive-endnotes
Recommends:     texlive-esint
Recommends:     texlive-esint-type1
Recommends:     texlive-fragments
Recommends:     texlive-ifsym
Recommends:     texlive-mathdots
Recommends:     texlive-mhchem
Recommends:     texlive-multirow
Recommends:     texlive-nomencl
Recommends:     texlive-pdfcomment
Recommends:     texlive-pdfsync
Recommends:     texlive-prettyref
Recommends:     texlive-refstyle
Recommends:     texlive-rotfloat
Recommends:     texlive-splitindex
Recommends:     texlive-textgreek
Recommends:     texlive-units
Recommends:     texlive-wrapfig
Recommends:     texlive-zhmetrics
Recommends:     xindy
# Some stuff needed for LyX's documentation:
Recommends:     texlive-braket
Recommends:     texlive-diagbox
Recommends:     texlive-picinpar
Recommends:     texlive-shapepar
Recommends:     texlive-sidecap
# Only suggest biblatex/biber, because only the engine (biber) is supported in the GUI,
# not biblatex itself (the only one that can use biber)
Suggests:       texlive-biber
Suggests:       texlive-bibtex8
%endif

%description
LyX is a document processor that encourages an approach to writing
based on the structure of your documents, not their appearance. The
author can concentrate on the content (What You See Is What You Mean).
The formatting is done by the backends (like LaTeX) and the output can
have different formats, such as DVI, postscript, PDF, html.

LyX can check the LaTeX installation by opening the LaTeX Configuration
document under "Help" on the menubar.


%prep
%setup -q

%build
#./autogen.sh
TEXMF=%{_datadir}/texmf
export CFLAGS="-O2 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables \
               -fasynchronous-unwind-tables -frename-registers \
               -march=bdver1 -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mabm \
               -mlwp -mno-fma -mfma4 -mxop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 \
               -msse4.2 -msse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c \
               -mno-fsgsbase -mno-rdseed -mprfchw -mno-adx -mfxsr -mxsave -mno-xsaveopt \
               --param l1-cache-size=16 --param l1-cache-line-size=64 \
               --param l2-cache-size=2048 -mtune=bdver1"
export CXXFLAGS="$CFLAGS"
%configure \
    --with-frontend=qt4 \
    --without-included-boost \
    --without-aspell \
    --with-hunspell \
    --with-enchant \
    --enable-build-type=rel
make %{?_smp_mflags}

%install
TEXMF=%{_datadir}/texmf
make install DESTDIR=$RPM_BUILD_ROOT TEXMF=$TEXMF

# some defaults
install -p -m644 -D %{SOURCE1} $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 ANNOUNCE COPYING 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 lyx Office WordProcessor
%fdupes -s $RPM_BUILD_ROOT
%find_lang %name

%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
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%dir %{_datadir}/texmf
%dir %{_datadir}/texmf/tex
%dir %{_datadir}/texmf/tex/latex
%{_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
openSUSE Build Service is sponsored by