]> git.pld-linux.org Git - packages/vmaf.git/blob - vmaf.spec
4c128ff1163e4dba0962cf5f290d79b572401c6e
[packages/vmaf.git] / vmaf.spec
1 # TODO:
2 # - python package
3 # - system libs if possible:
4 #   libsvm
5 #   wrapper/src/pugixml
6 #   ptools ?
7 #   ptools/opencontainers_1_8_4 ?
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:        1.3.15
19 Release:        1
20 License:        Apache v2.0
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:  69df7b6e200f4b3ac110af7a7505b273
25 Patch0:         %{name}-libdir.patch
26 Patch1:         %{name}-shared.patch
27 URL:            https://github.com/Netflix/vmaf
28 BuildRequires:  libstdc++-devel >= 6:4.8
29 BuildRequires:  sed >= 4.0
30 Requires:       %{name}-libs = %{version}-%{release}
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 VMAF is a perceptual video quality assessment algorithm developed by
35 Netflix.
36
37 %description -l pl.UTF-8
38 VMAF to percepcyjny algorytm oceny jakoĊ›ci obrazu tworzony przez
39 Netfliksa.
40
41 %package libs
42 Summary:        Netflix VMAF libary
43 Summary(pl.UTF-8):      Biblioteka Netflix VMAF
44 Group:          Libraries
45
46 %description libs
47 Netflix VMAF libary.
48
49 %description libs -l pl.UTF-8
50 Biblioteka Netflix VMAF.
51
52 %package devel
53 Summary:        Netflix VMAF SDK
54 Summary(pl.UTF-8):      Pakiet programistyczny Netflix VMAF
55 Group:          Development/Libraries
56 Requires:       %{name}-libs = %{version}-%{release}
57 Requires:       libstdc++-devel >= 6:4.8
58
59 %description devel
60 Netflix VMAF SDK.
61
62 %description devel -l pl.UTF-8
63 Pakiet programistyczny Netflix VMAF.
64
65 %package static
66 Summary:        Static Netflix VMAF library
67 Summary(pl.UTF-8):      Statyczna biblioteka Netflix VMAF
68 Group:          Development/Libraries
69 Requires:       %{name}-devel = %{version}-%{release}
70
71 %description static
72 Static Netflix VMAF library.
73
74 %description static -l pl.UTF-8
75 Statyczna biblioteka Netflix VMAF.
76
77 %prep
78 %setup -q
79 %patch0 -p1
80 %patch1 -p1
81
82 %if %{without sse2}
83 %{__sed} -i -e 's,#define ADM_OPT_RECIP_DIVISION,/* & */,' feature/src/adm_options.h
84 %endif
85
86 %build
87 CFLAGS="%{rpmcflags}%{?with_sse2: -msse2}" \
88 CXXFLAGS="%{rpmcxxflags}%{?with_sse2: -msse2}" \
89 CPPFLAGS="%{rpmcppflags}" \
90 LDFLAGS="%{rpmldflags}" \
91 %{__make} \
92         CC="%{__cc}" \
93         CXX="%{__cxx}" \
94
95 %{__sed} -i -e 's,^prefix=.*,prefix=%{_prefix},' \
96         -e 's,^libdir=.*,libdir=%{_libdir},' \
97         -e 's,^includedir=.*,includedir=%{_includedir},' wrapper/libvmaf.pc
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT%{_bindir}
102
103 %{__make} -C wrapper install \
104         DESTDIR=$RPM_BUILD_ROOT \
105         INSTALL_PREFIX=%{_prefix} \
106         LIBDIR=%{_libdir}
107
108 install feature/{psnr,vmaf} $RPM_BUILD_ROOT%{_bindir}
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %post   libs -p /sbin/ldconfig
114 %postun libs -p /sbin/ldconfig
115
116 %files
117 %defattr(644,root,root,755)
118 %doc CHANGELOG.md FAQ.md NOTICE.md README.md VERSION
119 %attr(755,root,root) %{_bindir}/psnr
120 %attr(755,root,root) %{_bindir}/vmaf
121 %{_datadir}/model
122
123 %files libs
124 %defattr(644,root,root,755)
125 %attr(755,root,root) %{_libdir}/libvmaf.so.0
126
127 %files devel
128 %defattr(644,root,root,755)
129 %attr(755,root,root) %{_libdir}/libvmaf.so
130 %{_includedir}/libvmaf.h
131 %{_pkgconfigdir}/libvmaf.pc
132
133 %files static
134 %defattr(644,root,root,755)
135 %{_libdir}/libvmaf.a
This page took 0.067351 seconds and 2 git commands to generate.