2018-09-28 15:44:23 +02:00
|
|
|
#
|
2021-12-07 16:27:48 +01:00
|
|
|
# spec file for package libcbor-doc
|
2018-09-28 15:44:23 +02:00
|
|
|
#
|
2023-01-17 19:41:19 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2018-09-28 15:44:23 +02: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.
|
|
|
|
|
2020-01-03 11:00:49 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-09-28 15:44:23 +02:00
|
|
|
#
|
|
|
|
|
2020-05-25 10:33:30 +02:00
|
|
|
|
|
|
|
%define socurrent 0
|
2023-01-17 19:41:19 +01:00
|
|
|
%define sorevision 10
|
|
|
|
%define soage 1
|
2020-05-25 10:33:30 +02:00
|
|
|
%define lname libcbor%{socurrent}_%{sorevision}
|
2021-12-05 13:02:02 +01:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
2021-12-07 16:27:48 +01:00
|
|
|
%if "%{flavor}" == "doc"
|
|
|
|
Name: libcbor-doc
|
|
|
|
%else
|
2018-09-28 15:44:23 +02:00
|
|
|
Name: libcbor
|
2021-12-07 16:27:48 +01:00
|
|
|
%endif
|
2023-01-17 19:41:19 +01:00
|
|
|
Version: 0.10.1
|
2018-09-28 15:44:23 +02:00
|
|
|
Release: 0
|
2018-09-30 10:21:11 +02:00
|
|
|
Summary: Library for parsing Concise Binary Object Representation (CBOR)
|
2018-09-28 15:44:23 +02:00
|
|
|
License: MIT
|
2018-09-30 10:21:11 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2021-12-05 13:02:02 +01:00
|
|
|
URL: https://github.com/PJK/libcbor
|
2021-12-07 16:27:48 +01:00
|
|
|
Source0: https://github.com/PJK/libcbor/archive/v%{version}.tar.gz
|
2021-12-05 13:02:02 +01:00
|
|
|
%if "%{flavor}" == "doc"
|
2020-05-25 10:33:30 +02:00
|
|
|
BuildRequires: doxygen
|
2021-12-05 13:02:02 +01:00
|
|
|
BuildRequires: python3-Sphinx
|
|
|
|
BuildRequires: python3-breathe
|
|
|
|
%else
|
|
|
|
BuildRequires: cmake
|
2018-09-28 15:44:23 +02:00
|
|
|
BuildRequires: gcc-c++
|
2020-01-03 11:00:49 +01:00
|
|
|
BuildRequires: libcmocka-devel
|
2020-05-25 10:33:30 +02:00
|
|
|
BuildRequires: ninja
|
2021-12-05 13:02:02 +01:00
|
|
|
%endif
|
2018-09-28 15:44:23 +02:00
|
|
|
|
|
|
|
%description
|
2018-09-30 10:21:11 +02:00
|
|
|
libcbor is a C99 library for parsing and generating CBOR (RFC 7049),
|
|
|
|
a general-purpose schema-less binary data format.
|
|
|
|
|
|
|
|
It supports flexible memory management, UTF-8, streams & incremental
|
|
|
|
processing, and has a layered architecture.
|
2021-12-05 13:02:02 +01:00
|
|
|
|
2018-09-28 15:44:23 +02:00
|
|
|
%package -n %{lname}
|
2018-09-30 10:21:11 +02:00
|
|
|
Summary: Library for parsing Concise Binary Object Representation (CBOR)
|
2018-09-28 15:44:23 +02:00
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n %{lname}
|
2018-09-30 10:21:11 +02:00
|
|
|
libcbor is a C99 library for parsing and generating CBOR (RFC 7049),
|
|
|
|
a general-purpose schema-less binary data format.
|
2018-09-28 15:44:23 +02:00
|
|
|
|
2018-09-30 10:21:11 +02:00
|
|
|
It supports flexible memory management, UTF-8, streams & incremental
|
|
|
|
processing, and has a layered architecture.
|
2018-09-28 15:44:23 +02:00
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for libcbor
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: %{lname} = %{version}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
libcbor is a C library for parsing and generating CBOR.
|
|
|
|
The libcbor-devel contains libraries and header files for libcbor.
|
|
|
|
|
|
|
|
%prep
|
2021-12-07 16:27:48 +01:00
|
|
|
%autosetup -n libcbor-%{version}
|
2018-09-28 15:44:23 +02:00
|
|
|
sed -i 's|${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig|${CMAKE_INSTALL_LIBDIR}/pkgconfig|' src/CMakeLists.txt
|
|
|
|
|
|
|
|
%build
|
2023-01-17 19:41:19 +01:00
|
|
|
export CFLAGS="%(echo %{optflags}) -Wno-return-type"
|
|
|
|
export CXXFLAGS="$CFLAGS"
|
2021-12-05 13:02:02 +01:00
|
|
|
%if "%{flavor}" == "doc"
|
|
|
|
%make_build -C doc man
|
|
|
|
%else
|
2020-05-25 10:33:30 +02:00
|
|
|
|
|
|
|
%define __builder ninja
|
2018-09-28 15:44:23 +02:00
|
|
|
%cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=ON
|
2020-05-25 10:33:30 +02:00
|
|
|
%cmake_build
|
2021-12-05 13:02:02 +01:00
|
|
|
%endif
|
2018-09-28 15:44:23 +02:00
|
|
|
|
|
|
|
%install
|
2021-12-05 13:02:02 +01:00
|
|
|
%if "%{flavor}" == "doc"
|
2022-08-26 12:40:04 +02:00
|
|
|
mkdir -p %{buildroot}%{_mandir}/man3
|
|
|
|
cp doc/build/man/*.3 %{buildroot}%{_mandir}/man3
|
|
|
|
|
2021-12-05 13:02:02 +01:00
|
|
|
%else
|
|
|
|
|
|
|
|
%cmake_install
|
|
|
|
%endif
|
2018-09-28 15:44:23 +02:00
|
|
|
|
2020-05-25 10:33:30 +02:00
|
|
|
%post -n %{lname} -p /sbin/ldconfig
|
2018-09-28 15:44:23 +02:00
|
|
|
%postun -n %{lname} -p /sbin/ldconfig
|
|
|
|
|
2021-12-05 13:02:02 +01:00
|
|
|
%if "%{flavor}" == "doc"
|
2021-12-07 16:27:48 +01:00
|
|
|
%files
|
2020-05-25 10:33:30 +02:00
|
|
|
%doc CHANGELOG.md README.md
|
2018-09-28 15:44:23 +02:00
|
|
|
%{_mandir}/*/*
|
2021-12-05 13:02:02 +01:00
|
|
|
|
|
|
|
%else
|
|
|
|
|
|
|
|
%files -n %{lname}
|
|
|
|
%license LICENSE.md
|
2020-05-25 10:33:30 +02:00
|
|
|
%{_libdir}/libcbor.so.%{socurrent}.%{sorevision}
|
|
|
|
%{_libdir}/libcbor.so.%{socurrent}.%{sorevision}.%{soage}
|
2018-09-28 15:44:23 +02:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%{_includedir}/cbor.h
|
|
|
|
%dir %{_includedir}/cbor
|
|
|
|
%{_includedir}/cbor/*.h
|
|
|
|
%dir %{_includedir}/cbor/internal
|
|
|
|
%{_includedir}/cbor/internal/*.h
|
|
|
|
%{_libdir}/libcbor.so
|
|
|
|
%{_libdir}/pkgconfig/libcbor.pc
|
2021-12-05 13:02:02 +01:00
|
|
|
%endif
|
2018-09-28 15:44:23 +02:00
|
|
|
|
|
|
|
%changelog
|