File doxygen.spec of Package doxygen

#
# spec file for package doxygen
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (C) 2012-2013, Li-Pro.Net, Jena, 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/
#
# nodebuginfo


%define		isa64bit	%([ "x%{__isa_bits}" == "x64" ] && echo 1 || echo 0)

# RPM Goups, see: cat /usr/share/doc/rpm-*/GROUPS
%define		pkggroup	Development/Tools
%define		docpkggroup	Documentation
%define		buildreq	binutils gcc-c++ libstdc++-devel perl tex(latex) ghostscript gettext flex bison

%define patch_from_debian \
  for p in $(grep -v '^#' debian/patches/series | awk '{print $1}'); do \\\
    %{__patch} -p1 < debian/patches/$p; done \\\
%{nil}

Name:           doxygen
Version:        1.8.4
Epoch:          1
Release:        0
Summary:        A documentation system for C/C++
License:        GPL-2.0+
Group:          %{pkggroup}
Url:            http://www.stack.nl/~dimitri/doxygen/index.html
Source0:        ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
Source1:        debian.tar.gz
Patch100:       doxygen-tmake_rpm_optflags.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  %{buildreq}

%description
Doxygen can generate an online class browser (in HTML) and/or a
reference manual (in LaTeX) from a set of documented source files. The
documentation is extracted directly from the sources. Doxygen can
also be configured to extract the code structure from undocumented
source files.

%package doc
Summary:        Documentation for doxygen
Group:          %{docpkggroup}
Requires:       %{name} = %{version}

%description doc
This package contains the documentation for doxygen.

%prep
%setup -q
tar xvzf %SOURCE1
%{patch_from_debian}
%patch100 -p1 -b .doxygen-tmake_rpm_optflags

%build
./configure \
	--prefix %{_prefix} \
	--install %{_bindir}/install \
	--shared \
	--release

# workaround for "Error: operand out of range", language.cpp needs to be splitted
%ifarch ppc64
make -C src Makefile.libdoxygen
sed -i -e "s|-o ../objects/language.o|-fno-merge-constants -fsection-anchors -o ../objects/language.o|" src/Makefile.libdoxygen
%endif

make %{?_smp_mflags} all
make %{?_smp_mflags} docs

%install
rm -rf %{buildroot}

make install DESTDIR=%{buildroot}

# convert into utf-8
iconv --from=ISO-8859-1 --to=UTF-8 LANGUAGE.HOWTO > LANGUAGE.HOWTO.new
touch -r LANGUAGE.HOWTO LANGUAGE.HOWTO.new
mv LANGUAGE.HOWTO.new LANGUAGE.HOWTO

# drop -x bit
find examples -type f | xargs chmod -x

# fix multilib issue
cat examples/Makefile | grep -v QTDIR | grep -v QMAKE | > examples/Makefile1
mv -f examples/Makefile1 examples/Makefile

#move manpages
mkdir -p %{buildroot}%{_mandir}
mv %{buildroot}%{_prefix}/man/* %{buildroot}%{_mandir}

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc LANGUAGE.HOWTO LICENSE README
%{_bindir}/doxygen
%{_mandir}/man1/doxygen.1*

%files doc
%defattr(-,root,root)
%doc LANGUAGE.HOWTO LICENSE README
%doc html
%doc examples

%changelog
openSUSE Build Service is sponsored by