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