File libx264-binary.spec of Package libx264

#
# spec file for package libx264
#
# Copyright (c) 2020 Packman Team <packman@links2linux.de>
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.links2linux.org/
#


%define _lto_cflags %{nil}
# remember to adjust baselibs.conf
%define sover   164
%bcond_with     gpac
##### WARNING: please do not edit this auto generated spec file. Use the libx264.spec! #####
%bcond_without  x264_binary
Name:           x264
Version:        0.164+git20231001.31e19f9
Release:        0
Summary:        Command line tool for libx264
License:        GPL-2.0-or-later
Group:          Productivity/Multimedia/Video/Editors and Convertors
URL:            http://www.videolan.org/developers/x264.html
Source:         x264-%{version}.tar.xz
Source1:        baselibs.conf
# Is Patch0 still necessary?
#Patch0:         libx264-use-shared-library.patch
# PATCH_FIX-OPENSUSE x264-gpac_no_static.patch
Patch2:         libx264-gpac_no_static.patch
BuildRequires:  nasm >= 2.13
BuildRequires:  pkgconfig
BuildRequires:  yasm >= 1.2.0
%if %{with x264_binary}
%if %{with gpac}
BuildRequires:  pkgconfig(gpac)
%else
BuildRequires:  pkgconfig(liblsmash)
%endif
BuildRequires:  pkgconfig(ffms2)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libswscale)
BuildRequires:  pkgconfig(zlib)
%endif

%description
x264 is a free library for encoding next-generation H264/AVC video
streams. The code is written from scratch by Laurent Aimar, Loren
Merritt, Eric Petit (OS X), Min Chen (vfw/asm), Justin Clay (vfw), Mans
Rullgard, Radek Czyz, Christian Heine (asm), Alex Izvorski (asm), and
Alex Wright. It is released under the terms of the GPL license. This
package contains a static library and a header needed for the
development with libx264. This library is needed to build
mplayer/mencoder with H264 encoding support.

%package -n libx264-%{sover}
Summary:        A free h264/avc encoder - encoder binary
Group:          System/Libraries

%description -n libx264-%{sover}
x264 is a free library for encoding next-generation H264/AVC video
streams. The code is written from scratch by Laurent Aimar, Loren
Merritt, Eric Petit (OS X), Min Chen (vfw/asm), Justin Clay (vfw), Mans
Rullgard, Radek Czyz, Christian Heine (asm), Alex Izvorski (asm), and
Alex Wright. It is released under the terms of the GPL license. This
package contains a shared library and a commandline tool for encoding
H264 streams. This library is needed for mplayer/mencoder for H264
encoding support.

Encoder features:
- CAVLC/CABAC
- Multi-references
- Intra: all macroblock types (16x16, 8x8, and 4x4 with all predictions)
- Inter P: all partitions (from 16x16 down to 4x4)
- Inter B: partitions from 16x16 down to 8x8 (including skip/direct)
- Ratecontrol: constant quantizer, single or multipass ABR, optional VBV
- Scene cut detection
- Adaptive B-frame placement
- B-frames as references / arbitrary frame order
- 8x8 and 4x4 adaptive spatial transform
- Lossless mode
- Custom quantization matrices
- Parallel encoding of multiple slices (currently disabled)

%package devel
Summary:        Libraries and include file for the %{name} encoder
Group:          Development/Libraries/C and C++
Requires:       libx264-%{sover} = %{version}
Provides:       x264-devel = %{version}
Obsoletes:      x264-devel < %{version}

%description devel
x264 is a free library for encoding next-generation H264/AVC video
streams. The code is written from scratch by Laurent Aimar, Loren
Merritt, Eric Petit (OS X), Min Chen (vfw/asm), Justin Clay (vfw), Mans
Rullgard, Radek Czyz, Christian Heine (asm), Alex Izvorski (asm), and
Alex Wright. It is released under the terms of the GPL license. This
package contains a static library and a header needed for the
development with libx264. This library is needed to build
mplayer/mencoder with H264 encoding support.

%prep
%autosetup -p1 -n x264-%{version}

%build
export CFLAGS="%{optflags} -fPIC"
export CXXFLAGS="%{optflags} -fPIC"
export LDFLAGS="${LDFLAGS} -fPIC"
%configure \
  --enable-shared \
%if %{with x264_binary}
%if %{with gpac}
  --disable-lsmash \
%else
  --disable-gpac \
%endif
%else
  --disable-cli \
  --disable-swscale \
  --disable-lavf \
  --disable-ffms \
%endif
  --enable-lto \
  --enable-pic
%make_build

%install
%if %{with x264_binary}
install -Dm 755 x264 %{buildroot}/%{_bindir}/x264
%else
%make_install

rm -f %{buildroot}%{_libdir}/libx264.so
rm -f %{buildroot}%{_libdir}/libx264.a
ln -s libx264.so.%{sover} %{buildroot}%{_libdir}/libx264.so
%endif

%if %{with x264_binary}
%files -n x264
%defattr(-,root,root)
%doc doc/*.txt
%attr(0755,root,root) %{_bindir}/x264
%else

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

%files -n libx264-%{sover}
%defattr(0644,root,root)
%{_libdir}/libx264.so.%{sover}

%files devel
%defattr(0644,root,root)
%{_includedir}/x264.h
%{_includedir}/x264_config.h
%{_libdir}/pkgconfig/x264.pc
%{_libdir}/libx264.so
%endif

%changelog
openSUSE Build Service is sponsored by