]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with bootstrap # no ffmpeg/gpac support in x264 utility | |
4 | %bcond_without asm # disable asm | |
5 | %bcond_without lsmash # lsmash for MP4 (preferred over gpac) | |
6 | ||
7 | %ifnarch %{ix86} %{x8664} aarch64 | |
8 | %undefine with_asm | |
9 | %endif | |
10 | ||
11 | %define gitref 12426f5f4906e34d483a07da0debb6d56c6f8434 | |
12 | %define rel 1 | |
13 | %define snap 20240220 | |
14 | %define api_ver 164 | |
15 | Summary: H264 encoder library | |
16 | Summary(pl.UTF-8): Biblioteka kodująca H264 | |
17 | Name: libx264 | |
18 | Version: 0.%{api_ver} | |
19 | Release: 0.%{snap}.%{rel} | |
20 | License: GPL v2+ | |
21 | Group: Libraries | |
22 | # still no releases, use snapshots | |
23 | # previously available at https://download.videolan.org/videolan/x264/snapshots/ | |
24 | # for further changes see: https://code.videolan.org/videolan/x264/ | |
25 | Source0: https://code.videolan.org/videolan/x264/-/archive/%{gitref}/x264-%{gitref}.tar.bz2 | |
26 | # Source0-md5: b46bb3b0521e2d5fdefeed345bd42f94 | |
27 | Patch0: %{name}-alpha.patch | |
28 | Patch1: %{name}-gpac.patch | |
29 | Patch2: x32.patch | |
30 | URL: http://www.videolan.org/developers/x264.html | |
31 | %ifarch %{ix86} %{x8664} | |
32 | %{?with_asm:BuildRequires: nasm >= 2.13} | |
33 | %endif | |
34 | BuildRequires: pkgconfig | |
35 | BuildRequires: rpmbuild(macros) >= 1.673 | |
36 | %if %{without bootstrap} | |
37 | # which version exactly??? | |
38 | # for full x264 CLI utility functionality it wants: | |
39 | # libswscale >= 0.9.0 (in pkgconfig file) | |
40 | # libav{format,codec,util} from ffmpeg >= r21854 | |
41 | BuildRequires: ffmpeg-devel >= 0.7.1 | |
42 | BuildRequires: ffms2-devel >= 2.21 | |
43 | # gpac >= 2007-06-21 | |
44 | %{!?with_lsmash:BuildRequires: gpac-devel >= 0.8.0} | |
45 | %{?with_lsmash:BuildRequires: l-smash-devel >= 1.5} | |
46 | %endif | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | # encoder/macroblock.c breaks strict-aliasing rules | |
50 | %define specflags -fno-strict-aliasing | |
51 | ||
52 | %description | |
53 | libx264 library for encoding H264 video format. | |
54 | ||
55 | %description -l pl.UTF-8 | |
56 | Biblioteka libx264 do kodowania w formacie obrazu H264. | |
57 | ||
58 | %package devel | |
59 | Summary: Header files for x264 library | |
60 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki x264 | |
61 | Group: Development/Libraries | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | ||
64 | %description devel | |
65 | Header files for x264 library. | |
66 | ||
67 | %description devel -l pl.UTF-8 | |
68 | Pliki nagłówkowe biblioteki x264. | |
69 | ||
70 | %package static | |
71 | Summary: Static x264 library | |
72 | Summary(pl.UTF-8): Statyczna biblioteka x264 | |
73 | Group: Development/Libraries | |
74 | Requires: %{name}-devel = %{version}-%{release} | |
75 | ||
76 | %description static | |
77 | Static x264 library. | |
78 | ||
79 | %description static -l pl.UTF-8 | |
80 | Statyczna biblioteka x264. | |
81 | ||
82 | %package -n x264 | |
83 | Summary: x264 CLI decoder | |
84 | Summary(pl.UTF-8): Dekoder x264 działający z linii poleceń | |
85 | Group: Applications/Multimedia | |
86 | Requires: %{name} = %{version}-%{release} | |
87 | %if %{without bootstrap} | |
88 | Requires: ffms2 >= 2.21 | |
89 | %if %{with lsmash} | |
90 | Requires: l-smash >= 1.5 | |
91 | %else | |
92 | Requires: gpac >= 0.8.0 | |
93 | %endif | |
94 | %endif | |
95 | ||
96 | %description -n x264 | |
97 | x264 CLI decoder. | |
98 | ||
99 | %description -n x264 -l pl.UTF-8 | |
100 | Dekoder x264 działający z linii poleceń. | |
101 | ||
102 | %prep | |
103 | %setup -q -n x264-%{gitref} | |
104 | %patch0 -p1 | |
105 | %patch1 -p1 | |
106 | %patch2 -p1 | |
107 | ||
108 | %build | |
109 | CC="%{__cc}" \ | |
110 | ./configure \ | |
111 | --host=%{_target_platform} \ | |
112 | --prefix=%{_prefix} \ | |
113 | --exec-prefix=%{_prefix} \ | |
114 | --bindir=%{_bindir} \ | |
115 | --includedir=%{_includedir} \ | |
116 | --libdir=%{_libdir} \ | |
117 | --extra-cflags="%{rpmcflags}" \ | |
118 | %{!?with_asm:--disable-asm} \ | |
119 | --enable-pic \ | |
120 | --enable-shared \ | |
121 | --enable-static | |
122 | ||
123 | %{__make} | |
124 | ||
125 | %install | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %{__make} install \ | |
129 | DESTDIR=$RPM_BUILD_ROOT | |
130 | ||
131 | %clean | |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
134 | %post -p /sbin/ldconfig | |
135 | %postun -p /sbin/ldconfig | |
136 | ||
137 | %files | |
138 | %defattr(644,root,root,755) | |
139 | %doc AUTHORS | |
140 | %attr(755,root,root) %{_libdir}/libx264.so.%{api_ver} | |
141 | ||
142 | %files devel | |
143 | %defattr(644,root,root,755) | |
144 | %attr(755,root,root) %{_libdir}/libx264.so | |
145 | %{_includedir}/x264.h | |
146 | %{_includedir}/x264_config.h | |
147 | %{_pkgconfigdir}/x264.pc | |
148 | ||
149 | %files static | |
150 | %defattr(644,root,root,755) | |
151 | %{_libdir}/libx264.a | |
152 | ||
153 | %files -n x264 | |
154 | %defattr(644,root,root,755) | |
155 | %attr(755,root,root) %{_bindir}/x264 | |
156 | %{bash_compdir}/x264 |