File libmaia.spec of Package libmaia

# spec file for package libmaia
# 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

%define _sover  1
Name:           libmaia
Version:        0.9.0
Release:        0
Summary:        XML-RPC library for Qt
License:        BSD-2-Clause
Group:          Development/Libraries/C and C++
BuildRequires:  libqt5-qtbase-common-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

libmaia is a XML-RPC library for Qt.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Languages/C and C++
Requires:       %{name}%{_sover} = %{version}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package     -n %{name}%{_sover}
Summary:        XML-RPC library for Qt
Group:          System/Libraries

%description -n %{name}%{_sover}
libmaia is a XML-RPC library for Qt.

%setup -q
sed -e 's|/lib|/%{_lib}|' -e 's|staticlib|sharedlib|' -i

export CXXFLAGS="-fPIC"
%qmake5 PREFIX=%{_prefix}
make %{?_smp_mflags}

mkdir -pv %{buildroot}%{_libdir}/pkgconfig
# creates support file for pkg-config
tee %{buildroot}/%{_libdir}/pkgconfig/maia.pc << "EOF"

Name: maia
Description: XML-RPC library for Qt
Version: %{version}
Libs: -L${libdir} -lmaia
Cflags: -I${includedir}/maia

%post -n %{name}%{_sover} -p /sbin/ldconfig
%postun -n %{name}%{_sover} -p /sbin/ldconfig

%files -n %{name}%{_sover}
%doc Changelog LICENSE

%files devel
%doc Changelog LICENSE
%dir %{_includedir}/maia