]> git.pld-linux.org Git - packages/vmaf.git/blob - vmaf.spec
- updated to 3.0.0
[packages/vmaf.git] / vmaf.spec
1 # TODO:
2 # - enable_cuda, enable_nvtx on bcond
3 # - python package
4 # - system libs if possible:
5 #   third_party/libsvm
6 #
7 # Conditional build:
8 %bcond_with     sse2    # use SSE2 instructions
9
10 %ifarch pentium4 %{x8664} x32
11 %define with_sse2       1
12 %endif
13 Summary:        Netflix's VMAF library
14 Summary(pl.UTF-8):      Biblioteka Netflix VMAF
15 Name:           vmaf
16 Version:        3.0.0
17 Release:        1
18 License:        BSD+patent
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
22 # Source0-md5:  dfd67ebfbfcb66ce76abc56fde0df06f
23 Patch0:         %{name}-x32.patch
24 URL:            https://github.com/Netflix/vmaf
25 BuildRequires:  gcc >= 6:4.8
26 BuildRequires:  libstdc++-devel >= 6:4.8
27 BuildRequires:  meson >= 0.56.1
28 %ifarch %{ix86} %{x8664} x32
29 BuildRequires:  nasm >= 2.14
30 %endif
31 BuildRequires:  ninja >= 1.7.1
32 BuildRequires:  python3 >= 1:3.6
33 BuildRequires:  sed >= 4.0
34 Requires:       %{name}-libs = %{version}-%{release}
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
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
49 %if %{with sse2}
50 Requires:       cpuinfo(sse2)
51 %endif
52
53 %description libs
54 Netflix VMAF libary.
55
56 %description libs -l pl.UTF-8
57 Biblioteka Netflix VMAF.
58
59 %package devel
60 Summary:        Netflix VMAF SDK
61 Summary(pl.UTF-8):      Pakiet programistyczny Netflix VMAF
62 Group:          Development/Libraries
63 Requires:       %{name}-libs = %{version}-%{release}
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
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
84 %prep
85 %setup -q
86 %patch0 -p1
87
88 %{__mv} libvmaf/README.md libvmaf/README.libvmaf.md
89
90 %if %{without sse2}
91 %{__sed} -i -e 's,#define ADM_OPT_RECIP_DIVISION,/* & */,' libvmaf/src/feature/adm_options.h
92 %endif
93
94 %build
95 %if %{with sse2}
96 # SSE2 requires global support
97 CFLAGS="%{rpmcflags} -msse2"
98 CXXFLAGS="%{rpmcxxflags} -msse2"
99 %endif
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
106
107 %ninja_build -C build-libvmaf
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111
112 %ninja_install -C build-libvmaf
113
114 %clean
115 rm -rf $RPM_BUILD_ROOT
116
117 %post   libs -p /sbin/ldconfig
118 %postun libs -p /sbin/ldconfig
119
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
125 %files
126 %defattr(644,root,root,755)
127 %doc libvmaf/tools/README.md
128 %attr(755,root,root) %{_bindir}/vmaf
129
130 %files libs
131 %defattr(644,root,root,755)
132 %doc CHANGELOG.md LICENSE README.md libvmaf/README.libvmaf.md
133 %attr(755,root,root) %{_libdir}/libvmaf.so.*.*.*
134 %attr(755,root,root) %ghost %{_libdir}/libvmaf.so.3
135
136 %files devel
137 %defattr(644,root,root,755)
138 %attr(755,root,root) %{_libdir}/libvmaf.so
139 %{_includedir}/libvmaf
140 %{_pkgconfigdir}/libvmaf.pc
141
142 %files static
143 %defattr(644,root,root,755)
144 %{_libdir}/libvmaf.a
This page took 0.106895 seconds and 4 git commands to generate.