]> git.pld-linux.org Git - packages/libvpx.git/blob - libvpx.spec
- rel 3; x86_64 asm optimized now; nicer way of linking shared lib; export only requi...
[packages/libvpx.git] / libvpx.spec
1 #
2 # Conditional build:
3 %bcond_without  asm
4
5 Summary:        VP8, a high-quality video codec
6 Name:           libvpx
7 Version:        0.9.0
8 Release:        3
9 License:        BSD
10 Group:          Libraries
11 Source0:        http://webm.googlecode.com/files/%{name}-%{version}.tar.bz2
12 # Source0-md5:  9eb8e818d2f3263623c258fe66924082
13 Source1:        %{name}.ver
14 Patch0:         %{name}-0.9.0-no-explicit-dep-on-static-lib.patch
15 URL:            http://www.webmproject.org/
16 BuildRequires:  /usr/bin/php
17 BuildRequires:  autoconf
18 BuildRequires:  automake
19 BuildRequires:  doxygen
20 BuildRequires:  php-pcre
21 %{?with_asm:BuildRequires:      yasm}
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 VP8, a high-quality video codec.
26
27 %package devel
28 Summary:        Header files and develpment documentation for libvpx
29 Group:          Development/Libraries
30 Requires:       %{name} = %{epoch}:%{version}-%{release}
31
32 %description devel
33 Header files and documentation for libvpx.
34
35 %package static
36 Summary:        Static libvpx library
37 Group:          Development/Libraries
38 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
39
40 %description static
41 Static libvpx library.
42
43 %prep
44 %setup -q
45 %patch0 -p1
46
47 %build
48 install -d build
49 cd build
50 # not autoconf configure
51 ../configure \
52 %if %{with asm}
53 %ifarch %{x8664}
54         --target=x86_64-linux-gcc \
55 %endif
56 %ifarch %{ix86}
57         --target=x86-linux-gcc \
58 %endif
59 %else
60         --target=generic-gnu \
61 %endif
62         --enable-pic \
63         --disable-optimizations \
64         --enable-vp8 \
65         --enable-postproc \
66         --enable-runtime-cpu-detect
67
68 # Hack our optflags in.
69 sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{rpmcflags} %{rpmcppflags} -fPIC|g" {libs,examples,docs}-*.mk
70 sed -i "s|STRIP=.*|STRIP=|g" {libs,examples,docs}-*.mk
71
72 %{__make} verbose=true target=libs \
73         CC="%{__cc}"
74
75 mkdir tmp
76 cd tmp
77 ar x ../libvpx_g.a
78 cd ..
79 %{__cc} %{rpmldflags} -fPIC -shared \
80         -Wl,--no-undefined -Wl,-soname,libvpx.so.0 -Wl,--version-script,%{SOURCE1} -Wl,-z,noexecstack \
81         -o libvpx.so.0.0.0 tmp/*.o \
82         -pthread -lm
83 rm -rf tmp
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
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/vpx,%{_libdir}}
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}
110 install -p outdir/bin/* $RPM_BUILD_ROOT%{_bindir}
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
114 install -p build/libvpx.so* $RPM_BUILD_ROOT%{_libdir}
115
116 cp -a outdir/include/*.h $RPM_BUILD_ROOT%{_includedir}/vpx
117 cp -a outdir/lib/*.a $RPM_BUILD_ROOT%{_libdir}
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)
127 %attr(755,root,root) %{_bindir}/*
128 %attr(755,root,root) %{_libdir}/libvpx.so.*.*
129 %attr(755,root,root) %ghost %{_libdir}/libvpx.so.0
130
131 %files devel
132 %defattr(644,root,root,755)
133 %attr(755,root,root) %{_libdir}/libvpx*.so
134 %{_includedir}/vpx
135
136 %files static
137 %defattr(644,root,root,755)
138 %{_libdir}/libvpx.a
This page took 0.047612 seconds and 4 git commands to generate.