File gpac.spec of Package gpac (Revision ce1fabced5980e19ac72b3cea1b20897)

Currently displaying revision ce1fabced5980e19ac72b3cea1b20897 , Show latest

433
 
1
#
2
# spec file for package gpac
3
#
4
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via http://bugs.opensuse.org/
16
#
17
18
%define soname      2
19
20
# workaround for Tumbleweed. Because we can't detect it directly.
21
%if 0%{?suse_version} >= 1210
22
%define xulrunner_version %(rpm -q --qf '%%{VERSION}' xulrunner-devel | sed 's|\\..*$||')
23
%else
24
%define xulrunner192_version %(rpm -q --qf '%%{VERSION}' mozilla-xulrunner192-devel | sed 's|\\..*$||')
25
%endif
26
27
# obs@botter.cc - ugly hack to disable compilation with xulrunnner 17.0.2
28
%if 0%{?xulrunner_version} == 17
29
%define wo_applications 1
30
%else
31
%define wo_applications 0
32
%endif
33
34
Name:           gpac
35
Version:        0.5.0.svn4296
36
Release:        1.pm.1
37
License:        LGPL-2.1+
38
Summary:        A multimedia framework covering MPEG-4, VRML/X3D and SVG
39
Group:          Productivity/Multimedia/Video/Editors and Convertors
40
Source:         gpac-%{version}.tar.bz2
41
Source1:        http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-b00.zip
42
Source2:        http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-b00.zip
43
Url:            http://gpac.sourceforge.net
44
Source90:       %{name}-rpmlintrc
45
#PATCH-FIX-openSUSE i@marguerite.su - openSUSE only fix for sf#3574796
46
Patch0:         gpac-0.5.0-smjs_call_prop_stub.patch
47
#PATCH-FIX-UPSTREAM i@marguerite.su - enable osmozilla and osmo4_wx
48
Patch1:     gpac-0.5.0-enable_V4Studio.patch
49
#PATCH-FIX-UPSTREAM i@marguerite.su - fix SVGGen ldflags
50
Patch2:     gpac-0.5.0-SVGGen_abuild.patch
51
#PATCH-FIX-UPSTREAM wengxuetian@gmail.com - fix E: 64bit-portability-issue
52
Patch3:     gpac-0.5.0-64bit-portability.patch
53
#PATCH-FIX-UPSTREAM i@marguerite.su - export functions x264 needs
54
Patch4:     gpac-0.5.0-x264-export.patch
55
#PATCH-FIX-UPSTREAM obs@botter.cc - disable applications osmozilla, osmo4_wx
56
Patch10:    gpac-0.5.0-disable-applications.patch
57
BuildRequires:  DirectFB-devel
58
BuildRequires:  ImageMagick
59
BuildRequires:  Mesa-devel
60
BuildRequires:  alsa-devel
61
BuildRequires:  dos2unix
62
BuildRequires:  doxygen
63
BuildRequires:   fdupes
64
BuildRequires:  freeglut-devel
65
BuildRequires:  freetype2-devel
66
BuildRequires:  gcc-c++
67
%if 0%{?suse_version} >= 1140
68
BuildRequires:  libSDL-devel
69
%else
70
BuildRequires:  SDL-devel
71
%endif
72
BuildRequires:  liba52-devel
73
BuildRequires:  libfaad-devel
74
BuildRequires:  libffmpeg-devel
75
# fix for evergreen 11
76
%if 0%{?suse_version} == 1110
77
BuildRequires:  libidl
78
%endif
79
BuildRequires:  libjpeg-devel
80
BuildRequires:  libmad-devel
81
BuildRequires:  libogg-devel
82
BuildRequires:  libpng-devel
83
BuildRequires:  libpulse-devel
84
BuildRequires:  librsvg-devel >= 2.5.0
85
BuildRequires:  libtheora-devel
86
BuildRequires:  libvorbis-devel
87
BuildRequires:  libxvidcore-devel
88
%if 0%{?suse_version} == 1140
89
BuildRequires:  mozilla-js192
90
%endif
91
%if 0%{?suse_version} > 1140
92
BuildRequires:  js-devel
93
%endif
94
%if 0%{?suse_version} <= 1140
95
%if ! 0%{?sles_version}
96
BuildRequires:  mozilla-xulrunner192-devel
97
%endif
98
%else
99
BuildRequires:  xulrunner-devel
100
%endif
101
BuildRequires:  libopenssl-devel
102
%if 0%{?suse_version} >= 1140
103
BuildRequires:  pkgconfig(libopenjpeg)
104
%endif
105
BuildRequires:  pkgconfig(libxml-2.0)
106
BuildRequires:  unzip
107
BuildRequires:  update-desktop-files
108
%if 0%{?suse_version} >= 1140
109
BuildRequires:  wxWidgets-wxcontainer-devel
110
%else
111
BuildRequires:  wxGTK-devel
112
%endif
113
BuildRequires:  zlib-devel
114
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
115
116
%description
117
GPAC is a multimedia framework for MPEG-4, VRML/X3D and SVG/SMIL.
118
119
GPAC is built upon an implementation of the MPEG-4 Systems standard
120
(ISO/IEC 14496-1) developed from scratch in C.
121
122
The main development goal is to provide a clean (a.k.a. readable by
123
as many people as possible), small and flexible alternative to the
124
MPEG-4 Systems reference software (known as IM1 and distributed in
125
ISO/IEC 14496-5).
126
127
The second development goal is to achieve integration of recent
128
multimedia standards (SVG/SMIL, VRML, X3D, SWF, etc) into a single
129
framework. This stage is still under drafting but GPAC already
130
supports most of VRML97, some X3D as well as very simple SVG.
131
132
GPAC already features 2D and 3D multimedia playback, MPEG-4 Systems
133
encoders/multiplexers and publishing tools for content distribution.
134
135
GPAC is licensed under the GNU Lesser General Public License.
136
137
The current GPAC release (0.4.5) already covers a very large part of
138
the MPEG-4 standard, and features what can probably be seen as the
139
most advanced and robust 2D MPEG-4 Player available worldwide, as
140
well as a decent 3D MPEG-4/VRML player.
141
142
Author:         Jean Le Feuvre <jeanlf at users.sourceforge.net>
143
144
%package -n libgpac%{soname}
145
Summary:        Shared libraries for gpac
146
Group:          System/Libraries
147
148
%description -n libgpac%{soname}
149
Shared libraries for package gpac.
150
151
%package -n libgpac-devel
152
Summary:        Development files for gpac
153
Group:          Development/Languages/C and C++
154
Requires:       libgpac%{soname} = %{version}
155
# old name
156
Provides:       gpac-devel = %{version}
157
Obsoletes:      gpac-devel < %{version}
158
159
%description -n libgpac-devel
160
Development files for gpac.
161
162
Author:         Jean Le Feuvre <jeanlf@users.sourceforge.net>
163
164
%if ! %{wo_applications}
165
%package -n Osmo4
166
Summary:        MPEG-4 Media player based on gpac
167
Group:          Productivity/Multimedia/Video/Players
168
Requires:       %{name} = %{version}
169
170
%description -n Osmo4
171
Osmo4 is an MPEG-4 player with the following features:
172
* MPEG-4 Systems player:
173
* Optimized 2D graphics renderer compliant with the Complete2D Scene
174
  Graph and Graphics profiles.
175
* Video and audio presentation achieved through plugins
176
* Multimedia player features:
177
* Timeline controls: play, pause, step.
178
* Graphics features: antialising, zoom and pan, scalable resizing
179
  of rendering area
180
* Support for Advanced Text and Graphics extension of MPEG-4 Systems
181
* Frame export to JPG, PNG, BMP.
182
183
Osmo4 enables the use of MPEG-4 Systems in a vast aplication domain,
184
among which:
185
* downloaded or streamed cartoons
186
* synchronized, interactive mixes of graphics, text, video and audio
187
* applications benefiting from MPEG-7 and MPEG-21 advances: meta-data,
188
  encryption, watermarking, rights management
189
190
%if ! 0%{?sles_version}
191
%package browser-plugin
192
Summary:        Osmozilla is a GPAC plugin for Mozilla-based browsers
193
Group:          Productivity/Networking/Web/Utilities
194
Requires:       %{name} = %{version}
195
196
%description browser-plugin
197
Osmozilla is a GPAC plugin for Mozilla-based browsers.
198
%endif
199
%endif
200
201
%prep
202
%setup -q
203
%if 0%{?suse_version} >= 1210
204
%if 0%{?xulrunner_version} >= 16
205
%patch0 -p1
206
%endif
207
%else
208
%patch0 -p1
209
%endif
210
%patch1 -p1
211
%patch2 -p1
212
%patch3 -p1
213
%patch4 -p1
214
%if %{wo_applications}
215
%patch10 -p1
216
%endif
217
218
# unpack amr files
219
install -dm 755 modules/amr_float_dec/amr_nb_ft
220
pushd modules/amr_float_dec/amr_nb_ft
221
    unzip -q %{SOURCE1}
222
    unzip -qj 26104-b00_ANSI_C_source_code.zip
223
popd
224
225
install -dm 755 modules/amr_float_dec/amr_wb_ft
226
pushd modules/amr_float_dec/amr_wb_ft
227
    unzip -q %{SOURCE2}
228
    unzip -qj 26204-b00_ANSI-C_source_code.zip
229
popd
230
231
# Fix encoding warnings
232
cp -p Changelog Changelog.origine
233
iconv -f ISO-8859-1 -t UTF8 Changelog.origine > Changelog
234
touch -r Changelog.origine Changelog
235
rm -rf Changelog.origine
236
237
cp -p doc/ipmpx_syntax.bt doc/ipmpx_syntax.bt.origine
238
iconv -f ISO-8859-1 -t UTF8 doc/ipmpx_syntax.bt.origine > doc/ipmpx_syntax.bt
239
touch -r doc/ipmpx_syntax.bt.origine doc/ipmpx_syntax.bt
240
rm -rf doc/ipmpx_syntax.bt.origine
241
242
%build
243
# regenerate plugin interface from IDL (see applications/osmozilla/readme.txt)
244
%if 0%{?suse_version} > 1140
245
pushd applications/osmozilla
246
    chmod 666 nsIOsmozilla.xpt_linux; rm nsIOsmozilla.xpt_linux
247
    chmod 666 nsIOsmozilla.h
248
    chmod 666 nsIOsmozilla.idl
249
250
    %define _IDL_DIR `pkg-config --variable=idldir libxul`
251
    %define _SDK_DIR `pkg-config --variable=sdkdir libxul`
252
253
    %{_SDK_DIR}/sdk/bin/header.py \
254
    -I%{_IDL_DIR} \
255
        -o nsIOsmozilla.h \
256
    nsIOsmozilla.idl
257
        %{_SDK_DIR}/sdk/bin/typelib.py \
258
    -I%{_IDL_DIR} \
259
       -o nsIOsmozilla.xpt \
260
    nsIOsmozilla.idl
261
262
    cp nsIOsmozilla.xpt nsIOsmozilla.xpt_linux
263
popd
264
%else
265
%if ! 0%{?sles_version}
266
pushd applications/osmozilla
267
    chmod 666 nsIOsmozilla.xpt_linux; rm nsIOsmozilla.xpt_linux
268
    chmod 666 nsIOsmozilla.h
269
    chmod 666 nsIOsmozilla.idl
270
271
    %define _IDL_DIR `pkg-config --variable=idldir libxul`
272
    %define _INC_DIR `pkg-config --variable=includedir libxul`
273
    %define _LIB_DIR `pkg-config --variable=libdir libxul`
274
275
    %{_LIB_DIR}/xpidl \
276
        -m header \
277
        -I%{_IDL_DIR} \
278
        -I%{_INC_DIR}/xpcom/idl \
279
        nsIOsmozilla.idl
280
    %{_LIB_DIR}/xpidl \
281
        -m typelib \
282
        -I%{_IDL_DIR} \
283
        -I%{_INC_DIR}/xpcom/idl \
284
        nsIOsmozilla.idl
285
    %{_LIB_DIR}/xpt_link \
286
        nposmozilla.xpt nsIOsmozilla.xpt
287
288
    cp nsIOsmozilla.xpt nsIOsmozilla.xpt_linux
289
popd
290
%endif
291
%endif
292
293
# configure the beast
294
./configure \
295
    --prefix=%{_prefix} \
296
%ifarch x86_64
297
    --libdir=lib64 \
298
%endif
299
    --mandir=%{_mandir} \
300
%if ! 0%{?sles_version}
301
    --xulsdk-path=`pkg-config --variable=sdkdir libxul` \
302
%endif
303
%if %{wo_applications}
304
    --disable-scenegraph \
305
%endif
306
    --extra-cflags="%{optflags} -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DXP_UNIX -fPIC" 
