]>
Commit | Line | Data |
---|---|---|
b628c20b JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # don't build static libraries | |
4 | %bcond_without lsmash # l-smash support in CLI | |
5 | %bcond_without opencl # OpenCL features | |
6 | # | |
7 | Summary: Open-source encoder of AVS2-P2/IEEE1857.4 video coding standard | |
8 | Summary(pl.UTF-8): Koder standardu kodowania obrazu AVS2-P2/IEEE1857.4 o otwartych źródłach | |
9 | Name: xavs2 | |
78efc24c JB |
10 | Version: 1.4 |
11 | Release: 1 | |
b628c20b JB |
12 | License: GPL v2+ |
13 | Group: Libraries | |
78efc24c | 14 | #Source0Download: https://github.com/pkuvcl/xavs2/tags |
b628c20b | 15 | Source0: https://github.com/pkuvcl/xavs2/archive/%{version}/%{name}-%{version}.tar.gz |
78efc24c | 16 | # Source0-md5: b776941aad474fed23da1d1eb0c0b720 |
b628c20b | 17 | Patch0: %{name}-asm-arch.patch |
f9075d69 | 18 | Patch1: %{name}-opt.patch |
78efc24c | 19 | Patch2: %{name}-x86.patch |
b628c20b JB |
20 | URL: https://github.com/pkuvcl/xavs2 |
21 | %{?with_opencl:BuildRequires: OpenCL-devel} | |
22 | %{?with_lsmash:BuildRequires: l-smash-devel >= 1.5} | |
23 | BuildRequires: libstdc++-devel >= 6:4.7 | |
24 | BuildRequires: pkgconfig | |
f9075d69 | 25 | %ifarch %{ix86} %{x8664} |
b628c20b | 26 | BuildRequires: yasm >= 1.2.0 |
f9075d69 | 27 | %endif |
b628c20b JB |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
31 | Open-source encoder of AVS2-P2/IEEE1857.4 video coding standard. | |
32 | ||
33 | %description -l pl.UTF-8 | |
34 | Koder standardu kodowania obrazu AVS2-P2/IEEE1857.4 o otwartych | |
35 | źródłach. | |
36 | ||
37 | %package devel | |
38 | Summary: Header files for xavs2 library | |
39 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki xavs2 | |
40 | Group: Development/Libraries | |
41 | Requires: %{name} = %{version}-%{release} | |
42 | ||
43 | %description devel | |
44 | Header files for xavs2 library. | |
45 | ||
46 | %description devel -l pl.UTF-8 | |
47 | Pliki nagłówkowe biblioteki xavs2. | |
48 | ||
49 | %package static | |
50 | Summary: Static xavs2 library | |
51 | Summary(pl.UTF-8): Statyczna biblioteka xavs2 | |
52 | Group: Development/Libraries | |
53 | Requires: %{name}-devel = %{version}-%{release} | |
54 | ||
55 | %description static | |
56 | Static xavs2 library. | |
57 | ||
58 | %description static -l pl.UTF-8 | |
59 | Statyczna biblioteka xavs2. | |
60 | ||
61 | %prep | |
62 | %setup -q | |
63 | %patch0 -p1 | |
f9075d69 | 64 | %patch1 -p1 |
78efc24c | 65 | %patch2 -p1 |
b628c20b JB |
66 | |
67 | %build | |
68 | cd build/linux | |
69 | # not autoconf configure | |
70 | CC="%{__cc}" \ | |
71 | CXX="%{__cxx}" \ | |
72 | CFLAGS="%{rpmcflags}" \ | |
73 | CXXFLAGS="%{rpmcxxflags}" \ | |
74 | CPPFLAGS="%{rpmcppflags}" \ | |
75 | LDFLAGS="%{rpmldflags} -Wl,-z,noexecstack" \ | |
76 | ./configure \ | |
77 | --prefix=%{_prefix} \ | |
78 | --bindir=%{_bindir} \ | |
79 | --includedir=%{_includedir} \ | |
80 | --libdir=%{_libdir} \ | |
f9075d69 JB |
81 | %ifarch x32 |
82 | --disable-asm \ | |
83 | %endif | |
b628c20b JB |
84 | --disable-gpac \ |
85 | %{!?with_lsmash:--disable-lsmash} \ | |
86 | %{!?with_opencl:--disable-opencl} \ | |
87 | --enable-pic \ | |
88 | --enable-shared \ | |
89 | %{!?with_static_libs:--disable-static} | |
90 | %{__make} | |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %{__make} -C build/linux install \ | |
96 | DESTDIR=$RPM_BUILD_ROOT | |
97 | ||
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %post -p /sbin/ldconfig | |
102 | %postun -p /sbin/ldconfig | |
103 | ||
104 | %files | |
105 | %defattr(644,root,root,755) | |
106 | %doc README.md | |
107 | %lang(zh) %doc README.zh.md | |
108 | %attr(755,root,root) %{_bindir}/xavs2 | |
109 | %attr(755,root,root) %{_libdir}/libxavs2.so.13 | |
110 | ||
111 | %files devel | |
112 | %defattr(644,root,root,755) | |
113 | %attr(755,root,root) %{_libdir}/libxavs2.so | |
114 | %{_includedir}/xavs2.h | |
115 | %{_includedir}/xavs2_config.h | |
116 | %{_pkgconfigdir}/xavs2.pc | |
117 | ||
118 | %if %{with static_libs} | |
119 | %files static | |
120 | %defattr(644,root,root,755) | |
121 | %{_libdir}/libxavs2.a | |
122 | %endif |