2019-01-12 14:08:32 +00:00
|
|
|
#
|
2025-06-14 23:38:36 +00:00
|
|
|
# spec file for package c++utilities
|
2019-01-12 14:08:32 +00:00
|
|
|
#
|
2025-06-14 23:46:00 +00:00
|
|
|
# Copyright (c) 2025 SUSE LLC
|
2019-01-12 14:08:32 +00:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2017-06-08 21:35:04 +00:00
|
|
|
%define reponame c++utilities
|
2025-06-14 23:38:36 +00:00
|
|
|
%define soname 5
|
|
|
|
|
|
|
|
Name: %{reponame}
|
2025-06-14 21:31:15 +00:00
|
|
|
Version: 5.28.1
|
2019-01-12 14:08:32 +00:00
|
|
|
Release: 0
|
2016-06-29 13:48:39 +00:00
|
|
|
Summary: Common C++ classes and routines
|
2019-01-12 14:08:32 +00:00
|
|
|
License: GPL-2.0-or-later
|
2017-11-16 13:19:11 +00:00
|
|
|
Group: Development/Libraries/C and C++
|
2019-01-12 14:08:32 +00:00
|
|
|
URL: https://github.com/Martchus/cpp-utilities
|
2017-03-24 15:26:54 +00:00
|
|
|
Source: https://github.com/Martchus/cpp-utilities/archive/v%{version}/cpp-utilities-%{version}.tar.gz
|
2025-06-14 23:38:36 +00:00
|
|
|
BuildRequires: cmake >= 3.17
|
|
|
|
%if 0%{?fedora}
|
|
|
|
%else
|
|
|
|
BuildRequires: ninja
|
|
|
|
%endif
|
|
|
|
BuildRequires: cppunit-devel >= 1.14.0
|
|
|
|
%if 0%{?sle_version} && 0%{?sle_version} < 160000
|
|
|
|
BuildRequires: gcc9-c++
|
|
|
|
%else
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
%endif
|
2019-01-12 14:08:32 +00:00
|
|
|
BuildRequires: pkgconfig
|
2025-06-14 23:38:36 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2016-06-29 13:48:39 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Common C++ classes and routines such as argument parser, IO and conversion utilities.
|
|
|
|
|
2017-11-16 13:19:11 +00:00
|
|
|
%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.
|
2016-06-29 13:48:39 +00:00
|
|
|
|
|
|
|
%package devel
|
2017-06-08 21:35:04 +00:00
|
|
|
Summary: Devel files for %{reponame}
|
2016-11-02 11:13:11 +00:00
|
|
|
Group: Development/Libraries/C and C++
|
2025-06-14 23:38:36 +00:00
|
|
|
Requires: cmake >= 3.9
|
2016-11-02 11:13:11 +00:00
|
|
|
Requires: glibc-devel
|
2025-06-14 23:38:36 +00:00
|
|
|
Requires: lib%{reponame}%{soname} = %{version}
|
2016-11-02 11:13:11 +00:00
|
|
|
Requires: libstdc++-devel
|
2025-06-14 23:38:36 +00:00
|
|
|
Requires: doxygen
|
|
|
|
Requires: pkg-config
|
2016-06-29 13:48:39 +00:00
|
|
|
|
|
|
|
%description devel
|
2017-06-08 21:35:04 +00:00
|
|
|
Development files for %{reponame}
|
2016-06-29 13:48:39 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n cpp-utilities-%{version}
|
|
|
|
|
|
|
|
%build
|
2025-06-14 23:38:36 +00:00
|
|
|
%if 0%{?sle_version} && 0%{?sle_version} < 160000
|
|
|
|
export CC=gcc-9
|
|
|
|
export CXX=g++-9
|
|
|
|
%endif
|
|
|
|
%if 0%{?fedora}
|
|
|
|
%else
|
|
|
|
%define __builder ninja
|
|
|
|
%endif
|
|
|
|
%cmake \
|
|
|
|
-DBUILD_SHARED_LIBS:BOOL=ON
|
|
|
|
%if 0%{?fedora} && 0%{?fedora_version} < 33
|
2016-06-29 13:48:39 +00:00
|
|
|
make %{?_smp_mflags}
|
2025-06-14 23:38:36 +00:00
|
|
|
%else
|
|
|
|
%cmake_build
|
|
|
|
%endif
|
2016-06-29 13:48:39 +00:00
|
|
|
|
2017-07-20 00:46:14 +00:00
|
|
|
%check
|
2025-06-14 23:38:36 +00:00
|
|
|
%if 0%{?fedora}
|
|
|
|
%if 0%{?fedora_version} < 33
|
|
|
|
make %{?_smp_mflags} check
|
|
|
|
%else
|
|
|
|
export LD_LIBRARY_PATH="$PWD/%{__cmake_builddir}:$LD_LIBRARY_PATH"
|
|
|
|
%cmake_build --target check
|
|
|
|
%endif
|
|
|
|
%else
|
|
|
|
%if (0%{?sle_version} == 150200 || 0%{?sle_version} == 150300) && 0%{?is_opensuse}
|
|
|
|
# FIXME: fix tests under Leap 15.2 which fail at some point with "1/1 Test #1: ...........***Exception: SegFault 0.02 sec"
|
|
|
|
%else
|
|
|
|
cd "%{__builddir}"
|
|
|
|
export LD_LIBRARY_PATH="$PWD:$LD_LIBRARY_PATH"
|
|
|
|
%cmake_build check
|
|
|
|
%endif
|
|
|
|
%endif
|
2017-07-20 00:46:14 +00:00
|
|
|
|
2016-06-29 13:48:39 +00:00
|
|
|
%install
|
2025-06-14 23:38:36 +00:00
|
|
|
%if 0%{?fedora} && 0%{?fedora_version} < 33
|
|
|
|
DESTDIR=%{buildroot} make %{?_smp_mflags} install
|
|
|
|
%else
|
|
|
|
%cmake_install
|
|
|
|
%endif
|
2016-06-29 13:48:39 +00:00
|
|
|
|
2025-06-14 23:38:36 +00:00
|
|
|
%post -n lib%{reponame}%{soname} -p /sbin/ldconfig
|
|
|
|
%postun -n lib%{reponame}%{soname} -p /sbin/ldconfig
|
2016-06-29 13:48:39 +00:00
|
|
|
|
2025-06-14 23:38:36 +00:00
|
|
|
%files -n lib%{reponame}%{soname}
|
|
|
|
%license LICENSE
|
|
|
|
%{_libdir}/lib%{reponame}.so.%{soname}*
|
2016-06-29 13:48:39 +00:00
|
|
|
|
|
|
|
%files devel
|
2019-01-12 14:08:32 +00:00
|
|
|
%doc README.md
|
2017-06-08 21:35:04 +00:00
|
|
|
%{_includedir}/%{reponame}
|
|
|
|
%{_datadir}/%{reponame}
|
|
|
|
%{_libdir}/pkgconfig/%{reponame}.pc
|
2025-06-14 23:38:36 +00:00
|
|
|
%{_libdir}/lib%{reponame}.so
|
2019-01-12 14:08:32 +00:00
|
|
|
|
|
|
|
%changelog
|