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