]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without asm # x86 assembler | |
4 | %bcond_without doc # don't build doc | |
5 | %bcond_with tests # build tests (not useful, creates libgtest.a) | |
6 | %bcond_without ssse3 # use SSSE3 instructions (Intel since Core2, Via Nano) | |
7 | ||
8 | %ifnarch %{ix86} %{x8664} | |
9 | %undefine with_asm | |
10 | %endif | |
11 | ||
12 | %if "%{pld_release}" == "ac" | |
13 | # not supported by compiler | |
14 | %undefine with_ssse3 | |
15 | %endif | |
16 | ||
17 | Summary: VP8, a high-quality video codec | |
18 | Summary(pl.UTF-8): VP8 - kodek obrazu wysokiej jakości | |
19 | Name: libvpx | |
20 | Version: 1.4.0 | |
21 | Release: 1 | |
22 | License: BSD | |
23 | Group: Libraries | |
24 | # Source in git web, but regenerated on each fetch, so use gentoo tarball instead | |
25 | #Source0: https://chromium.googlesource.com/webm/libvpx/+archive/v%{version}.tar.gz?/%{name}-%{version}.tar.gz | |
26 | Source0: http://distfiles.gentoo.org/distfiles/%{name}-%{version}.tar.bz2 | |
27 | # Source0-md5: 63b1d7f59636a42eeeee9225cc14e7de | |
28 | URL: http://www.webmproject.org/ | |
29 | BuildRequires: doxygen | |
30 | %{?with_tests:BuildRequires: libstdc++-devel} | |
31 | BuildRequires: pkgconfig | |
32 | BuildRequires: rpmbuild(macros) >= 1.673 | |
33 | BuildRequires: sed >= 4.0 | |
34 | %{?with_asm:BuildRequires: yasm >= 0.8} | |
35 | %if %{with doc} | |
36 | BuildRequires: %{php_name}-pcre | |
37 | BuildRequires: %{php_name}-program | |
38 | %endif | |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %define generic_target generic-gnu | |
42 | %define vpxtarget %{generic_target} | |
43 | %ifarch %{x8664} | |
44 | %define vpxtarget x86_64-linux-gcc | |
45 | %endif | |
46 | %ifarch %{ix86} | |
47 | %define vpxtarget x86-linux-gcc | |
48 | %endif | |
49 | %ifarch ppc | |
50 | %define vpxtarget ppc32-linux-gcc | |
51 | %endif | |
52 | %ifarch ppc64 | |
53 | %define vpxtarget ppc64-linux-gcc | |
54 | %endif | |
55 | ||
56 | %description | |
57 | VP8, a high-quality video codec. | |
58 | ||
59 | %description -l pl.UTF-8 | |
60 | VP8 - kodek obrazu wysokiej jakości. | |
61 | ||
62 | %package devel | |
63 | Summary: Header files for libvpx | |
64 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libvpx | |
65 | Group: Development/Libraries | |
66 | Requires: %{name} = %{version}-%{release} | |
67 | ||
68 | %description devel | |
69 | Header files for libvpx library. | |
70 | ||
71 | %description devel -l pl.UTF-8 | |
72 | Pliki nagłówkowe biblioteki libvpx. | |
73 | ||
74 | %package static | |
75 | Summary: Static libvpx library | |
76 | Summary(pl.UTF-8): Statyczna biblioteka libvpx | |
77 | Group: Development/Libraries | |
78 | Requires: %{name}-devel = %{version}-%{release} | |
79 | ||
80 | %description static | |
81 | Static libvpx library. | |
82 | ||
83 | %description static -l pl.UTF-8 | |
84 | Statyczna biblioteka libvpx. | |
85 | ||
86 | %prep | |
87 | %setup -q | |
88 | ||
89 | %build | |
90 | install -d obj | |
91 | cd obj | |
92 | # not autoconf configure | |
93 | CC="%{__cc}" \ | |
94 | CXX="%{__cxx}" \ | |
95 | CFLAGS="%{rpmcflags} %{rpmcppflags} %{!?with_asm:-DYUV_DISABLE_ASM}" \ | |
96 | ../configure \ | |
97 | %if %{with asm} | |
98 | --as=yasm \ | |
99 | %endif | |
100 | --target=%{vpxtarget} \ | |
101 | --enable-shared \ | |
102 | %{!?with_ssse3:--disable-ssse3} \ | |
103 | --disable-optimizations \ | |
104 | --%{!?with_tests:dis}%{?with_tests:en}able-unit-tests \ | |
105 | --%{!?with_doc:dis}%{?with_doc:en}able-docs \ | |
106 | --%{!?with_doc:dis}%{?with_doc:en}able-install-docs \ | |
107 | --enable-vp8 \ | |
108 | --enable-vp8 \ | |
109 | --enable-postproc \ | |
110 | --enable-runtime-cpu-detect | |
111 | ||
112 | %{__make} verbose=true target=libs \ | |
113 | HAVE_GNU_STRIP=no \ | |
114 | LDFLAGS="%{rpmldflags}" | |
115 | ||
116 | %{__make} verbose=true target=examples \ | |
117 | LDFLAGS="%{rpmldflags} -L." | |
118 | ||
119 | %if %{with doc} | |
120 | %{__make} verbose=true target=docs | |
121 | %endif | |
122 | ||
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/vpx,%{_libdir}} | |
126 | ||
127 | %{__make} -C obj verbose=true install \ | |
128 | LIBSUBDIR=%{_lib} \ | |
129 | DIST_DIR=$RPM_BUILD_ROOT%{_prefix} | |
130 | ||
131 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libvpx.so.2.0 | |
132 | ||
133 | # adjust prefix and libdir | |
134 | %{__sed} -i -e 's,^prefix=.*,prefix=%{_prefix},;s,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/vpx.pc | |
135 | ||
136 | %clean | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %post -p /sbin/ldconfig | |
140 | %postun -p /sbin/ldconfig | |
141 | ||
142 | %files | |
143 | %defattr(644,root,root,755) | |
144 | %doc AUTHORS CHANGELOG LICENSE PATENTS README | |
145 | %attr(755,root,root) %{_bindir}/vpxdec | |
146 | %attr(755,root,root) %{_bindir}/vpxenc | |
147 | %attr(755,root,root) %{_libdir}/libvpx.so.*.*.* | |
148 | %attr(755,root,root) %ghost %{_libdir}/libvpx.so.2 | |
149 | ||
150 | %files devel | |
151 | %defattr(644,root,root,755) | |
152 | %attr(755,root,root) %{_libdir}/libvpx.so | |
153 | %{_includedir}/vpx | |
154 | %{_pkgconfigdir}/vpx.pc | |
155 | ||
156 | %files static | |
157 | %defattr(644,root,root,755) | |
158 | %{_libdir}/libvpx.a |