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