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