File libfuoten.spec of Package libfuoten
#
# spec file for package libfuoten
#
# Copyright (c) 2017 Matthias Fehring <buschmann23@opensuse.org>
#
# 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/
#
%define _soversion 0
%if 0%{?suse_version}
%define __qt5_datadir %{_libqt5_datadir}
%define __qt5_translationdir %{_libqt5_translationdir}
%define __qt5_docdir %{_libqt5_docdir}
%else
%define __qt5_datadir %{_qt5_datadir}
%define __qt5_translationdir %{_qt5_translationdir}
%define __qt5_docdir %{_qt5_docdir}
%endif
Name: libfuoten
Summary: Qt Based ownClud/Nextcloud News App API Library
Version: 0.8.1
Release: 1
License: LGPL-3.0
Group: System/Libraries
Source0: https://github.com/Huessenbergnetz/%{name}/releases/download/v%{verion}/%{name}-%{version}.tar.xz
Source1: https://github.com/Huessenbergnetz/%{name}/releases/download/v%{verion}/%{name}-%{version}.tar.xz.asc
Source2: libfuoten.keyring
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: https://github.com/Huessenbergnetz/libfuoten
BuildRequires: make gcc-c++ pkgconfig
BuildRequires: cmake(Qt5Core) >= 5.6.0
BuildRequires: cmake(Qt5Sql) >= 5.6.0
BuildRequires: cmake(Qt5Network) >= 5.6.0
BuildRequires: pkgconfig(zlib)
BuildRequires: doxygen
%if 0%{?suse_version}
BuildRequires: libqt5-qttools
%if 0%{?suse_version} == 1315
BuildRequires: libqt5-qtdoc
%else
BuildRequires: libqt5-qtdoc-devel
%endif
%else
BuildRequires: qt5-qhelpgenerator
BuildRequires: qt5-qtdoc
%endif
%description
Provides access to the API of the ownCloud/Nextcloud News App, a cloud based
RSS/Atom feed reader.
%package -n %{name}%{_soversion}
Summary: Qt Based ownClud/Nextcloud News App API Library
Group: System/Libraries
Recommends: %{name}-lang = %{version}
%description -n %{name}%{_soversion}
Provides access to the API of the ownCloud/Nextcloud News App, a cloud based
RSS/Atom feed reader.
%package devel
Group: Development/Libraries/C and C++
Summary: Qt Based ownClud/Nextcloud News App API Library - Development Files
Requires: %{name}%{_soversion} = %{version}-%{release}
Recommends: %{name}-doc = %{version}
%description devel
Provides access to the API of the ownCloud/Nextcloud News App, a cloud based
RSS/Atom feed reader.
Development files.
%package doc
Group: Documentation/HTML
Summary: Fuoten Library API Documentation
Requires: libqt5-qtdoc
%description doc
Provides access to the API of the ownCloud/Nextcloud News App, a cloud based
RSS/Atom feed reader.
API documentation for libfuoten, in HTML and QCH format.
%if 0%{?suse_version}
%lang_package -n %{name}%{_soversion}
%else
%package -n %{name}%{_soversion}-lang
Summary: Translations for package %{name}
Group: System/Localization
Requires: %{name}%{_soversion} = %{version}
Provides: %{name}%{_soversion}-lang-all = %{version}
Supplements: %{name}%{_soversion}
BuildArch: noarch
%description -n %{name}%{_soversion}-lang
Provides translations for the \"%{name}\" package.
%endif
%prep
%setup -q
%build
mkdir build
pushd build
%if 0%{?suse_version}
%qmake5 -r INSTALL_PREFIX_DIR=%{_prefix} \
INSTALL_LIB_DIR=%{_libdir} \
INSTALL_HEADERS_DIR=%{_includedir} \
QHG_BIN_PATH=%{_bindir}/qhelpgenerator-qt5 \
../%{name}.pro
%make_jobs
%else
%qmake_qt5 -r INSTALL_PREFIX_DIR=%{_prefix} \
INSTALL_LIB_DIR=%{_libdir} \
INSTALL_HEADERS_DIR=%{_includedir} \
QHG_BIN_PATH=%{_bindir}/qhelpgenerator-qt5 \
../%{name}.pro
make %{?_smp_mflags}
%endif
make docs
popd
%install
pushd build
%if 0%{?suse_version}
%qmake5_install
%else
make INSTALL_ROOT=%{buildroot} install
%endif
popd
install -D -t %{buildroot}/%{__qt5_docdir} qtdocs/libfuoten.qch
install -d %{buildroot}/%{__qt5_docdir}/libfuoten
cp -r qtdocs/html/* %{buildroot}/%{__qt5_docdir}/libfuoten
%find_lang %{name} --with-qt --without-mo
%post -n %{name}%{_soversion} -p /sbin/ldconfig
%postun -n %{name}%{_soversion} -p /sbin/ldconfig
%files -n %{name}%{_soversion}
%defattr(644,root,root,755)
%doc LICENSE AUTHORS README.md CHANGELOG
%_libdir/libfuoten.so.*
%files devel
%defattr(644,root,root,755)
%doc LICENSE AUTHORS
%_libdir/libfuoten.so
%_includedir/Fuoten
%_libdir/pkgconfig/fuoten.pc
%files -n %{name}%{_soversion}-lang -f %{name}.lang
%defattr(644,root,root,755)
%doc LICENSE.translations AUTHORS
%dir %__qt5_datadir
%dir %__qt5_translationdir
%lang(en) %{__qt5_translationdir}/libfuoten.qm
%files doc
%defattr(644,root,root,755)
%doc LICENSE AUTHORS
%{__qt5_docdir}/libfuoten.qch
%{__qt5_docdir}/libfuoten
%changelog