LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File c++utilities.spec of Package c++utilities (Project home:mkittler:vcs)

#
# spec file for package c++utilities
#
# Copyright (c) 2018-2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018-2019 Martchus
#
# 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 reponame c++utilities
%define soname 5

Name:           %{reponame}
Version:        5.0.0
Release:        0
Summary:        Common C++ classes and routines
License:        GPL-2.0+
Group:          Development/Libraries/C and C++
Url:            https://github.com/Martchus/cpp-utilities
Source:         cpp-utilities-%{version}.tar.xz
BuildRequires:  cmake >= 3.9
BuildRequires:  cppunit-devel >= 1.14.0
%if 0%{?sle_version} && 0%{?sle_version} <= 120400
BuildRequires:  gcc6-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  pkgconfig
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Common C++ classes and routines such as argument parser, IO and conversion utilities.

%package -n lib%{reponame}%{soname}
Summary:        Common C++ classes and routines
Group:          System/Libraries

%description -n lib%{reponame}%{soname}
Common C++ classes and routines such as argument parser, IO and conversion utilities.

%package devel
Summary:        Devel files for %{reponame}
Group:          Development/Libraries/C and C++
Requires:       cmake >= 3.9
Requires:       glibc-devel
Requires:       lib%{reponame}%{soname} = %{version}
Requires:       libstdc++-devel
Requires:       pkg-config

%description devel
Development files for %{reponame}

%prep
%setup -q -n cpp-utilities-%{version}

%build
%if 0%{?sle_version} && 0%{?sle_version} <= 120400
export CC=gcc-6
export CXX=g++-6
%endif
%cmake \
  -DBUILD_SHARED_LIBS:BOOL="ON" \
  -DLIB_SUFFIX_64:STRING="64"
%if 0%{?fedora_version}
make %{?_smp_mflags}
%else
%make_jobs
%endif

%check
%if 0%{?fedora_version}
%if 0%{?fedora_version} < 28
# FIXME: fix tests under Fedora 28 and higher
make %{?_smp_mflags} check
%endif
%else
cd build
export LD_LIBRARY_PATH="$PWD:$LD_LIBRARY_PATH"
make %{?_smp_mflags} check
%endif

%install
%if 0%{?fedora_version}
DESTDIR=%{buildroot} make %{?_smp_mflags} install
%else
%cmake_install
%endif

%post -n lib%{reponame}%{soname} -p /sbin/ldconfig
%postun -n lib%{reponame}%{soname} -p /sbin/ldconfig

%files -n lib%{reponame}%{soname}
%license LICENSE
%{_libdir}/lib%{reponame}.so.%{soname}*

%files devel
%doc README.md
%{_includedir}/%{reponame}
%{_datadir}/%{reponame}
%{_libdir}/pkgconfig/%{reponame}.pc
%{_libdir}/lib%{reponame}.so

%changelog