]> git.pld-linux.org Git - packages/libvpx.git/blobdiff - libvpx.spec
- rel 3; x86_64 asm optimized now; nicer way of linking shared lib; export only requi...
[packages/libvpx.git] / libvpx.spec
index 840cec6783b2462300e642829f7517977f1819c8..c9e70e51e514868b47c5fb98aedf1ab7acfc3913 100644 (file)
@@ -1,17 +1,24 @@
+#
+# Conditional build:
+%bcond_without asm
+
 Summary:       VP8, a high-quality video codec
 Name:          libvpx
 Version:       0.9.0
-Release:       0.1
+Release:       3
 License:       BSD
 Group:         Libraries
 Source0:       http://webm.googlecode.com/files/%{name}-%{version}.tar.bz2
 # Source0-md5: 9eb8e818d2f3263623c258fe66924082
+Source1:       %{name}.ver
 Patch0:                %{name}-0.9.0-no-explicit-dep-on-static-lib.patch
 URL:           http://www.webmproject.org/
+BuildRequires: /usr/bin/php
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: doxygen
-BuildRequires: yasm
+BuildRequires: php-pcre
+%{?with_asm:BuildRequires:     yasm}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -42,11 +49,15 @@ install -d build
 cd build
 # not autoconf configure
 ../configure \
+%if %{with asm}
 %ifarch %{x8664}
        --target=x86_64-linux-gcc \
 %endif
 %ifarch %{ix86}
        --target=x86-linux-gcc \
+%endif
+%else
+       --target=generic-gnu \
 %endif
        --enable-pic \
        --disable-optimizations \
@@ -55,17 +66,21 @@ cd build
        --enable-runtime-cpu-detect
 
 # Hack our optflags in.
-sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{rpmcflags} %{rpmcppflags} -fPIC|g" libs-*.mk
-sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{rpmcflags} %{rpmcppflags} -fPIC|g" examples-*.mk
-sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{rpmcflags} %{rpmcppflags} -fPIC|g" docs-*.mk
+sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{rpmcflags} %{rpmcppflags} -fPIC|g" {libs,examples,docs}-*.mk
+sed -i "s|STRIP=.*|STRIP=|g" {libs,examples,docs}-*.mk
 
 %{__make} verbose=true target=libs \
        CC="%{__cc}"
 
-%{__cc} %{rpmldflags} -fPIC -o libvpx.so.0.0.0 -shared -Wl,-soname,libvpx.so.0 vpx_codec/src/*.o vpx_mem/*.o \
-       vpx_scale/generic/*.o vp8/common/*.o vp8/common/generic/*.o vp8/*.o vp8/encoder/*.o \
-       vp8/encoder/generic/*.o vp8/decoder/*.o vp8/decoder/generic/*.o vpx_config.c.o \
-       vp8/common/x*/*.o vp8/encoder/x*/*.o vp8/decoder/x*/*.o vpx_ports/*.o -lm -lpthread
+mkdir tmp
+cd tmp
+ar x ../libvpx_g.a
+cd ..
+%{__cc} %{rpmldflags} -fPIC -shared \
+       -Wl,--no-undefined -Wl,-soname,libvpx.so.0 -Wl,--version-script,%{SOURCE1} -Wl,-z,noexecstack \
+       -o libvpx.so.0.0.0 tmp/*.o \
+       -pthread -lm
+rm -rf tmp
 
 # Temporarily dance the static libs out of the way
 mv libvpx.a libNOTvpx.a
@@ -84,8 +99,7 @@ mv libNOTvpx_g.a libvpx_g.a
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/vpx,%{_libdir}}
 
 install -d outdir
 %{__make} -C build install \
@@ -93,16 +107,14 @@ install -d outdir
 
 mv outdir/bin/{simple_decoder,vp8_simple_decoder}
 mv outdir/bin/{twopass_encoder,vp8_twopass_encoder}
-install -m755 outdir/bin/* $RPM_BUILD_ROOT%{_bindir}
+install -p outdir/bin/* $RPM_BUILD_ROOT%{_bindir}
 
 ln -s libvpx.so.0.0.0 build/libvpx.so.0.0
 ln -s libvpx.so.0.0.0 build/libvpx.so.0
-install -m755 -p build/libvpx.so* $RPM_BUILD_ROOT%{_libdir}
-ldconfig -X -n $RPM_BUILD_ROOT%{_libdir}
-
-install outdir/include/*.h $RPM_BUILD_ROOT%{_includedir}
+install -p build/libvpx.so* $RPM_BUILD_ROOT%{_libdir}
 
-install outdir/lib/*.a $RPM_BUILD_ROOT%{_libdir}
+cp -a outdir/include/*.h $RPM_BUILD_ROOT%{_includedir}/vpx
+cp -a outdir/lib/*.a $RPM_BUILD_ROOT%{_libdir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -119,7 +131,7 @@ rm -rf $RPM_BUILD_ROOT
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libvpx*.so
-%{_includedir}/*.h
+%{_includedir}/vpx
 
 %files static
 %defattr(644,root,root,755)
This page took 0.044089 seconds and 4 git commands to generate.