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