File x264.spec of Package x264

#
# spec file for package x264
#
# Copyright (c) 2024 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/
#


# remember to adjust baselibs.conf
%define sover   165
%bcond_with     gpac

Name:           x264
Version:        0.164.3108
Release:        1699.2
Summary:        A free h264/avc encoder
License:        GPL-2.0-or-later
Group:          Productivity/Multimedia/Video/Editors and Convertors
URL:            http://www.videolan.org/developers/x264.html
Source:         https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2
BuildRequires:  nasm >= 2.13
BuildRequires:  pkgconfig
BuildRequires:  yasm >= 1.2.0

%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 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 libs
Summary:        A free h264/avc encoder - shared libraries
Group:          System/Libraries

%description libs
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 shared libraries needed for applications that use x264.

%package devel
Summary:        Libraries and include file for the %{name} encoder
Group:          Development/Libraries/C and C++
Requires:       %{name}-libs = %{version}-%{release}
Provides:       libx264-devel = %{version}
Obsoletes:      libx264-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 headers needed for development
with x264. This library is needed to build mplayer/mencoder with H264
encoding support.

%prep
%autosetup -p1 -n x264-master

%build
%configure \
  --disable-opencl \
  --enable-shared \
  --enable-lto \
  --enable-pic
%make_build

%install
%make_install

%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%files
%doc doc/*.txt
%{_bindir}/x264

%files libs
%{_libdir}/libx264.so.%{sover}

%files devel
%{_includedir}/x264.h
%{_includedir}/x264_config.h
%{_libdir}/pkgconfig/x264.pc
%{_libdir}/libx264.so

%changelog
* Sun Nov 30 2025 Alex. S. Shubin aka Sylar <renard.corp@hotmail.com>
- Removed baselibs.conf reference as it's not needed
- Fixed soversion to 165 to match actual library version
- Simplified package structure
- Ensured proper library handling for both SUSE Tumbleweed and Fedora 43
* Tue Jun 25 2024 Alex. S. Shubin aka Sylar <renard.corp@hotmail.com>
- Updated package name to x264
- Updated source to latest master
- Adapted for SUSE Tumbleweed and Fedora 43
- Simplified package structure
- Added proper library handling
- Fixed build requirements for both distributions
openSUSE Build Service is sponsored by