File lightspark.spec of Package lightspark

# spec file for package lightspark
# 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

%bcond_with ffmpeg

Name:           lightspark
Version:        0.5.7
Release:        0
Summary:        Modern, free, open-source flash player implementation
License:        LGPL-3.0+
Group:          Productivity/Multimedia/Other
# PATCH-FIX-UPSTREAM lightspark-0.5.7-underlinking.patch lp#1000818 -- Link against GTK
Patch0:         lightspark-0.5.7-underlinking.patch
# PATCH-FIX-UPSTREAM lightspark-0.5.7-llvm_31.patch lp#980464 -- Fix build with LLVM 3.1. Took from GIT
Patch1:         lightspark-0.5.7-llvm_31.patch
# PATCH-FIX-UPSTREAM lightspark-0.5.7-ffmpeg_011.patch lp#1005534 -- Fix build with ffmpeg 0.11. Already in GIT
Patch2:         lightspark-0.5.7-ffmpeg_011.patch
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  gettext-tools
BuildRequires:  hicolor-icon-theme
BuildRequires:  libjpeg-devel
BuildRequires:  llvm-devel
BuildRequires:  nasm
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(gdk-2.0)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(glibmm-2.4)
BuildRequires:  pkgconfig(gmodule-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libpcre)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libxml++-2.6)
BuildRequires:  pkgconfig(pango)
BuildRequires:  pkgconfig(pangocairo)
BuildRequires:  pkgconfig(x11)
%if %{with ffmpeg}
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
Recommends:     %{_bindir}/gnash

Lightspark is a modern, free, open-source flash player implementation.

%package plugin
Summary:        NPAPI plugin for lightspark
Group:          Productivity/Multimedia/Other
Requires:       %{name} = %{version}
Enhances:       browser(npapi)

%description plugin
NPAPI plugin for lightspark.

%setup -q

export CFLAGS='%{optflags}'
export CXXFLAGS='%{optflags}'
mkdir build
cd build
      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
      -DLIB_SUFFIX=$(echo %{_lib} | cut -b4-) \
      -DCMAKE_BUILD_TYPE=RelWithDebugInfo \
      -DPLUGIN_DIRECTORY=%{_libdir}/browser-plugins \
      -DENABLE_LIBAVCODEC=%{?with_ffmpeg:YES}%{!?with_ffmpeg:NO} ..
make %{?_smp_mflags}

cd build
cd ..
%find_lang %{name}
rm -f %{buildroot}%{_libdir}/%{name}/lib%{name}.so
# Not in hicolor theme (lp#1000840)
rm -rf %{buildroot}%{_datadir}/icons/hicolor/20x20



%files -f %{name}.lang
%config(noreplace) %{_sysconfdir}/xdg/lightspark.conf
%attr(0755,root,root) %{_bindir}/lightspark
%attr(0755,root,root) %{_bindir}/tightspark

%files plugin