Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37579300
en ru br
ALT Linux repos
S:2.3.1-alt1.1

Group :: System/Libraries
RPM: libopenh264

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define oname openh264
%def_enable check
%ifarch %ix86 x86_64
%def_with meson
%else
%def_without meson
%endif

%def_disable static

Name: libopenh264
Version: 2.3.1
Release: alt1.1

Summary: H.264 codec library
License: BSD-2-Clause
Group: System/Libraries
Url: http://www.openh264.org/

Vcs: https://github.com/cisco/openh264.git
# Source-url: https://github.com/cisco/openh264/archive/v%version/%oname-%version.tar.gz
Source: %name-%version.tar

Provides: libopenh264_7 = %version-%release
Obsoletes: libopenh264_7 < %version-%release

%ifarch %ix86
%add_optflags -msse2 -mfpmath=sse
%set_verify_elf_method textrel=relaxed
%endif

%if_with meson
BuildRequires(pre): rpm-macros-meson
BuildRequires: meson
%endif
BuildRequires: gcc-c++ nasm

%{?_enable_check:BuildRequires: libgtest-devel}

%description
OpenH264 is a codec library which supports H.264 encoding and decoding.
It is suitable for use in real time applications such as WebRTC.

%package devel
Summary: Development files for %name
Group: Development/C++
Requires: %name = %EVR

%description devel
The %name-devel package contains libraries and header files for
developing applications that use %name.

%package devel-static
Summary: Static H.264 codec library
Group: Development/C++
Requires: %name-devel = %EVR

%description devel-static
This package provides %name static library.

%prep
%setup
# setup build options
%add_optflags %optflags_shared
%ifarch %ix86
%add_optflags -msse2 -mfpmath=sse
sed -i 's|^USE_ASM[[:space:]][[:space:]]*=.*|USE_ASM = No|' Makefile
sed -i 's|^HAVE_AVX2[[:space:]][[:space:]]*:=.*|HAVE_AVX2 := No|' build/arch.mk
%endif
sed -i -e 's|^CFLAGS_OPT=.*$|CFLAGS_OPT=%{optflags} %(getconf LFS_CFLAGS)|' Makefile
#sed -i -e '/^CFLAGS_OPT=/i LDFLAGS={ldflags}' Makefile
sed -i -e 's|^PREFIX=.*$|PREFIX=%{_prefix}|' Makefile
sed -i -e 's|^LIBDIR_NAME=.*$|LIBDIR_NAME=%{_lib}|' Makefile
sed -i -e 's|^SHAREDLIB_DIR=.*$|SHAREDLIB_DIR=%{_libdir}|' Makefile

%build
%if_with meson
%meson
%meson_build
%else
%make_build
%endif

%install
%if_with meson
%meson_install
%else
%makeinstall_std
%endif

%if_disabled static
%{?_without_meson:rm -v %buildroot%_libdir/%name.a}
%endif

%check
%if_with meson
%__meson_test
%endif

%files
%_libdir/%name.so.*
%doc LICENSE README.md RELEASES

%files devel
%_includedir/wels/
%_libdir/%name.so
%_pkgconfigdir/%oname.pc

%if_enabled static
%files devel-static
%_libdir/%name.a
%endif

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin