1 | # Add *.mymod files to the default list of files to be processed
|
---|
2 | %define _strip_opts --debuginfo -i "libvpx2.dll"
|
---|
3 | # whether to use Github, or Netlabs's svn
|
---|
4 | %define _github 0
|
---|
5 |
|
---|
6 | # define _version 1.5.0
|
---|
7 | %define _version 1.4.0
|
---|
8 | %define github_name libvpx
|
---|
9 |
|
---|
10 | %if %_github
|
---|
11 | %define github_url https://github.com/webmproject/%{github_name}/archive
|
---|
12 | %define github_rev %{_version}
|
---|
13 | %else
|
---|
14 | %define github_url http://svn.netlabs.org/repos/ports/libvpx/trunk
|
---|
15 | %define github_rev 1355
|
---|
16 | %endif
|
---|
17 |
|
---|
18 | Name: %{github_name}
|
---|
19 | Summary: VP8 Video Codec SDK
|
---|
20 | Version: %{_version}
|
---|
21 | Release: 1%{?dist}
|
---|
22 | License: BSD
|
---|
23 | Group: System Environment/Libraries
|
---|
24 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
|
---|
25 | %if %_github
|
---|
26 | Source0: %{github_name}-%{github_rev}.zip
|
---|
27 | #Source0: http://webm.googlecode.com/files/%{name}-%{version}.tar.bz2
|
---|
28 | %else
|
---|
29 | Source0: %{name}-%{version}%{?github_rev:-r%{github_rev}}.zip
|
---|
30 | %endif
|
---|
31 | # Thanks to debian.
|
---|
32 | #Source2: libvpx.ver
|
---|
33 | Source1: donation.txt
|
---|
34 | Source2: libvpx-1.4.0.txt
|
---|
35 | Patch0: %{name}-rtcd.patch
|
---|
36 | # uncomment for version 1.4.0 or below
|
---|
37 | Patch1: %{name}-komh.patch
|
---|
38 | Patch2: %{name}-conf.patch
|
---|
39 | URL: http://www.webmproject.org/tools/vp8-sdk/
|
---|
40 | BuildRequires: nasm
|
---|
41 | BuildRequires: libgcc1, pthread-devel
|
---|
42 | #BuildRequires: doxygen, php-cli
|
---|
43 |
|
---|
44 | %description
|
---|
45 | libvpx provides the VP8 SDK, which allows you to integrate your applications
|
---|
46 | with the VP8 video codec, a high quality, royalty free, open source codec
|
---|
47 | deployed on millions of computers and devices worldwide.
|
---|
48 |
|
---|
49 | %package devel
|
---|
50 | Summary: Development files for libvpx
|
---|
51 | Group: Development/Libraries
|
---|
52 | Requires: %{name} = %{version}-%{release}
|
---|
53 |
|
---|
54 | %description devel
|
---|
55 | Development libraries and headers for developing software against
|
---|
56 | libvpx.
|
---|
57 |
|
---|
58 | %debug_package
|
---|
59 |
|
---|
60 | %prep
|
---|
61 | # %setup -q
|
---|
62 |
|
---|
63 | %if %_github
|
---|
64 |
|
---|
65 | %if %(sh -c 'if test -f "%{_sourcedir}/%{github_name}-%{github_rev}.zip" ; then echo 1 ; else echo 0 ; fi')
|
---|
66 | %setup -n "%{github_name}-%{github_rev}" -q
|
---|
67 | %else
|
---|
68 | %setup -n "%{github_name}-%{github_rev}" -Tc
|
---|
69 | rm -f "%{_sourcedir}/%{github_name}-%{github_rev}.zip"
|
---|
70 | curl -sSL "%{github_url}/v%{github_rev}.zip" -o "%{_sourcedir}/%{github_name}-%{github_rev}.zip"
|
---|
71 | unzip -oC "%{_sourcedir}/%{github_name}-%{github_rev}.zip" -d ..
|
---|
72 | %endif
|
---|
73 |
|
---|
74 | %else
|
---|
75 |
|
---|
76 | %if %{?github_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{github_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?github_rev):0}
|
---|
77 | %setup -q
|
---|
78 | %else
|
---|
79 | %setup -n "%{name}-%{version}" -Tc
|
---|
80 | svn export %{?github_rev:-r %{github_rev}} %{github_url} . --force
|
---|
81 | rm -f "%{_sourcedir}/%{name}-%{version}%{?github_rev:-r%{github_rev}}.zip"
|
---|
82 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?github_rev:-r%{github_rev}}.zip" "%{name}-%{version}")
|
---|
83 | %endif
|
---|
84 |
|
---|
85 | %endif
|
---|
86 |
|
---|
87 | #autoreconf -fi
|
---|
88 |
|
---|
89 | %if %_github
|
---|
90 |
|
---|
91 | %patch0 -p1
|
---|
92 | # uncomment for version 1.4.0 or below
|
---|
93 | %patch1 -p1
|
---|
94 |
|
---|
95 | %patch2 -p1
|
---|
96 |
|
---|
97 | %endif
|
---|
98 |
|
---|
99 | %build
|
---|
100 | %ifarch %{ix86}
|
---|
101 | %global vpxtarget x86-os2-gcc
|
---|
102 | %else
|
---|
103 | %ifarch x86_64
|
---|
104 | %global vpxtarget x86_64-os2-gcc
|
---|
105 | %else
|
---|
106 | %global vpxtarget generic-gnu
|
---|
107 | %endif
|
---|
108 | %endif
|
---|
109 |
|
---|
110 | export LDFLAGS="-Zhigh-mem -lsocket -lmmap -g" \
|
---|
111 | CFLAGS="-g" CXXFLAGS="-g" ASFLAGS="-g -f aout" AS=nasm
|
---|
112 |
|
---|
113 | ./configure \
|
---|
114 | --prefix=%{_prefix} \
|
---|
115 | --libdir=%{_libdir} \
|
---|
116 | --target=%{vpxtarget} \
|
---|
117 | --disable-install-srcs \
|
---|
118 | --enable-vp8 \
|
---|
119 | --enable-vp9 \
|
---|
120 | --enable-postproc \
|
---|
121 | --enable-onthefly-bitpacking \
|
---|
122 | --enable-multi-res-encoding \
|
---|
123 | --enable-runtime-cpu-detect \
|
---|
124 | --enable-postproc-visualizer \
|
---|
125 | --enable-error-concealment \
|
---|
126 | --disable-examples \
|
---|
127 | --disable-install-docs \
|
---|
128 | --enable-pic \
|
---|
129 | --enable-shared \
|
---|
130 | --enable-small
|
---|
131 |
|
---|
132 | # Hack our optflags in.
|
---|
133 | #sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{optflags} -fPIC|g" libs-%{vpxtarget}.mk
|
---|
134 | ##sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{optflags} -fPIC|g" examples-%{vpxtarget}.mk
|
---|
135 | #sed -i "s|\"vpx_config.h\"|\"vpx_config.h\" %{optflags} -fPIC|g" docs-%{vpxtarget}.mk
|
---|
136 |
|
---|
137 | %{__make} %{?_smp_mflags} verbose=true target=libs
|
---|
138 |
|
---|
139 | # Really? You couldn't make this a shared library? Ugh.
|
---|
140 | # Oh well, I'll do it for you.
|
---|
141 | #mkdir tmp
|
---|
142 | #cd tmp
|
---|
143 | #ar x ../libvpx_g.a
|
---|
144 | #cd ..
|
---|
145 | # 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
|
---|
146 | #rm -rf tmp
|
---|
147 | # Temporarily dance the static libs out of the way
|
---|
148 | #mv libvpx.a libNOTvpx.a
|
---|
149 | #mv libvpx_g.a libNOTvpx_g.a
|
---|
150 | # We need to do this so the examples can link against it.
|
---|
151 | #ln -sf libvpx.so.0.0.0 libvpx.so
|
---|
152 | ##make %{?_smp_mflags} verbose=true target=examples
|
---|
153 | #make %{?_smp_mflags} verbose=true target=docs
|
---|
154 | # Put them back so the install doesn't fail
|
---|
155 | #mv libNOTvpx.a libvpx.a
|
---|
156 | #mv libNOTvpx_g.a libvpx_g.a
|
---|
157 |
|
---|
158 | %install
|
---|
159 | rm -rf $RPM_BUILD_ROOT
|
---|
160 | %{__make} DIST_DIR=%{buildroot}%{_prefix} install
|
---|
161 | mkdir -p %{buildroot}%{_includedir}/vpx/
|
---|
162 | #install -p libvpx.so.0.0.0 %{buildroot}%{_libdir}
|
---|
163 | #pushd %{buildroot}%{_libdir}
|
---|
164 | #ln -sf libvpx.so.0.0.0 libvpx.so
|
---|
165 | #ln -sf libvpx.so.0.0.0 libvpx.so.0
|
---|
166 | #ln -sf libvpx.so.0.0.0 libvpx.so.0.0
|
---|
167 | #popd
|
---|
168 | #pushd %{buildroot}
|
---|
169 | # Stuff we don't need.
|
---|
170 | rm -rf usr/build/ usr/md5sums.txt usr/lib*/*.a usr/CHANGELOG usr/README
|
---|
171 | #popd
|
---|
172 | emxomf -o %{buildroot}%{_libdir}/libvpx.lib %{buildroot}%{_libdir}/libvpx.a
|
---|
173 | emximp -o %{buildroot}%{_libdir}/libvpx_dll.lib %{buildroot}%{_libdir}/libvpx2.dll
|
---|
174 |
|
---|
175 | %clean
|
---|
176 | rm -rf $RPM_BUILD_ROOT
|
---|
177 |
|
---|
178 | #%post -p /sbin/ldconfig
|
---|
179 |
|
---|
180 | #%postun -p /sbin/ldconfig
|
---|
181 |
|
---|
182 | %files
|
---|
183 | %defattr(-,root,root,-)
|
---|
184 | %doc AUTHORS CHANGELOG LICENSE README PATENTS
|
---|
185 | %{_libdir}/libvpx2.dll
|
---|
186 |
|
---|
187 | %files devel
|
---|
188 | %defattr(-,root,root,-)
|
---|
189 | # These are SDK docs, not really useful to an end-user.
|
---|
190 | #%doc docs/
|
---|
191 | %{_includedir}/vpx/
|
---|
192 | %{_libdir}/pkgconfig/vpx.pc
|
---|
193 | %{_libdir}/libvpx*.a
|
---|
194 | %{_libdir}/libvpx*.lib
|
---|
195 | #%{_libdir}/libvpx*.dbg
|
---|
196 |
|
---|
197 | %changelog
|
---|
198 | * Tue Nov 17 2015 Valery Sedletski <_valerius@mail.ru> - 1.4.0 OS/2 initial build
|
---|
199 | - initial OS/2 build
|
---|