File libx264.spec of Package libx264 (Revision e40586a64d7cfd17d214fbc0d3f824cd)

Currently displaying revision e40586a64d7cfd17d214fbc0d3f824cd , Show latest

189
 
1
#
2
# spec file for package libx264
3
#
4
# Copyright (c) 2024 Packman Team <packman@links2linux.de>
5
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
6
#
7
# All modifications and additions to the file contributed by third parties
8
# remain the property of their copyright owners, unless otherwise agreed
9
# upon. The license for this file, and modifications and additions to the
10
# file, is the same license as for the pristine package itself (unless the
11
# license for the pristine package is not an Open Source License, in which
12
# case the license is the MIT License). An "Open Source License" is a
13
# license that conforms to the Open Source Definition (Version 1.9)
14
# published by the Open Source Initiative.
15
16
# Please submit bugfixes or comments via https://bugs.links2linux.org/
17
#
18
19
20
# remember to adjust baselibs.conf
21
%define sover   164
22
%bcond_with     gpac
23
24
%define build_flavor @BUILD_FLAVOR@%{nil}
25
%define tag libx264
26
%if "%{build_flavor}" == ""
27
%define pkg %{tag}
28
%else
29
%define pkg %{tag}-%{build_flavor}
30
%endif
31
Name:           %{pkg}
32
Version:        0.164+git20231001.31e19f92
33
Release:        0
34
%if "%{build_flavor}" == ""
35
Summary:        A free h264/avc encoder
36
%else
37
Summary:        Command line tool for libx264
38
%endif
39
License:        GPL-2.0-or-later
40
Group:          Productivity/Multimedia/Video/Editors and Convertors
41
URL:            http://www.videolan.org/developers/x264.html
42
Source:         x264-%{version}.tar.xz
43
Source1:        baselibs.conf
44
BuildRequires:  nasm >= 2.13
45
BuildRequires:  pkgconfig
46
BuildRequires:  yasm >= 1.2.0
47
%if "%{build_flavor}" == "x264"
48
BuildRequires:  pkgconfig(x264) == %{version}
49
%if %{with gpac}
50
BuildRequires:  pkgconfig(gpac)
51
%else
52
BuildRequires:  pkgconfig(liblsmash)
53
%endif
54
BuildRequires:  pkgconfig(ffms2)
55
BuildRequires:  pkgconfig(libavcodec)
56
BuildRequires:  pkgconfig(libavformat)
57
BuildRequires:  pkgconfig(libavutil)
58
BuildRequires:  pkgconfig(libswscale)
59
BuildRequires:  pkgconfig(zlib)
60
%endif
61
62
%description
63
x264 is a free library for encoding next-generation H264/AVC video
64
streams. The code is written from scratch by Laurent Aimar, Loren
65
Merritt, Eric Petit (OS X), Min Chen (vfw/asm), Justin Clay (vfw), Mans
66
Rullgard, Radek Czyz, Christian Heine (asm), Alex Izvorski (asm), and
67
Alex Wright. It is released under the terms of the GPL license. This
68
package contains a shared library and a commandline tool for encoding
69
H264 streams. This library is needed for mplayer/mencoder for H264
70
encoding support.
71
72
Encoder features:
73
- CAVLC/CABAC
74
- Multi-references
75
- Intra: all macroblock types (16x16, 8x8, and 4x4 with all predictions)
76
- Inter P: all partitions (from 16x16 down to 4x4)
77
- Inter B: partitions from 16x16 down to 8x8 (including skip/direct)
78
- Ratecontrol: constant quantizer, single or multipass ABR, optional VBV
79
- Scene cut detection
80
- Adaptive B-frame placement
81
- B-frames as references / arbitrary frame order
82
- 8x8 and 4x4 adaptive spatial transform
83
- Lossless mode
84
- Custom quantization matrices
85
- Parallel encoding of multiple slices (currently disabled)
86
87
%package %{sover}
88
Summary:        A free h264/avc encoder - encoder binary
89
Group:          System/Libraries
90
91
%description %{sover}
92
x264 is a free library for encoding next-generation H264/AVC video
93
streams. The code is written from scratch by Laurent Aimar, Loren
94
Merritt, Eric Petit (OS X), Min Chen (vfw/asm), Justin Clay (vfw), Mans
95
Rullgard, Radek Czyz, Christian Heine (asm), Alex Izvorski (asm), and
96
Alex Wright. It is released under the terms of the GPL license. This
97
package contains a static library and a header needed for the
98
development with libx264. This library is needed to build
99
mplayer/mencoder with H264 encoding support.
100
101
%package -n x264
102
Summary:        Binaries for x264 streams conversions
103
104
%description -n x264
105
x264 is a free library for encoding next-generation H264/AVC video
106
streams. The code is written from scratch by Laurent Aimar, Loren
107
Merritt, Eric Petit (OS X), Min Chen (vfw/asm), Justin Clay (vfw), Mans
108
Rullgard, Radek Czyz, Christian Heine (asm), Alex Izvorski (asm), and
109
Alex Wright. It is released under the terms of the GPL license. This
110
package contains a static library and a header needed for the
111
development with libx264. This library is needed to build
112
mplayer/mencoder with H264 encoding support.
113
114
%package devel
115
Summary:        Libraries and include file for the %{name} encoder
116
Group:          Development/Libraries/C and C++
117
Requires:       %{name}-%{sover} = %{version}-%{release}
118
Provides:       x264-devel = %{version}
119
Obsoletes:      x264-devel < %{version}
120
121
%description devel
122
x264 is a free library for encoding next-generation H264/AVC video
123
streams. The code is written from scratch by Laurent Aimar, Loren
124
Merritt, Eric Petit (OS X), Min Chen (vfw/asm), Justin Clay (vfw), Mans
125
Rullgard, Radek Czyz, Christian Heine (asm), Alex Izvorski (asm), and
126
Alex Wright. It is released under the terms of the GPL license. This
127
package contains a static library and a header needed for the
128
development with libx264. This library is needed to build
129
mplayer/mencoder with H264 encoding support.
130
131
%prep
132
%autosetup -p1 -n x264-%{version}
133
134
%build
135
%configure \
136
  --disable-opencl \
