File bcmatroska2.spec of Package bcmatroska2

#
# spec file for package bcmatroska2
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#



%define _cmakename BCMatroska2
%define sover   0
Name:           bcmatroska2
Version:        5.3.5
# Fedora release look standard from OpenSUSE build service:
# Release:      <CI_CNT>.<B_CNT>
# Release:      %%{?release_prefix}.<CI_CNT>.<B_CNT>
# where rpm macro %%{release_prefix} is defined in spec file
# Normally it looks like:
# Release:      63.fc38 for Fedora packages which is scripted as:
# Release:      0%%{?dist}
# OpenSUSE build service allows for this variant:
# Release:      63.1.fc38
# Release:       <CI_CNT>.<B_CNT>%%{?dist}
#
# Add this to Project Config to tag Fedora packages with fcXX:
# ------------------------------
# # reset release name
# onepercentage%%if 0onepercentage%%{?fedora_version}
# Release: <CI_CNT>.<B_CNT> spec:<CI_CNT>.<B_CNT>twopercentage%%{?dist}
# onepercentage%%endif
# ------------------------------
Release:        0
Summary:        C Library to Deal with Matroska Files
License:        BSD-3-Clause AND Zlib AND GPL-2.0-or-later
Group:          Development/Libraries/C and C++
URL:            https://gitlab.linphone.org/BC/public/bcmatroska2
Source:         bcmatroska2-%{version}.tar.bz2
Source1:        baselibs.conf
#Patch0:         bcmatroska2-include-subdir.patch
BuildRequires:  chrpath
BuildRequires:  cmake
BuildRequires:  bctoolbox-devel >= 5.3.5
BuildRequires:  git-core >= 1.7.10

%description
Bcmatroska2 is a C library to parse Matroska files (.mkv and .mka).

%package -n lib%{name}-%{sover}
Summary:        C Library to Deal with Matroska Files
Group:          Development/Libraries/C and C++

%description -n lib%{name}-%{sover}
Bcmatroska2 is a C library to parse Matroska files (.mkv and .mka).

%package devel
Summary:        Development files for bcmatroska2
Group:          Development/Libraries/C and C++
Requires:       lib%{name}-%{sover} = %{version}
# Needed by mediastreamer2. This is a fake minor version because upstream didn't release
# a '.1', therefore we've gotta use this workaround.
#Provides:       %%{name}-devel = 0.23.1
Provides:       %{name}-devel = %{version}

%description devel
This package includes the files necessary for compiling and linking
applications which will use libbcmatroska2.

%prep
%setup -q
#%%patch0 -p1

%build
%cmake \
  -DENABLE_STATIC=OFF \
  -DENABLE_STRICT=OFF
%cmake_build

%install
%cmake_install

chrpath -d %{buildroot}%{_libdir}/lib%{name}.so.%{sover}*

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

%files -n lib%{name}-%{sover}
%{_libdir}/lib%{name}.so.%{sover}*

%files devel
#%%dir %%{_includedir}/%%{name}
#%%dir %%{_includedir}/%%{name}/corec
%dir %{_includedir}/corec
#%%dir %%{_includedir}/%%{name}/ebml
%dir %{_includedir}/ebml
#%%dir %%{_includedir}/%%{name}/matroska
%dir %{_includedir}/matroska
#%%{_includedir}/%%{name}/corec/*
%{_includedir}/corec/*
#%%{_includedir}/%%{name}/ebml/*
%{_includedir}/ebml/*
#%%{_includedir}/%%{name}/matroska/*
%{_includedir}/matroska/*
%{_libdir}/libbcmatroska2.so
%dir %{_datadir}/%{_cmakename}
%dir %{_datadir}/%{_cmakename}/cmake
%{_datadir}/%{_cmakename}/cmake/*

%changelog
openSUSE Build Service is sponsored by