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