#
# spec file for package doxygen-doc
#
# Copyright (c) 2017 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:           doxygen-doc
Version:        1.8.13
Release:        0
Summary:        Automated C, C++, and Java Documentation Generator
License:        GPL-2.0+
Group:          Development/Tools/Doc Generators
Url:            http://www.stack.nl/~dimitri/doxygen/
Source0:        http://ftp.stack.nl/pub/users/dimitri/doxygen-%{version}.src.tar.gz
# PATCH-FIX-UPSTREAM: add missing returns to non-void functions
Patch3:         vhdlparser-no-return.patch
# suse specific, for ppc64le, workaround for bnc#921577
Patch4:         doxygen-dot-one-thread.patch
BuildRequires:  bison
BuildRequires:  cmake >= 2.8.12
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  gcc-c++
# see graphviz.spec: 
# "If you need output in png format you also need to install graphviz-gnome."
BuildRequires:  graphviz-gnome
BuildRequires:  poppler-tools
BuildRequires:  python-base
BuildRequires:  python-xml
BuildRequires:  texlive-appendix
BuildRequires:  texlive-colortbl
BuildRequires:  texlive-courier
BuildRequires:  texlive-dvips
BuildRequires:  texlive-epstopdf
BuildRequires:  texlive-fancyhdr
BuildRequires:  texlive-float
BuildRequires:  texlive-helvetic
BuildRequires:  texlive-import
BuildRequires:  texlive-latex
BuildRequires:  texlive-makeindex
BuildRequires:  texlive-metafont
BuildRequires:  texlive-multirow
BuildRequires:  texlive-natbib
BuildRequires:  texlive-psnfss
BuildRequires:  texlive-rsfs
BuildRequires:  texlive-sectsty
BuildRequires:  texlive-symbol
BuildRequires:  texlive-tabu
BuildRequires:  texlive-times
BuildRequires:  texlive-tocloft
BuildRequires:  texlive-wasy
BuildRequires:  texlive-wasy2-ps
BuildRequires:  texlive-wasysym
BuildRequires:  texlive-xtab
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Doxygen is a documentation system for C, C++, Java, and IDL. It can
generate an online class browser (in HTML) and an offline reference
manual (in LaTeX) from a set of documented source files. The
documentation is extracted directly from the sources. Doxygen is
developed on a Linux platform, but it runs on most other UNIX flavors
as well.

This package contains only documentation

%prep
%setup -q -n doxygen-%{version} 
%patch3 -p1
%ifarch ppc64le
# see bnc#921577
%patch4 -p1
%endif

%build
%cmake \
    -DDOC_INSTALL_DIR=share/doc/packages/%{name} \
    -Dbuild_doc=ON \
    -Dbuild_xmlparser=OFF \
    -Dbuild_search=OFF \
    -Dbuild_wizard=OFF \
    -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now" \
    -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now" \
    -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now"
make docs %{?_smp_mflags}

%install
%cmake_install docs
rm %{buildroot}%{_bindir}/doxygen
rm -r %{buildroot}%{_mandir}/man1/
%fdupes -s %{buildroot}%{_docdir}/%{name}-doc

%files
%defattr(-,root,root)
%doc %{_docdir}/%{name}

%changelog