File bcg729.spec of Package bcg729
# SPEC file for package 'bcg729'
# Adaptation by Kimi of existing SPEC file for OpenSUSE builds only with
# the following licence text:
# "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."
# The purpose of the adaptation is to allow for muilti-OS RPM builds,
# such as Fedora.
%define numberOfProcessorsOnMachine %(nproc)
%define wantedJobs %(echo "1.25*%{numberOfProcessorsOnMachine}" | bc -l)
%define jobsIget %(echo %{wantedJobs} | awk '{print int(\$1+0.5)}')
%define release_prefix %{?dist}
%define sover 0
Name: bcg729
Version: 5.3.0
# 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: Encoder and decoder of the ITU G.729 Annex A/B speech codec
License: GPL-3.0-only
Group: Development/Libraries/C and C++
URL: https://gitlab.linphone.org/BC/public/bcg729
#Source: https://gitlab.linphone.org/BC/public/bcg729/-/archive/%%{version}/bcg729-%%{version}.tar.gz
Source: %{name}-%{version}.tar.bz2
Source1: baselibs.conf
# PATCH-FIX-OPENSUSE bcg729-fix-pkgconfig.patch sor.alexei@meowr.ru -- Install libbcg729.pc.
Patch0: bcg729-fix-pkgconfig.patch
%if 0%{?suse_version} > 1500
# openSUSE Tumbleweed
%endif
%if 0%{?sle_version} == 150600 && 0%{?is_opensuse}
# openSUSE Leap 15.6
%endif
%if 0%{?suse_version}
BuildRequires: cmake
BuildRequires: pkgconfig
BuildRequires: procps
BuildRequires: bc
%endif
%if 0%{?fedora_version}
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: procps-ng
BuildRequires: bc
%endif
%description
Bcg729 is an implementation of both encoder and decoder of the ITU
G.729 Annex A/B speech codec. It supports concurrent channels
encoding/decoding for multi call application such as conferencing.
%package -n lib%{name}-%{sover}
Group: Development/Libraries/C and C++
Summary: Encoder and decoder of the ITU G.729 Annex A/B speech codec
%description -n lib%{name}-%{sover}
Bcg729 is an implementation of both encoder and decoder of the ITU
G.729 Annex A/B speech codec. It supports concurrent channels
encoding/decoding for multi call application such as conferencing.
%package devel
Group: Development/Languages/C and C++
Summary: Development files for libbcg729
Requires: lib%{name}-%{sover} = %{version}
%description devel
This package includes the files necessary for compiling and linking
application which will use libbcg729.
%prep
echo
echo
echo
echo "--- Entering section %%prep ---"
echo
echo
echo
%setup -q
# The usage of %%patchN is not supported by RPM >= 4.20. The preferred way to
# apply patches are, in order:
# %%autosetup -p1
# %%autosetup -N / %%autopatch -p1
# %%setup / %%patch -P <N> -p 1 (upper case P denotes patch number,lower case is the usual patch -p<num> strip level)
#
# Deprecated: %%patch0 -p1
# Changed into:
%patch -P 0 -p 1
echo
echo
echo
echo "--- Exiting section %%prep ---"
echo
echo
echo
%build
echo
echo
echo
echo "--- Entering section %%build ---"
echo
echo
echo
echo numberOfProcessorsOnMachine=%{numberOfProcessorsOnMachine}
echo wantedJobs=%{wantedJobs}
echo jobsIget=%{jobsIget}
echo
echo 0%%{?fedora}=0%{?fedora}
echo 0%%{?fedora_version}=0%{?fedora_version}
echo 0%%{?rhel_version}=0%{?rhel_version}
echo 0%%{?centos_version}=0%{?centos_version}
echo 0%%{?openeuler_version}=0%{?openeuler_version}
echo 0%%{?sle_version}=0%{?sle_version}
echo 0%%{?is_opensuse}=0%{?is_opensuse}
echo
echo %%{dist}=%{dist}
echo
echo "Current directory:"
echo " $(pwd)"
echo
#find /home/abuild/rpmbuild
%if 0%{?fedora_version}
echo
echo "This build is for Fedora"
echo
#find /usr/lib/gcc/x86_64-redhat-linux/11/plugin
echo
mkdir -p -v %{_builddir}/%{name}-%{version}/build
cd %{_builddir}/%{name}-%{version}/build
echo "Changed to directory:"
echo " $(pwd)"
#CC=/usr/bin/x86_64-linux-gnu-gcc CXX=/usr/bin/x86_64-linux-gnu-g++ cmake /home/abuild/rpmbuild/BUILD/%{name}-%{version}/. \
# -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=lib64 \
# -DLIB_SUFFIX=64 \
cmake /home/abuild/rpmbuild/BUILD/%{name}-%{version}/. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_STATIC=OFF \
-DCMAKE_C_COMPILER_FORCED=TRUE \
-DCMAKE_CXX_COMPILER_FORCED=TRUE \
-DCMAKE_BUILD_PARALLEL_LEVEL=%{jobsIget}
echo
#CC=/usr/bin/x86_64-linux-gnu-gcc CXX=/usr/bin/x86_64-linux-gnu-g++ cmake --build . -j %{jobsIget}
cmake --build . -j %{jobsIget}
echo
echo
echo
echo "--- Build Fedora should be completed here ---"
echo
echo
echo
%endif
%if 0%{?suse_version}
echo
echo "This build is for openSUSE"
echo
echo "Executing configuration command:"
echo " %%cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_STATIC=OFF \
-DENABLE_DOC=ON"
%cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_STATIC=OFF \
-DENABLE_DOC=ON
echo
echo "Executing build command:"
echo " %%cmake_build"
echo
%cmake_build
echo
echo
echo
echo "--- Build OpenSUSE Tumbleweed or OpenSUSE Leap 15.4 should be completed here ---"
echo
echo
echo
%endif
echo
echo
echo
echo "--- Exiting section %%build ---"
echo
echo
echo
%install
echo
echo
echo
echo "--- Entering section %%install ---"
echo
echo
echo
echo %%{_includedir}=%{_includedir}
echo %%{_libdir}=%{_libdir}
echo %%{_datadir}=%{_datadir}
sleep 1
echo
echo CMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX
%if 0%{?fedora} > 0
rm -f $HOME/.rpmmacros
export QA_RPATHS=$(( 0x0001|0x0002 ))
export QA_SKIP_RPATHS=1
%endif
%if 0%{?fedora} > 1 || 0%{?rhel_version} > 1 || 0%{?centos_version} > 1 || 0%{?openeuler_version} > 1 || 0%{?sle_version} == 150300
echo
echo "This install is for Fedora, RHEL, CentOS, OpenEuler, OpenSUSE Leap 15.3"
echo
#cat %%{_builddir}/%%{name}-%%{version}/build/cmake_install.cmake
echo "--- Files that have been built ---"
echo "----------------------------------"
find %{_builddir}/%{name}-%{version}/build
echo "--- End files that have been built ---"
cd %{_builddir}
rm -rvf %{buildroot}
mkdir -pv %{buildroot}
cd %{name}-%{version}/build
echo "Changed to directory:"
echo " $(pwd)"
echo
DESTDIR=%{buildroot}/usr
#cmake --install . --config Debug --prefix --component --strip
#cmake --install . --config RelWithDebInfo --prefix %{buildroot}/usr --component --strip
echo
echo "Executing install command:"
echo " cmake --install . --config RelWithDebInfo --prefix %{buildroot}/usr --strip"
echo
cmake --install . --config RelWithDebInfo --prefix %{buildroot}/usr --strip
echo
%if 0%{?fedora} >= 36
echo "--- Move lib -> lib64 ---"
mv -v %{buildroot}/usr/lib %{buildroot}/usr/lib64
find %{buildroot}
%endif
echo
echo %%{_includedir}=%{_includedir}
echo %%{_libdir}=%{_libdir}
echo %%{_datadir}=%{_datadir}
echo
echo
echo
echo
echo "--- Install files should have completed here ---"
echo
echo
echo
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} == 150500 || 0%{?sle_version} == 150600 && 0%{?is_opensuse}
echo
echo "This install is for OpenSUSE Tumbleweed and OpenSUSE Leap 15.5 and 15.6"
echo
# echo CMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX
# The following two lines are made by %%cmake_install on third line.
#rm -rvf %%{buildroot}
#mkdir -pv %%{buildroot}
echo
echo "Executing install command:"
echo " %%cmake_install"
echo
%cmake_install
echo
echo
echo
echo "--- Install files should have completed here ---"
echo
echo
echo
%endif
%if 0%{?fedora} > 1 || 0%{?rhel_version} > 1 || 0%{?centos_version} > 1 || 0%{?openeuler_version} > 1 || 0%{?sle_version} == 150300 && 0%{?is_opensuse} || 0%{?suse_version} > 1500 || 0%{?sle_version} == 150400 && 0%{?is_opensuse}
echo
echo
echo
echo "--- Show files ---"
echo
echo
echo
find %{buildroot}
echo
echo
echo
echo "--- End show files ---"
echo
echo
echo
%endif
echo
echo
echo
echo "--- Exiting section %%install ---"
echo
echo
echo
%post -n lib%{name}-%{sover} -p /sbin/ldconfig
%postun -n lib%{name}-%{sover} -p /sbin/ldconfig
%if 0%{?fedora} > 1 && 0%{?fedora} < 36 || 0%{?rhel_version} > 1 || 0%{?centos_version} > 1 || 0%{?openeuler_version} > 1
%files -n lib%{name}-%{sover}
%license LICENSE.txt
%doc CHANGELOG.md README.md
%{_libdir}/lib%{name}.so.%{sover}
# Installed (but unpackaged) file(s) found:
/usr/lib64/libbcg729.so.0
%files devel
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
%{_datadir}/Bcg729/cmake/
%{_libdir}/pkgconfig/lib%{name}.pc
# Installed (but unpackaged) file(s) found:
/usr/include/bcg729/decoder.h
/usr/include/bcg729/encoder.h
/usr/lib64/libbcg729.so
/usr/lib64/libbcg729.so.0
/usr/lib64/pkgconfig/libbcg729.pc
/usr/share/Bcg729/cmake/Bcg729Config.cmake
/usr/share/Bcg729/cmake/Bcg729ConfigVersion.cmake
/usr/share/Bcg729/cmake/Bcg729Targets.cmake
%endif
%if 0%{?fedora_version}
%files -n lib%{name}-%{sover}
%license LICENSE.txt
%doc CHANGELOG.md README.md
%{_libdir}/lib%{name}.so.%{sover}
# Installed (but unpackaged) file(s) found:
/usr/lib64/lib*.so.*
%files devel
# Installed (but unpackaged) file(s) found:
/usr/include/bcg729
/usr/lib64/lib*.so
/usr/lib64/pkgconfig
/usr/share/BCG729/cmake
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} == 150300 && 0%{?is_opensuse} || 0%{?sle_version} == 150400 && 0%{?is_opensuse}
%files -n lib%{name}-%{sover}
%license LICENSE.txt
%doc CHANGELOG.md README.md
%{_libdir}/lib%{name}.so.%{sover}*
%files devel
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
%{_datadir}/BCG729/
%{_libdir}/pkgconfig/lib%{name}.pc
%endif
%changelog
* Tue Dec 27 2022 Kimi <noreply@nodomain.org>
- 1.1.1
- MultiOS capability.