File dbus-cpp.spec of Package dbus-cpp

# spec file for package dbus-cpp
# 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 5

Name:		dbus-cpp
Version:	5.0.0+16.10.20160809
Release:	1
Summary:	A header-only dbus-binding leveraging C++-11
License:	LGPL
Group:		Development/Libraries
Patch0:		dbus-cpp-no-gtest.patch
Patch1:		boost-asio-1-66.patch
BuildRequires:	gcc-c++
BuildRequires:	cmake
BuildRequires:	boost-devel >= 1.58
%if %{defined suse_version} && 0%{?suse_version} > 1330
BuildRequires:	libboost_filesystem-devel >= 1.58
BuildRequires:	libboost_program_options-devel >= 1.58
BuildRequires:	libboost_system-devel >= 1.58
BuildRequires:	pkgconfig(libxml-2.0)
BuildRequires:	pkgconfig(dbus-1)
BuildRequires:	pkgconfig(process-cpp)
%if %{defined suse_version}
BuildRequires:	lsb-release
BuildRequires:	distribution-release
%if %{defined fedora}
BuildRequires:	redhat-lsb-core
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

A header-only dbus-binding leveraging C++-11.

%if %{defined suse_version}

%package -n libdbus-cpp%{sover}
Summary:	 C++11 library for handling processes - runtime library
Group:		System/Libraries

%description -n libdbus-cpp%{sover}
A header-only dbus-binding leveraging C++-11.

This package provides shared libraries for %{name}.

%package devel
Summary:	%{summary}
Group:		Development/Libraries
Requires:	libdbus-cpp%{sover} = %{version}

%description devel
A header-only dbus-binding leveraging C++-11.

This package provides development headers for %{name}.

%setup -q -c
%patch0 -p1
%patch1 -p1

mkdir build
pushd build
cmake .. \
	-DCMAKE_C_FLAGS="%{optflags}" \
	-DCMAKE_CXX_FLAGS="%{optflags} -std=c++11" \
make %{?_smp_mflags}

pushd build
rm -r %{buildroot}/%{_prefix}/libexec/examples


%files -n libdbus-cpp%{sover}

%files devel
%dir %{_includedir}/core
%dir %{_includedir}/core/dbus

%post -n libdbus-cpp%{sover}

%postun -n libdbus-cpp%{sover}