]>
Commit | Line | Data |
---|---|---|
7f1d6d41 | 1 | # TODO: |
7f1d6d41 | 2 | # - python package |
7f1d6d41 | 3 | # - system libs if possible: |
02b7abd7 JB |
4 | # libvmaf/src/third_party/ptools |
5 | # libvmaf/src/third_party/ptools/opencontainers_1_8_4 | |
6 | # libvmaf/src/third_party/pugixml | |
7 | # third_party/libsvm | |
a4918afe JB |
8 | # |
9 | # Conditional build: | |
10 | %bcond_with sse2 # use SSE2 instructions | |
11 | ||
12 | %ifarch pentium4 %{x8664} x32 | |
13 | %define with_sse2 1 | |
14 | %endif | |
7f1d6d41 JB |
15 | Summary: Netflix's VMAF library |
16 | Summary(pl.UTF-8): Biblioteka Netflix VMAF | |
17 | Name: vmaf | |
dcd1edda | 18 | Version: 2.1.0 |
a4918afe | 19 | Release: 1 |
02b7abd7 | 20 | License: BSD+patent |
7f1d6d41 JB |
21 | Group: Libraries |
22 | #Source0Download: https://github.com/Netflix/vmaf/releases | |
23 | Source0: https://github.com/Netflix/vmaf/archive/v%{version}/%{name}-%{version}.tar.gz | |
dcd1edda | 24 | # Source0-md5: a65e105a67008796d566e9cc38e8e0fe |
7a146347 | 25 | Patch0: %{name}-x32.patch |
7f1d6d41 JB |
26 | URL: https://github.com/Netflix/vmaf |
27 | BuildRequires: libstdc++-devel >= 6:4.8 | |
02b7abd7 | 28 | BuildRequires: meson >= 0.47.0 |
dcd1edda | 29 | %ifarch %{ix86} %{x8664} x32 |
7a146347 | 30 | BuildRequires: nasm >= 2.14 |
dcd1edda JB |
31 | %endif |
32 | BuildRequires: ninja >= 1.7.1 | |
33 | BuildRequires: python3 >= 1:3.6 | |
7f1d6d41 | 34 | BuildRequires: sed >= 4.0 |
a4918afe | 35 | Requires: %{name}-libs = %{version}-%{release} |
7f1d6d41 JB |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
37 | ||
38 | %description | |
39 | VMAF is a perceptual video quality assessment algorithm developed by | |
40 | Netflix. | |
41 | ||
a4918afe JB |
42 | %description -l pl.UTF-8 |
43 | VMAF to percepcyjny algorytm oceny jakoĊci obrazu tworzony przez | |
44 | Netfliksa. | |
45 | ||
46 | %package libs | |
47 | Summary: Netflix VMAF libary | |
48 | Summary(pl.UTF-8): Biblioteka Netflix VMAF | |
49 | Group: Libraries | |
02b7abd7 JB |
50 | %if %{with sse2} |
51 | Requires: cpuinfo(sse2) | |
52 | %endif | |
a4918afe JB |
53 | |
54 | %description libs | |
55 | Netflix VMAF libary. | |
56 | ||
57 | %description libs -l pl.UTF-8 | |
58 | Biblioteka Netflix VMAF. | |
7f1d6d41 JB |
59 | |
60 | %package devel | |
61 | Summary: Netflix VMAF SDK | |
62 | Summary(pl.UTF-8): Pakiet programistyczny Netflix VMAF | |
63 | Group: Development/Libraries | |
a4918afe | 64 | Requires: %{name}-libs = %{version}-%{release} |
7f1d6d41 JB |
65 | Requires: libstdc++-devel >= 6:4.8 |
66 | ||
67 | %description devel | |
68 | Netflix VMAF SDK. | |
69 | ||
70 | %description devel -l pl.UTF-8 | |
71 | Pakiet programistyczny Netflix VMAF. | |
72 | ||
a4918afe JB |
73 | %package static |
74 | Summary: Static Netflix VMAF library | |
75 | Summary(pl.UTF-8): Statyczna biblioteka Netflix VMAF | |
76 | Group: Development/Libraries | |
77 | Requires: %{name}-devel = %{version}-%{release} | |
78 | ||
79 | %description static | |
80 | Static Netflix VMAF library. | |
81 | ||
82 | %description static -l pl.UTF-8 | |
83 | Statyczna biblioteka Netflix VMAF. | |
84 | ||
7f1d6d41 JB |
85 | %prep |
86 | %setup -q | |
7a146347 | 87 | %patch0 -p1 |
dcd1edda JB |
88 | |
89 | %{__mv} libvmaf/README.md libvmaf/README.libvmaf.md | |
a4918afe JB |
90 | |
91 | %if %{without sse2} | |
02b7abd7 | 92 | %{__sed} -i -e 's,#define ADM_OPT_RECIP_DIVISION,/* & */,' libvmaf/src/feature/adm_options.h |
a4918afe | 93 | %endif |
7f1d6d41 JB |
94 | |
95 | %build | |
02b7abd7 | 96 | %if %{with sse2} |
7a146347 | 97 | # SSE2 requires global support |
02b7abd7 JB |
98 | CFLAGS="%{rpmcflags} -msse2" |
99 | CXXFLAGS="%{rpmcxxflags} -msse2" | |
100 | %endif | |
7a146347 JB |
101 | |
102 | # AVX512 is (properly) runtime detected (but SSE2 is probably prerequisite) | |
103 | %meson build-libvmaf libvmaf \ | |
104 | %if %{with sse2} | |
105 | -Denable_avx512=true | |
106 | %endif | |
02b7abd7 JB |
107 | |
108 | %ninja_build -C build-libvmaf | |
7f1d6d41 JB |
109 | |
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
02b7abd7 | 113 | %ninja_install -C build-libvmaf |
a4918afe | 114 | |
dcd1edda | 115 | install build-libvmaf/tools/vmafossexec $RPM_BUILD_ROOT%{_bindir} |
7f1d6d41 JB |
116 | |
117 | %clean | |
118 | rm -rf $RPM_BUILD_ROOT | |
119 | ||
a4918afe JB |
120 | %post libs -p /sbin/ldconfig |
121 | %postun libs -p /sbin/ldconfig | |
122 | ||
6d9c8352 JB |
123 | %triggerpostun libs -- vmaf-libs < 1.5.2 |
124 | # replace library file with soname symlink | |
125 | rm -f %{_libdir}/libvmaf.so.0 | |
126 | /sbin/ldconfig | |
127 | ||
7f1d6d41 JB |
128 | %files |
129 | %defattr(644,root,root,755) | |
dcd1edda JB |
130 | %doc libvmaf/tools/README.md |
131 | %attr(755,root,root) %{_bindir}/vmaf | |
02b7abd7 | 132 | %attr(755,root,root) %{_bindir}/vmafossexec |
7f1d6d41 | 133 | |
a4918afe JB |
134 | %files libs |
135 | %defattr(644,root,root,755) | |
dcd1edda JB |
136 | %doc CHANGELOG.md FAQ.md LICENSE README.md libvmaf/README.libvmaf.md |
137 | %attr(755,root,root) %{_libdir}/libvmaf.so.*.*.* | |
138 | %attr(755,root,root) %ghost %{_libdir}/libvmaf.so.1 | |
a4918afe | 139 | |
7f1d6d41 JB |
140 | %files devel |
141 | %defattr(644,root,root,755) | |
a4918afe | 142 | %attr(755,root,root) %{_libdir}/libvmaf.so |
02b7abd7 | 143 | %{_includedir}/libvmaf |
7f1d6d41 | 144 | %{_pkgconfigdir}/libvmaf.pc |
a4918afe JB |
145 | |
146 | %files static | |
147 | %defattr(644,root,root,755) | |
148 | %{_libdir}/libvmaf.a |