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