File gpac.spec of Package gpac
#
# spec file for package gpac
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define soname 2
# workaround for Tumbleweed. Because we can't detect it directly.
%if 0%{?suse_version} >= 1210
%define xulrunner_version %(rpm -q --qf '%%{VERSION}' xulrunner-devel | sed 's|\\..*$||')
%else
%define xulrunner192_version %(rpm -q --qf '%%{VERSION}' mozilla-xulrunner192-devel | sed 's|\\..*$||')
%endif
# obs@botter.cc - ugly hack to disable compilation with xulrunnner 17.0.2
%if 0%{?xulrunner_version} == 17
%define wo_applications 1
%else
%define wo_applications 0
%endif
Name: gpac
Version: 0.5.0.svn4296
Release: 1.pm.1
License: LGPL-2.1+
Summary: A multimedia framework covering MPEG-4, VRML/X3D and SVG
Group: Productivity/Multimedia/Video/Editors and Convertors
Source: gpac-%{version}.tar.bz2
Source1: http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-b00.zip
Source2: http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-b00.zip
Url: http://gpac.sourceforge.net
Source90: %{name}-rpmlintrc
#PATCH-FIX-openSUSE i@marguerite.su - openSUSE only fix for sf#3574796
Patch0: gpac-0.5.0-smjs_call_prop_stub.patch
#PATCH-FIX-UPSTREAM i@marguerite.su - enable osmozilla and osmo4_wx
Patch1: gpac-0.5.0-enable_V4Studio.patch
#PATCH-FIX-UPSTREAM i@marguerite.su - fix SVGGen ldflags
Patch2: gpac-0.5.0-SVGGen_abuild.patch
#PATCH-FIX-UPSTREAM wengxuetian@gmail.com - fix E: 64bit-portability-issue
Patch3: gpac-0.5.0-64bit-portability.patch
#PATCH-FIX-UPSTREAM i@marguerite.su - export functions x264 needs
Patch4: gpac-0.5.0-x264-export.patch
#PATCH-FIX-UPSTREAM obs@botter.cc - disable applications osmozilla, osmo4_wx
Patch10: gpac-0.5.0-disable-applications.patch
BuildRequires: DirectFB-devel
BuildRequires: ImageMagick
BuildRequires: Mesa-devel
BuildRequires: alsa-devel
BuildRequires: dos2unix
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: freeglut-devel
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
%if 0%{?suse_version} >= 1140
BuildRequires: libSDL-devel
%else
BuildRequires: SDL-devel
%endif
BuildRequires: liba52-devel
BuildRequires: libfaad-devel
BuildRequires: libffmpeg-devel
# fix for evergreen 11
%if 0%{?suse_version} == 1110
BuildRequires: libidl
%endif
BuildRequires: libjpeg-devel
BuildRequires: libmad-devel
BuildRequires: libogg-devel
BuildRequires: libpng-devel
BuildRequires: libpulse-devel
BuildRequires: librsvg-devel >= 2.5.0
BuildRequires: libtheora-devel
BuildRequires: libvorbis-devel
BuildRequires: libxvidcore-devel
%if 0%{?suse_version} == 1140
BuildRequires: mozilla-js192
%endif
%if 0%{?suse_version} > 1140
BuildRequires: js-devel
%endif
%if 0%{?suse_version} <= 1140
%if ! 0%{?sles_version}
BuildRequires: mozilla-xulrunner192-devel
%endif
%else
BuildRequires: xulrunner-devel
%endif
BuildRequires: libopenssl-devel
%if 0%{?suse_version} >= 1140
BuildRequires: pkgconfig(libopenjpeg)
%endif
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: unzip
BuildRequires: update-desktop-files
%if 0%{?suse_version} >= 1140
BuildRequires: wxWidgets-wxcontainer-devel
%else
BuildRequires: wxGTK-devel
%endif
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
GPAC is a multimedia framework for MPEG-4, VRML/X3D and SVG/SMIL.
GPAC is built upon an implementation of the MPEG-4 Systems standard
(ISO/IEC 14496-1) developed from scratch in C.
The main development goal is to provide a clean (a.k.a. readable by
as many people as possible), small and flexible alternative to the
MPEG-4 Systems reference software (known as IM1 and distributed in
ISO/IEC 14496-5).
The second development goal is to achieve integration of recent
multimedia standards (SVG/SMIL, VRML, X3D, SWF, etc) into a single
framework. This stage is still under drafting but GPAC already
supports most of VRML97, some X3D as well as very simple SVG.
GPAC already features 2D and 3D multimedia playback, MPEG-4 Systems
encoders/multiplexers and publishing tools for content distribution.
GPAC is licensed under the GNU Lesser General Public License.
The current GPAC release (0.4.5) already covers a very large part of
the MPEG-4 standard, and features what can probably be seen as the
most advanced and robust 2D MPEG-4 Player available worldwide, as
well as a decent 3D MPEG-4/VRML player.
Author: Jean Le Feuvre <jeanlf at users.sourceforge.net>
%package -n libgpac%{soname}
Summary: Shared libraries for gpac
Group: System/Libraries
%description -n libgpac%{soname}
Shared libraries for package gpac.
%package -n libgpac-devel
Summary: Development files for gpac
Group: Development/Languages/C and C++
Requires: libgpac%{soname} = %{version}
# old name
Provides: gpac-devel = %{version}
Obsoletes: gpac-devel < %{version}
%description -n libgpac-devel
Development files for gpac.
Author: Jean Le Feuvre <jeanlf@users.sourceforge.net>
%if ! %{wo_applications}
%package -n Osmo4
Summary: MPEG-4 Media player based on gpac
Group: Productivity/Multimedia/Video/Players
Requires: %{name} = %{version}
%description -n Osmo4
Osmo4 is an MPEG-4 player with the following features:
* MPEG-4 Systems player:
* Optimized 2D graphics renderer compliant with the Complete2D Scene
Graph and Graphics profiles.
* Video and audio presentation achieved through plugins
* Multimedia player features:
* Timeline controls: play, pause, step.
* Graphics features: antialising, zoom and pan, scalable resizing
of rendering area
* Support for Advanced Text and Graphics extension of MPEG-4 Systems
* Frame export to JPG, PNG, BMP.
Osmo4 enables the use of MPEG-4 Systems in a vast aplication domain,
among which:
* downloaded or streamed cartoons
* synchronized, interactive mixes of graphics, text, video and audio
* applications benefiting from MPEG-7 and MPEG-21 advances: meta-data,
encryption, watermarking, rights management
%if ! 0%{?sles_version}
%package browser-plugin
Summary: Osmozilla is a GPAC plugin for Mozilla-based browsers
Group: Productivity/Networking/Web/Utilities
Requires: %{name} = %{version}
%description browser-plugin
Osmozilla is a GPAC plugin for Mozilla-based browsers.
%endif
%endif
%prep
%setup -q
%if 0%{?suse_version} >= 1210
%if 0%{?xulrunner_version} >= 16
%patch0 -p1
%endif
%else
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%if %{wo_applications}
%patch10 -p1
%endif
# unpack amr files
install -dm 755 modules/amr_float_dec/amr_nb_ft
pushd modules/amr_float_dec/amr_nb_ft
unzip -q %{SOURCE1}
unzip -qj 26104-b00_ANSI_C_source_code.zip
popd
install -dm 755 modules/amr_float_dec/amr_wb_ft
pushd modules/amr_float_dec/amr_wb_ft
unzip -q %{SOURCE2}
unzip -qj 26204-b00_ANSI-C_source_code.zip
popd
# Fix encoding warnings
cp -p Changelog Changelog.origine
iconv -f ISO-8859-1 -t UTF8 Changelog.origine > Changelog
touch -r Changelog.origine Changelog
rm -rf Changelog.origine
cp -p doc/ipmpx_syntax.bt doc/ipmpx_syntax.bt.origine
iconv -f ISO-8859-1 -t UTF8 doc/ipmpx_syntax.bt.origine > doc/ipmpx_syntax.bt
touch -r doc/ipmpx_syntax.bt.origine doc/ipmpx_syntax.bt
rm -rf doc/ipmpx_syntax.bt.origine
%build
# regenerate plugin interface from IDL (see applications/osmozilla/readme.txt)
%if 0%{?suse_version} > 1140
pushd applications/osmozilla
chmod 666 nsIOsmozilla.xpt_linux; rm nsIOsmozilla.xpt_linux
chmod 666 nsIOsmozilla.h
chmod 666 nsIOsmozilla.idl
%define _IDL_DIR `pkg-config --variable=idldir libxul`
%define _SDK_DIR `pkg-config --variable=sdkdir libxul`
%{_SDK_DIR}/sdk/bin/header.py \
-I%{_IDL_DIR} \
-o nsIOsmozilla.h \
nsIOsmozilla.idl
%{_SDK_DIR}/sdk/bin/typelib.py \
-I%{_IDL_DIR} \
-o nsIOsmozilla.xpt \
nsIOsmozilla.idl
cp nsIOsmozilla.xpt nsIOsmozilla.xpt_linux
popd
%else
%if ! 0%{?sles_version}
pushd applications/osmozilla
chmod 666 nsIOsmozilla.xpt_linux; rm nsIOsmozilla.xpt_linux
chmod 666 nsIOsmozilla.h
chmod 666 nsIOsmozilla.idl
%define _IDL_DIR `pkg-config --variable=idldir libxul`
%define _INC_DIR `pkg-config --variable=includedir libxul`
%define _LIB_DIR `pkg-config --variable=libdir libxul`
%{_LIB_DIR}/xpidl \
-m header \
-I%{_IDL_DIR} \
-I%{_INC_DIR}/xpcom/idl \
nsIOsmozilla.idl
%{_LIB_DIR}/xpidl \
-m typelib \
-I%{_IDL_DIR} \
-I%{_INC_DIR}/xpcom/idl \
nsIOsmozilla.idl
%{_LIB_DIR}/xpt_link \
nposmozilla.xpt nsIOsmozilla.xpt
cp nsIOsmozilla.xpt nsIOsmozilla.xpt_linux
popd
%endif
%endif
# configure the beast
./configure \
--prefix=%{_prefix} \
%ifarch x86_64
--libdir=lib64 \
%endif
--mandir=%{_mandir} \
%if ! 0%{?sles_version}
--xulsdk-path=`pkg-config --variable=sdkdir libxul` \
%endif
%if %{wo_applications}
--disable-scenegraph \
%endif
--extra-cflags="%{optflags} -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -DXP_UNIX -fPIC"
# make the beast (NO parallel build possible ...)
# fix I: File is compiled without RPM_OPT_FLAGS gpac doesn't respect any flags at all
make all CFLAG="%{optflags}"
make sggen
make -C applications/generators/SVG
make -C applications/udptsseg
# create dev-docs
pushd doc
doxygen -u
doxygen
popd
%install
%make_install
# header files
make install-lib \
DESTDIR=%{buildroot}
%if ! %{wo_applications}
# browser-plugin
%if ! 0%{?sles_version}
install -dm 755 %{buildroot}%{_libdir}/browser-plugins
install -m 755 bin/gcc/nposmozilla.so \
%{buildroot}%{_libdir}/browser-plugins
install -m 755 bin/gcc/nposmozilla.xpt \
%{buildroot}%{_libdir}/browser-plugins
%endif
%endif
# generated sggen binaries
for i in MPEG4 SVG X3D; do
install -m 755 applications/generators/$i/${i}Gen \
%{buildroot}%{_bindir}
done
install -m 755 bin/gcc/mp4* \
%{buildroot}%{_bindir}
# udptsseg
install -m 755 bin/gcc/udptsseg \
%{buildroot}%{_bindir}
%if ! %{wo_applications}
# Osmo4
install -m 755 bin/gcc/Osmo4 \
%{buildroot}%{_bindir}
# icon
install -dm 755 %{buildroot}%{_datadir}/pixmaps
convert -size 48x48 applications/osmo4_wx/osmo4.xpm \
Osmo4.png
install -m 644 Osmo4.png \
%{buildroot}%{_datadir}/pixmaps
%endif
%if ! %{wo_applications}
# menu-entry
install -dm 755 %{buildroot}%{_datadir}/applications
cat > Osmo4.desktop << EOF
[Desktop Entry]
Comment=MPEG-4 Media player based on gpac
Name=Osmo4
GenericName=MPEG-4 Media player based on gpac
Type=Application
Exec=Osmo4
Icon=Osmo4
Terminal=false
EOF
%suse_update_desktop_file -i Osmo4 AudioVideo Player
%endif
# static lib
rm -rf %{buildroot}%{_libdir}/*.a
%fdupes %{buildroot}
%post -n libgpac%{soname} -p /sbin/ldconfig
%postun -n libgpac%{soname} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS BUGS Changelog COPYING README TODO
%doc doc/configuration.html
%{_bindir}/MP4Box
%if ! %{wo_applications}
%{_bindir}/MP4Client
%endif
%{_bindir}/MPEG4Gen
%{_bindir}/X3DGen
%{_bindir}/SVGGen
%{_bindir}/mp42ts
%{_bindir}/udptsseg
%{_libdir}/%{name}/
%{_datadir}/%{name}/
%{_mandir}/man1/*
%files -n libgpac%{soname}
%defattr(-,root,root)
%{_libdir}/*.so.%{soname}
%{_libdir}/*.so.%{soname}.*
%files -n libgpac-devel
%defattr(-,root,root)
%doc doc/CODING_STYLE doc/ipmpx_syntax.bt
%doc doc/html/*
%{_includedir}/%{name}/
%{_libdir}/*.so
%if ! %{wo_applications}
%files -n Osmo4
%defattr(-,root,root)
%{_bindir}/Osmo4
%{_datadir}/pixmaps/Osmo4.png
%{_datadir}/applications/Osmo4.desktop
%if ! 0%{?sles_version}
%files browser-plugin
%defattr(-,root,root)
%{_libdir}/browser-plugins/nposmozilla.*
%endif
%endif
%changelog