307
308
# make the beast (NO parallel build possible ...)
309
# fix I: File is compiled without RPM_OPT_FLAGS gpac doesn't respect any flags at all
310
make all CFLAG="%{optflags}"
311
make sggen 
312
make -C applications/generators/SVG
313
make -C applications/udptsseg
314
315
# create dev-docs
316
pushd doc
317
    doxygen -u
318
    doxygen
319
popd
320
321
%install
322
%make_install 
323
324
# header files
325
make install-lib \
326
    DESTDIR=%{buildroot}
327
328
%if ! %{wo_applications}
329
# browser-plugin
330
%if ! 0%{?sles_version}
331
install -dm 755 %{buildroot}%{_libdir}/browser-plugins
332
install -m 755 bin/gcc/nposmozilla.so \
333
    %{buildroot}%{_libdir}/browser-plugins
334
install -m 755 bin/gcc/nposmozilla.xpt \
335
    %{buildroot}%{_libdir}/browser-plugins
336
%endif
337
%endif
338
339
# generated sggen binaries
340
for i in MPEG4 SVG X3D; do
341
    install -m 755 applications/generators/$i/${i}Gen \
342
        %{buildroot}%{_bindir}
343
done
344
install -m 755 bin/gcc/mp4* \
345
    %{buildroot}%{_bindir}
346
347
# udptsseg
348
install -m 755 bin/gcc/udptsseg \
349
    %{buildroot}%{_bindir}
350
351
%if ! %{wo_applications}
352
# Osmo4
353
install -m 755 bin/gcc/Osmo4 \
354
    %{buildroot}%{_bindir}
355
356
# icon
357
install -dm 755 %{buildroot}%{_datadir}/pixmaps
358
convert -size 48x48 applications/osmo4_wx/osmo4.xpm \
359
    Osmo4.png
360
install -m 644 Osmo4.png \
361
    %{buildroot}%{_datadir}/pixmaps
362
%endif
363
364
%if ! %{wo_applications}
365
# menu-entry
366
install -dm 755 %{buildroot}%{_datadir}/applications
367
cat > Osmo4.desktop << EOF
368
[Desktop Entry]
369
Comment=MPEG-4 Media player based on gpac
370
Name=Osmo4
371
GenericName=MPEG-4 Media player based on gpac
372
Type=Application
373
Exec=Osmo4
374
Icon=Osmo4
375
Terminal=false
376
EOF
377
%suse_update_desktop_file -i Osmo4 AudioVideo Player
378
%endif
379
380
# static lib
381
rm -rf %{buildroot}%{_libdir}/*.a
382
383
%fdupes %{buildroot}
384
385
%post -n libgpac%{soname} -p /sbin/ldconfig
386
387
%postun -n libgpac%{soname} -p /sbin/ldconfig
388
389
%files
390
%defattr(-,root,root)
391
%doc AUTHORS BUGS Changelog COPYING README TODO
392
%doc doc/configuration.html
393
%{_bindir}/MP4Box
394
%if ! %{wo_applications}
395
%{_bindir}/MP4Client
396
%endif
397
%{_bindir}/MPEG4Gen
398
%{_bindir}/X3DGen
399
%{_bindir}/SVGGen
400
%{_bindir}/mp42ts
401
%{_bindir}/udptsseg
402
%{_libdir}/%{name}/
403
%{_datadir}/%{name}/
404
%{_mandir}/man1/*
405
406
%files -n libgpac%{soname}
407
%defattr(-,root,root)
408
%{_libdir}/*.so.%{soname}
409
%{_libdir}/*.so.%{soname}.*
410
411
%files -n libgpac-devel
412
%defattr(-,root,root)
413
%doc doc/CODING_STYLE doc/ipmpx_syntax.bt
414
%doc doc/html/*
415
%{_includedir}/%{name}/
416
%{_libdir}/*.so
417
418
%if ! %{wo_applications}
419
%files -n Osmo4
420
%defattr(-,root,root)
421
%{_bindir}/Osmo4
422
%{_datadir}/pixmaps/Osmo4.png
423
%{_datadir}/applications/Osmo4.desktop
424
425
%if ! 0%{?sles_version}
426
%files browser-plugin
427
%defattr(-,root,root)
428
%{_libdir}/browser-plugins/nposmozilla.*
429
%endif
430
%endif
431
432
%changelog
433