]> git.pld-linux.org Git - packages/libvpx.git/blob - libvpx.spec
- do not package shared lib in devel, but symlink; rel 4
[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:        4
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-common >= 4:5.0.0
21 BuildRequires:  php-pcre
22 %{?with_asm:BuildRequires:      yasm}
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %description
26 VP8, a high-quality video codec.
27
28 %package devel
29 Summary:        Header files and develpment documentation for libvpx
30 Group:          Development/Libraries
31 Requires:       %{name} = %{epoch}:%{version}-%{release}
32
33 %description devel
34 Header files and documentation for libvpx.
35
36 %package static
37 Summary:        Static libvpx library
38 Group:          Development/Libraries
39 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
40
41 %description static
42 Static libvpx library.
43
44 %prep
45 %setup -q
46 %patch0 -p1
47
48 %build
49 install -d build
50 cd build
51 # not autoconf configure
52 ../configure \
53 %if %{with asm}
54 %ifarch %{x8664}
55         --target=x86_64-linux-gcc \
56 %endif
57 %ifarch %{ix86}
58         --target=x86-linux-gcc \
59 %endif
60 %else
61         --target=generic-gnu \
62 %endif
63         --enable-pic \
64         --disable-optimizations \
65         --enable-vp8 \
66         --enable-postproc \
67         --enable-runtime-cpu-detect
68
69 # Hack our optflags in.
70 sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{rpmcflags} %{rpmcppflags} -fPIC|g" {libs,examples,docs}-*.mk
71 sed -i "s|STRIP=.*|STRIP=|g" {libs,examples,docs}-*.mk
72
73 %{__make} verbose=true target=libs \
74         CC="%{__cc}"
75
76 mkdir tmp
77 cd tmp
78 ar x ../libvpx_g.a
79 cd ..
80 %{__cc} %{rpmldflags} -fPIC -shared \
81         -Wl,--no-undefined -Wl,-soname,libvpx.so.0 -Wl,--version-script,%{SOURCE1} -Wl,-z,noexecstack \
82         -o libvpx.so.0.0.0 tmp/*.o \
83         -pthread -lm
84 rm -rf tmp
85
86 # Temporarily dance the static libs out of the way
87 mv libvpx.a libNOTvpx.a
88 mv libvpx_g.a libNOTvpx_g.a
89
90 # We need to do this so the examples can link against it.
91 ln -sf libvpx.so.0.0.0 libvpx.so
92
93 %{__make} verbose=true target=examples \
94         CC="%{__cc}"
95 %{__make} verbose=true target=docs
96
97 # Put them back so the install doesn't fail
98 mv libNOTvpx.a libvpx.a
99 mv libNOTvpx_g.a libvpx_g.a
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103 install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/vpx,%{_libdir}}
104
105 install -d outdir
106 %{__make} -C build install \
107         DIST_DIR=$(pwd)/outdir
108
109 mv outdir/bin/{simple_decoder,vp8_simple_decoder}
110 mv outdir/bin/{twopass_encoder,vp8_twopass_encoder}
111 install -p outdir/bin/* $RPM_BUILD_ROOT%{_bindir}
112
113 install -p build/libvpx.so.* $RPM_BUILD_ROOT%{_libdir}
114 ln -s libvpx.so.0.0.0 $RPM_BUILD_ROOT%{_libdir}/libvpx.so.0
115 ln -s libvpx.so.0.0.0 $RPM_BUILD_ROOT%{_libdir}/libvpx.so
116
117 cp -a outdir/include/*.h $RPM_BUILD_ROOT%{_includedir}/vpx
118 cp -a outdir/lib/*.a $RPM_BUILD_ROOT%{_libdir}
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %post   -p /sbin/ldconfig
124 %postun -p /sbin/ldconfig
125
126 %files
127 %defattr(644,root,root,755)
128 %attr(755,root,root) %{_bindir}/*
129 %attr(755,root,root) %{_libdir}/libvpx.so.*.*.*
130 %attr(755,root,root) %ghost %{_libdir}/libvpx.so.0
131
132 %files devel
133 %defattr(644,root,root,755)
134 %attr(755,root,root) %{_libdir}/libvpx.so
135 %{_includedir}/vpx
136
137 %files static
138 %defattr(644,root,root,755)
139 %{_libdir}/libvpx.a
This page took 0.044087 seconds and 4 git commands to generate.