1 |
%define major 0 |
2 |
%define libname %mklibname vpx %major |
3 |
%define develname %mklibname -d vpx |
4 |
%define snapshot 0 |
5 |
Name: libvpx |
6 |
Summary: VP8 Video Codec SDK |
7 |
Version: 0.9.5 |
8 |
Release: %mkrel 1 |
9 |
License: BSD |
10 |
Group: System/Libraries |
11 |
Source0: http://webm.googlecode.com/files/%{name}-v%{version}.tar.bz2 |
12 |
Source1: libvpx.pc |
13 |
# Thanks to debian. |
14 |
Source2: libvpx.ver |
15 |
Patch0: libvpx-0.9.0-no-explicit-dep-on-static-lib.patch |
16 |
URL: http://www.webmproject.org/tools/vp8-sdk/ |
17 |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
18 |
%ifarch %{ix86} x86_64 |
19 |
BuildRequires: yasm |
20 |
%endif |
21 |
BuildRequires: doxygen, php-cli |
22 |
|
23 |
%description |
24 |
libvpx provides the VP8 SDK, which allows you to integrate your applications |
25 |
with the VP8 video codec, a high quality, royalty free, open source codec |
26 |
deployed on millions of computers and devices worldwide. |
27 |
|
28 |
%package -n %libname |
29 |
Summary: VP8 Video Codec SDK |
30 |
Group: System/Libraries |
31 |
|
32 |
%description -n %libname |
33 |
libvpx provides the VP8 SDK, which allows you to integrate your applications |
34 |
with the VP8 video codec, a high quality, royalty free, open source codec |
35 |
deployed on millions of computers and devices worldwide. |
36 |
|
37 |
|
38 |
|
39 |
%package -n %develname |
40 |
Summary: Development files for libvpx |
41 |
Group: Development/C |
42 |
Requires: %{libname} = %{version}-%{release} |
43 |
Provides: %name-devel = %version-%release |
44 |
|
45 |
%description -n %develname |
46 |
Development libraries and headers for developing software against |
47 |
libvpx. |
48 |
|
49 |
%package utils |
50 |
Summary: VP8 utilities and tools |
51 |
Group: Video |
52 |
Requires: %{libname} = %{version}-%{release} |
53 |
|
54 |
%description utils |
55 |
A selection of utilities and tools for VP8, including a sample encoder |
56 |
and decoder. |
57 |
|
58 |
%prep |
59 |
%setup -q -n %name-v%version |
60 |
%patch0 -p1 -b .no-static-lib |
61 |
|
62 |
%build |
63 |
%ifarch %{ix86} |
64 |
%global vpxtarget x86-linux-gcc |
65 |
%else |
66 |
%ifarch x86_64 |
67 |
%global vpxtarget x86_64-linux-gcc |
68 |
%else |
69 |
%global vpxtarget generic-gnu |
70 |
%endif |
71 |
%endif |
72 |
|
73 |
./configure --target=%{vpxtarget} --enable-pic --disable-install-srcs |
74 |
|
75 |
# Hack our optflags in. |
76 |
sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{optflags} -fPIC|g" libs-%{vpxtarget}.mk |
77 |
sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{optflags} -fPIC|g" examples-%{vpxtarget}.mk |
78 |
sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{optflags} -fPIC|g" docs-%{vpxtarget}.mk |
79 |
|
80 |
%make verbose=true target=libs |
81 |
|
82 |
# Really? You couldn't make this a shared library? Ugh. |
83 |
# Oh well, I'll do it for you. |
84 |
mkdir tmp |
85 |
cd tmp |
86 |
ar x ../libvpx_g.a |
87 |
cd .. |
88 |
gcc -fPIC -shared -pthread -lm -Wl,--no-undefined -Wl,-soname,libvpx.so.0 -Wl,--version-script,%{SOURCE2} -Wl,-z,noexecstack -o libvpx.so.0.0.0 tmp/*.o |
89 |
rm -rf tmp |
90 |
|
91 |
# Temporarily dance the static libs out of the way |
92 |
mv libvpx.a libNOTvpx.a |
93 |
mv libvpx_g.a libNOTvpx_g.a |
94 |
|
95 |
# We need to do this so the examples can link against it. |
96 |
ln -sf libvpx.so.0.0.0 libvpx.so |
97 |
|
98 |
%make verbose=true target=examples |
99 |
%make verbose=true target=docs |
100 |
|
101 |
# Put them back so the install doesn't fail |
102 |
mv libNOTvpx.a libvpx.a |
103 |
mv libNOTvpx_g.a libvpx_g.a |
104 |
|
105 |
%install |
106 |
rm -rf %buildroot |
107 |
make DIST_DIR=%{buildroot}%{_prefix} install |
108 |
|
109 |
cp simple_decoder %buildroot%_bindir/vp8_simple_decoder |
110 |
cp simple_encoder %buildroot%_bindir/vp8_simple_encoder |
111 |
cp twopass_encoder %buildroot%_bindir/vp8_twopass_encoder |
112 |
|
113 |
# Install the pkg-config file |
114 |
mkdir -p %{buildroot}%{_libdir}/pkgconfig/ |
115 |
install -m0644 %{SOURCE1} %{buildroot}%{_libdir}/pkgconfig/ |
116 |
# Fill in the variables |
117 |
sed -i "s|@PREFIX@|%{_prefix}|g" %{buildroot}%{_libdir}/pkgconfig/libvpx.pc |
118 |
sed -i "s|@LIBDIR@|%{_libdir}|g" %{buildroot}%{_libdir}/pkgconfig/libvpx.pc |
119 |
sed -i "s|@INCLUDEDIR@|%{_includedir}|g" %{buildroot}%{_libdir}/pkgconfig/libvpx.pc |
120 |
|
121 |
mkdir -p %{buildroot}%{_includedir}/vpx/ |
122 |
install -p libvpx.so.0.0.0 %{buildroot}%{_libdir} |
123 |
pushd %{buildroot}%{_libdir} |
124 |
ln -sf libvpx.so.0.0.0 libvpx.so |
125 |
ln -sf libvpx.so.0.0.0 libvpx.so.0 |
126 |
ln -sf libvpx.so.0.0.0 libvpx.so.0.0 |
127 |
popd |
128 |
pushd %{buildroot} |
129 |
# Stuff we don't need. |
130 |
rm -rf usr/build/ usr/md5sums.txt usr/lib*/*.a usr/CHANGELOG usr/README |
131 |
# Fix the binary permissions |
132 |
chmod 755 usr/bin/* |
133 |
popd |
134 |
|
135 |
%clean |
136 |
rm -rf %{buildroot} |
137 |
|
138 |
%files -n %libname |
139 |
%defattr(-,root,root,-) |
140 |
%doc AUTHORS CHANGELOG LICENSE README |
141 |
%{_libdir}/libvpx.so.%{major}* |
142 |
|
143 |
%files -n %develname |
144 |
%defattr(-,root,root,-) |
145 |
# These are SDK docs, not really useful to an end-user. |
146 |
%doc docs/html |
147 |
%{_includedir}/vpx/ |
148 |
%{_libdir}/pkgconfig/libvpx.pc |
149 |
%{_libdir}/libvpx.so |
150 |
|
151 |
%files utils |
152 |
%defattr(-,root,root,-) |
153 |
%{_bindir}/* |
154 |
|
155 |
|
156 |
|