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