File kde-api-documentation.spec of Package kde-api-documentation

# spec file for package kde-api-documentation
#
# 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 https://bugs.opensuse.org/
#

%define docs_name "KDE Docs"
%define ver 5.101
%define qt_ver 5.15
%define qt_ver_minor 5.15.6

Name:           kde-api-documentation
Version:        5.101.0
Release:        0
Summary:        Offline documentation for KDE Plasma Development
License:        LGPL-2.1-or-later
URL:            https://www.kde.org
Source:         http://download.kde.org/stable/frameworks/%{ver}/attica-%{version}.tar.xz
Source1:        http://download.kde.org/stable/frameworks/%{ver}/baloo-%{version}.tar.xz
Source2:        http://download.kde.org/stable/frameworks/%{ver}/bluez-qt-%{version}.tar.xz
Source3:        http://download.kde.org/stable/frameworks/%{ver}/breeze-icons-%{version}.tar.xz
Source4:        http://download.kde.org/stable/frameworks/%{ver}/extra-cmake-modules-%{version}.tar.xz
Source5:        http://download.kde.org/stable/frameworks/%{ver}/frameworkintegration-%{version}.tar.xz
Source6:        http://download.kde.org/stable/frameworks/%{ver}/kactivities-%{version}.tar.xz
Source7:        http://download.kde.org/stable/frameworks/%{ver}/kactivities-stats-%{version}.tar.xz
Source8:        http://download.kde.org/stable/frameworks/%{ver}/kapidox-%{version}.tar.xz
Source9:        http://download.kde.org/stable/frameworks/%{ver}/karchive-%{version}.tar.xz
Source10:       http://download.kde.org/stable/frameworks/%{ver}/kauth-%{version}.tar.xz
Source11:       http://download.kde.org/stable/frameworks/%{ver}/kbookmarks-%{version}.tar.xz
Source12:       http://download.kde.org/stable/frameworks/%{ver}/kcalendarcore-%{version}.tar.xz
Source13:       http://download.kde.org/stable/frameworks/%{ver}/kcmutils-%{version}.tar.xz
Source14:       http://download.kde.org/stable/frameworks/%{ver}/kcodecs-%{version}.tar.xz
Source15:       http://download.kde.org/stable/frameworks/%{ver}/kcompletion-%{version}.tar.xz
Source16:       http://download.kde.org/stable/frameworks/%{ver}/kconfig-%{version}.tar.xz
Source17:       http://download.kde.org/stable/frameworks/%{ver}/kconfigwidgets-%{version}.tar.xz
Source18:       http://download.kde.org/stable/frameworks/%{ver}/kcontacts-%{version}.tar.xz
Source19:       http://download.kde.org/stable/frameworks/%{ver}/kcoreaddons-%{version}.tar.xz
Source20:       http://download.kde.org/stable/frameworks/%{ver}/kcrash-%{version}.tar.xz
Source21:       http://download.kde.org/stable/frameworks/%{ver}/kdav-%{version}.tar.xz
Source22:       http://download.kde.org/stable/frameworks/%{ver}/kdbusaddons-%{version}.tar.xz
Source23:       http://download.kde.org/stable/frameworks/%{ver}/kdeclarative-%{version}.tar.xz
Source24:       http://download.kde.org/stable/frameworks/%{ver}/kded-%{version}.tar.xz
Source25:       http://download.kde.org/stable/frameworks/%{ver}/kdesu-%{version}.tar.xz
Source26:       http://download.kde.org/stable/frameworks/%{ver}/kdnssd-%{version}.tar.xz
Source27:       http://download.kde.org/stable/frameworks/%{ver}/kdoctools-%{version}.tar.xz
Source28:       http://download.kde.org/stable/frameworks/%{ver}/kemoticons-%{version}.tar.xz
Source29:       http://download.kde.org/stable/frameworks/%{ver}/kfilemetadata-%{version}.tar.xz
Source30:       http://download.kde.org/stable/frameworks/%{ver}/kglobalaccel-%{version}.tar.xz
Source31:       http://download.kde.org/stable/frameworks/%{ver}/kguiaddons-%{version}.tar.xz
Source32:       http://download.kde.org/stable/frameworks/%{ver}/kholidays-%{version}.tar.xz
Source33:       http://download.kde.org/stable/frameworks/%{ver}/ki18n-%{version}.tar.xz
Source34:       http://download.kde.org/stable/frameworks/%{ver}/kiconthemes-%{version}.tar.xz
Source35:       http://download.kde.org/stable/frameworks/%{ver}/kidletime-%{version}.tar.xz
Source36:       http://download.kde.org/stable/frameworks/%{ver}/kimageformats-%{version}.tar.xz
Source37:       http://download.kde.org/stable/frameworks/%{ver}/kinit-%{version}.tar.xz
Source38:       http://download.kde.org/stable/frameworks/%{ver}/kio-%{version}.tar.xz
Source39:       http://download.kde.org/stable/frameworks/%{ver}/kirigami2-%{version}.tar.xz
Source40:       http://download.kde.org/stable/frameworks/%{ver}/kitemmodels-%{version}.tar.xz
Source41:       http://download.kde.org/stable/frameworks/%{ver}/kitemviews-%{version}.tar.xz
Source42:       http://download.kde.org/stable/frameworks/%{ver}/kjobwidgets-%{version}.tar.xz
Source43:       http://download.kde.org/stable/frameworks/%{ver}/knewstuff-%{version}.tar.xz
Source44:       http://download.kde.org/stable/frameworks/%{ver}/knotifications-%{version}.tar.xz
Source45:       http://download.kde.org/stable/frameworks/%{ver}/knotifyconfig-%{version}.tar.xz
Source46:       http://download.kde.org/stable/frameworks/%{ver}/kpackage-%{version}.tar.xz
Source47:       http://download.kde.org/stable/frameworks/%{ver}/kparts-%{version}.tar.xz
Source48:       http://download.kde.org/stable/frameworks/%{ver}/kpeople-%{version}.tar.xz
Source49:       http://download.kde.org/stable/frameworks/%{ver}/kplotting-%{version}.tar.xz
Source50:       http://download.kde.org/stable/frameworks/%{ver}/kpty-%{version}.tar.xz
Source51:       http://download.kde.org/stable/frameworks/%{ver}/kquickcharts-%{version}.tar.xz
Source52:       http://download.kde.org/stable/frameworks/%{ver}/krunner-%{version}.tar.xz
Source53:       http://download.kde.org/stable/frameworks/%{ver}/kservice-%{version}.tar.xz
Source54:       http://download.kde.org/stable/frameworks/%{ver}/ktexteditor-%{version}.tar.xz
Source55:       http://download.kde.org/stable/frameworks/%{ver}/ktextwidgets-%{version}.tar.xz
Source56:       http://download.kde.org/stable/frameworks/%{ver}/kunitconversion-%{version}.tar.xz
Source57:       http://download.kde.org/stable/frameworks/%{ver}/kwallet-%{version}.tar.xz
Source58:       http://download.kde.org/stable/frameworks/%{ver}/kwayland-%{version}.tar.xz
Source59:       http://download.kde.org/stable/frameworks/%{ver}/kwidgetsaddons-%{version}.tar.xz
Source60:       http://download.kde.org/stable/frameworks/%{ver}/kwindowsystem-%{version}.tar.xz
Source61:       http://download.kde.org/stable/frameworks/%{ver}/kxmlgui-%{version}.tar.xz
Source62:       http://download.kde.org/stable/frameworks/%{ver}/modemmanager-qt-%{version}.tar.xz
Source63:       http://download.kde.org/stable/frameworks/%{ver}/networkmanager-qt-%{version}.tar.xz
Source64:       http://download.kde.org/stable/frameworks/%{ver}/oxygen-icons5-%{version}.tar.xz
Source65:       http://download.kde.org/stable/frameworks/%{ver}/plasma-framework-%{version}.tar.xz
Source66:       http://download.kde.org/stable/frameworks/%{ver}/prison-%{version}.tar.xz
Source67:       http://download.kde.org/stable/frameworks/%{ver}/purpose-%{version}.tar.xz
Source68:       http://download.kde.org/stable/frameworks/%{ver}/qqc2-desktop-style-%{version}.tar.xz
Source69:       http://download.kde.org/stable/frameworks/%{ver}/solid-%{version}.tar.xz
Source70:       http://download.kde.org/stable/frameworks/%{ver}/sonnet-%{version}.tar.xz
Source71:       http://download.kde.org/stable/frameworks/%{ver}/syndication-%{version}.tar.xz
Source72:       http://download.kde.org/stable/frameworks/%{ver}/syntax-highlighting-%{version}.tar.xz
Source73:       http://download.kde.org/stable/frameworks/%{ver}/threadweaver-%{version}.tar.xz

