]>
Commit | Line | Data |
---|---|---|
c9ee805b ER |
1 | # |
2 | # Conditional build: | |
7b991969 | 3 | %bcond_without asm |
955bbb6a | 4 | |
bccc9f86 AM |
5 | Summary: VP8, a high-quality video codec |
6 | Name: libvpx | |
946a004e | 7 | Version: 0.9.5 |
ac10c7c7 | 8 | Release: 1 |
bccc9f86 AM |
9 | License: BSD |
10 | Group: Libraries | |
34eceac6 | 11 | Source0: http://webm.googlecode.com/files/%{name}-v%{version}.tar.bz2 |
946a004e | 12 | # Source0-md5: 4bf2f2c76700202c1fe9201fcb0680e3 |
5cb65362 | 13 | Source1: %{name}.ver |
0257ab6e | 14 | Patch0: %{name}-0.9.0-no-explicit-dep-on-static-lib.patch |
bccc9f86 | 15 | URL: http://www.webmproject.org/ |
13542557 | 16 | BuildRequires: /usr/bin/php |
bccc9f86 AM |
17 | BuildRequires: autoconf |
18 | BuildRequires: automake | |
a28e5963 | 19 | BuildRequires: doxygen |
47f853c3 | 20 | BuildRequires: php-common >= 4:5.0.0 |
13542557 | 21 | BuildRequires: php-pcre |
7b991969 | 22 | %{?with_asm:BuildRequires: yasm} |
bccc9f86 AM |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
24 | ||
25 | %description | |
26 | VP8, a high-quality video codec. | |
27 | ||
28 | %package devel | |
29 | Summary: Header files and develpment documentation for libvpx | |
30 | Group: Development/Libraries | |
31 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
32 | ||
33 | %description devel | |
34 | Header files and documentation for libvpx. | |
35 | ||
36 | %package static | |
37 | Summary: Static libvpx library | |
38 | Group: Development/Libraries | |
39 | Requires: %{name}-devel = %{epoch}:%{version}-%{release} | |
40 | ||
41 | %description static | |
42 | Static libvpx library. | |
43 | ||
44 | %prep | |
946a004e | 45 | %setup -q -n %{name}-v%{version} |
0257ab6e | 46 | %patch0 -p1 |
bccc9f86 AM |
47 | |
48 | %build | |
49 | install -d build | |
50 | cd build | |
51 | # not autoconf configure | |
52 | ../configure \ | |
7b991969 | 53 | %if %{with asm} |
bccc9f86 AM |
54 | %ifarch %{x8664} |
55 | --target=x86_64-linux-gcc \ | |
56 | %endif | |
57 | %ifarch %{ix86} | |
58 | --target=x86-linux-gcc \ | |
7b991969 AM |
59 | %endif |
60 | %else | |
61 | --target=generic-gnu \ | |
bccc9f86 | 62 | %endif |
0257ab6e AM |
63 | --enable-pic \ |
64 | --disable-optimizations \ | |
bccc9f86 AM |
65 | --enable-vp8 \ |
66 | --enable-postproc \ | |
67 | --enable-runtime-cpu-detect | |
0257ab6e AM |
68 | |
69 | # Hack our optflags in. | |
7b991969 AM |
70 | sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{rpmcflags} %{rpmcppflags} -fPIC|g" {libs,examples,docs}-*.mk |
71 | sed -i "s|STRIP=.*|STRIP=|g" {libs,examples,docs}-*.mk | |
0257ab6e AM |
72 | |
73 | %{__make} verbose=true target=libs \ | |
74 | CC="%{__cc}" | |
75 | ||
5cb65362 AM |
76 | mkdir tmp |
77 | cd tmp | |
78 | ar x ../libvpx_g.a | |
79 | cd .. | |
80 | %{__cc} %{rpmldflags} -fPIC -shared \ | |
81 | -Wl,--no-undefined -Wl,-soname,libvpx.so.0 -Wl,--version-script,%{SOURCE1} -Wl,-z,noexecstack \ | |
82 | -o libvpx.so.0.0.0 tmp/*.o \ | |
83 | -pthread -lm | |
84 | rm -rf tmp | |
0257ab6e AM |
85 | |
86 | # Temporarily dance the static libs out of the way | |
87 | mv libvpx.a libNOTvpx.a | |
88 | mv libvpx_g.a libNOTvpx_g.a | |
89 | ||
90 | # We need to do this so the examples can link against it. | |
91 | ln -sf libvpx.so.0.0.0 libvpx.so | |
92 | ||
93 | %{__make} verbose=true target=examples \ | |
94 | CC="%{__cc}" | |
95 | %{__make} verbose=true target=docs | |
96 | ||
97 | # Put them back so the install doesn't fail | |
98 | mv libNOTvpx.a libvpx.a | |
99 | mv libNOTvpx_g.a libvpx_g.a | |
bccc9f86 AM |
100 | |
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
464fefd2 | 103 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/vpx,%{_libdir}} |
0257ab6e AM |
104 | |
105 | install -d outdir | |
106 | %{__make} -C build install \ | |
107 | DIST_DIR=$(pwd)/outdir | |
108 | ||
c9ee805b | 109 | install -p outdir/bin/* $RPM_BUILD_ROOT%{_bindir} |
47f853c3 ER |
110 | install -p build/libvpx.so.* $RPM_BUILD_ROOT%{_libdir} |
111 | ln -s libvpx.so.0.0.0 $RPM_BUILD_ROOT%{_libdir}/libvpx.so.0 | |
112 | ln -s libvpx.so.0.0.0 $RPM_BUILD_ROOT%{_libdir}/libvpx.so | |
0257ab6e | 113 | |
ac10c7c7 | 114 | cp -a outdir/include/vpx/*.h $RPM_BUILD_ROOT%{_includedir}/vpx |
c9ee805b | 115 | cp -a outdir/lib/*.a $RPM_BUILD_ROOT%{_libdir} |
bccc9f86 AM |
116 | |
117 | %clean | |
118 | rm -rf $RPM_BUILD_ROOT | |
119 | ||
120 | %post -p /sbin/ldconfig | |
121 | %postun -p /sbin/ldconfig | |
122 | ||
123 | %files | |
124 | %defattr(644,root,root,755) | |
0257ab6e | 125 | %attr(755,root,root) %{_bindir}/* |
47f853c3 | 126 | %attr(755,root,root) %{_libdir}/libvpx.so.*.*.* |
0257ab6e | 127 | %attr(755,root,root) %ghost %{_libdir}/libvpx.so.0 |
bccc9f86 AM |
128 | |
129 | %files devel | |
130 | %defattr(644,root,root,755) | |
47f853c3 | 131 | %attr(755,root,root) %{_libdir}/libvpx.so |
464fefd2 | 132 | %{_includedir}/vpx |
bccc9f86 AM |
133 | |
134 | %files static | |
135 | %defattr(644,root,root,755) | |
0257ab6e | 136 | %{_libdir}/libvpx.a |