File doxygen.spec of Package doxygen

# spec file for package doxygen
# Copyright (c) 2021 SUSE LLC
# 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

%if 0%{?sle_version} >= 150100
# build with "--with libclang" to enable libclang support
%bcond_with libclang

Name:           doxygen
Version:        1.9.1
Release:        0
Summary:        Automated C, C++, and Java Documentation Generator
# qtools are used for building and they are GPL-3.0 licensed
License:        GPL-2.0-or-later AND GPL-3.0-only
Group:          Development/Tools/Doc Generators
# suse specific
Patch0:         %{name}-modify_footer.patch
# suse specific
Patch1:         %{name}-no-lowercase-man-names.patch
# PATCH-FIX-UPSTREAM: add missing returns to non-void functions
Patch3:         vhdlparser-no-return.patch
Patch10:        doxygen-no-libclang-cpp.patch
BuildRequires:  bison
BuildRequires:  cmake >= 2.8.12
BuildRequires:  flex
%if 0%{?suse_version} <= 1500
BuildRequires:  gcc9-c++
BuildRequires:  gcc-c++
BuildRequires:  python3-base
BuildRequires:  python3-xml
# Do not bother building documentation with latex since it is present on the
# web trivialy for all versions of doxygen
Obsoletes:      doxygen-doc
%if %{with libclang}
BuildRequires:  llvm-clang-devel

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.

%setup -q
%patch0 -p1
%patch1 -p1
%patch3 -p1
%if %{with libclang}
%if 0%{?sle_version} == 150100 || (0%{?sle_version} == 150200 && !0%{?is_opensuse})
%patch10 -p1

%cmake \
    -Dbuild_doc=OFF \
    -Dbuild_xmlparser=ON \
    -Dbuild_search=OFF \
    -Dbuild_wizard=OFF \
%if %{with libclang}
    -Duse_libclang=ON \
%if 0%{?suse_version} <= 1500
    -DCMAKE_C_COMPILER=gcc-9 \
    -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now" \
    -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now" \
    -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now" \

mkdir -p %{buildroot}%{_mandir}/man1/
install -m 644 doc/doxygen.1 %{buildroot}%{_mandir}/man1/

%license LICENSE
%attr(644,root,root) %{_mandir}/man1/doxygen.1%{?ext_man}
%attr(755,root,root) %{_bindir}/*

openSUSE Build Service is sponsored by