BuildArch: 		noarch

BuildRequires:  doxygen
BuildRequires:  doxyqml
BuildRequires:  libqt5-qttools
BuildRequires:  graphviz

%description
Offline documentation for KDE Plasma Development.

Create a great-looking application with your own libraries. KDE is ours.

MauiKit allows you to create attractive, innovative and good-looking applications for a pleasant experience. MauKit is convergent, easily create applications that work in mobile devices and desktop computers.

KDE also developed Kirigami UI Framework. Applications using Kirigami adapt brilliantly to mobile, desktop, and everything in between.

%package html
Summary:        Offline development documentation for %{name} for use with a web browser
Group:          Documentation/Other

%description html
Offline documentation for KDE Plasma Development.
Settings application for KDE Plasma
Create a great-looking application with your own libraries. KDE is ours.

MauiKit allows you to create attractive, innovative and good-looking applications for a pleasant experience. MauKit is convergent, easily create applications that work in mobile devices and desktop computers.

KDE also developed Kirigami UI Framework. Applications using Kirigami adapt brilliantly to mobile, desktop, and everything in between.

%package qch
Summary:        Offline development documentation for %{name} for use with Qt Assistant
Group:          Documentation/Other

%description qch
Offline documentation for KDE Plasma Development.

Create a great-looking application with your own libraries. KDE is ours.