137
  --enable-shared \
138
%if "%{build_flavor}" == "x264"
139
  --system-libx264 \
140
%if %{with gpac}
141
  --disable-lsmash \
142
%else
143
  --disable-gpac \
144
%endif
145
%else
146
  --disable-cli \
147
  --disable-swscale \
148
  --disable-lavf \
149
  --disable-ffms \
150
%endif
151
  --enable-lto \
152
  --enable-pic
153
%make_build
154
155
%install
156
%if "%{build_flavor}" == "x264"
157
install -Dm 755 x264 %{buildroot}/%{_bindir}/x264
158
%else
159
%make_install
160
161
rm -f %{buildroot}%{_libdir}/%{name}.so
162
rm -f %{buildroot}%{_libdir}/%{name}.a
163
ln -s %{name}.so.%{sover} %{buildroot}%{_libdir}/%{name}.so
164
165
# fix pkg-config version
166
sed -i 's/Version:.*/Version: %{version}/' %{buildroot}%{_libdir}/pkgconfig/x264.pc
167
%endif
168
169
%if "%{build_flavor}" == "x264"
170
%files -n x264
171
%doc doc/*.txt
172
%attr(0755,root,root) %{_bindir}/x264
173
%else
174
175
%post -n %{name}-%{sover} -p /sbin/ldconfig
176
%postun -n %{name}-%{sover} -p /sbin/ldconfig
177
178
%files %{sover}
179
%{_libdir}/%{name}.so.%{sover}
180
181
%files devel
182
%{_includedir}/x264.h
183
%{_includedir}/x264_config.h
184
%{_libdir}/pkgconfig/x264.pc
185
%{_libdir}/%{name}.so
186
%endif
187
188
%changelog
189