MauiKit allows you to create attractive, innovative and good-looking applications for a pleasant experience. MauKit is convergent, easily create applications that work in mobile devices and desktop computers.

KDE also developed Kirigami UI Framework. Applications using Kirigami adapt brilliantly to mobile, desktop, and everything in between.

%prep
mkdir -p %{buildroot}
cd %{_topdir}/SOURCES
for file in $(find -maxdepth 1 -mindepth 1 -type f -name '*.tar.xz' | sed 's;'./';;g'); do
    tar -xf $file --directory %{_topdir}/BUILD;
done

%build
dir=%{_tmppath}/generate-docs
if [ -d $dir ]
then
	rm -r $dir
fi
mkdir -p $dir
cp %{_topdir}/SOURCES/doxyfile.in $dir
cp %{_topdir}/SOURCES/doxygen-awesome* $dir
sed -i 's;project_input;'%{_topdir}/BUILD';g' $dir/doxyfile.in
sed -i 's;project_output;'$dir';g' $dir/doxyfile.in
sed -i 's;project_name;'%{docs_name}\ %{version}';g' $dir/doxyfile.in
sed -i 's;project_brief;Developer documentation for %{name};g' $dir/doxyfile.in
sed -i 's;project_qch_file;%{name};g' $dir/doxyfile.in
sed -i 's;project_qhp_namespace;'%{name}';g' $dir/doxyfile.in
cd $dir
doxygen doxyfile.in

%install
dir=%{_tmppath}/generate-docs
qchdir=%{buildroot}%{_libqt5_docdir}
htmldir=%{buildroot}%{_datadir}/doc/HTML/en
install -m 755 -d $qchdir
mv $dir/html/%{name}.qch $qchdir
mkdir -p $htmldir
install -m 755 -d $htmldir
cp -r $dir/html $htmldir
if [ -d $htmldir/%{name} ]
then
	rm -r $htmldir/%{name}
fi
mv $htmldir/html $htmldir/%{name}
rm -r $dir
rm -r %{_topdir}/BUILD/*

%files qch
%dir %{_libqt5_docdir}
%{_libqt5_docdir}/*.qch

%files html
%dir %{_datadir}/doc/HTML/en/%{name}
%{_datadir}/doc/HTML/en/%{name}

%changelog
openSUSE Build Service is sponsored by