File seed.spec of Package seed

#
# spec file for package seed
#
# Copyright (c) 2013 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 build_for_gtk3 1

%if %{build_for_gtk3}
%define _webkitver 3.0
%define _pkgsoname_suffix -gtk3-
%define _gtk_suffix -gtk3
%else
%define _webkitver 1.0
# empty:
#%%define _pkgsoname_suffix
#%%define _gtk_suffix
%endif

# We do not add dependencies from the language extensions: those will only be
# used if the typelibs are used by the app and therefore already installed.
# We also don't need dependencies for the doc.
%define __requires_exclude_from %{_datadir}/seed%{?_gtk_suffix}/extensions/.*.js|%{_datadir}/doc/seed/.*

Name:           seed
%define _name   seed
Version:        3.8.1
Release:        0
Summary:        JavaScript bindings based on gobject-introspection and WebKit
License:        LGPL-2.1+
Group:          Development/Libraries/GNOME
Url:            http://live.gnome.org/Seed
Source:         http://download.gnome.org/sources/seed/3.8/%{_name}-%{version}.tar.xz
BuildRequires:  cairo-devel
BuildRequires:  dbus-1-glib-devel
BuildRequires:  gnome-js-common
BuildRequires:  gobject-introspection-devel
BuildRequires:  intltool
BuildRequires:  libffi-devel
BuildRequires:  libxml2-devel
%if %{build_for_gtk3}
BuildRequires:  gtk3-devel
BuildRequires:  libwebkitgtk3-devel
%else
BuildRequires:  gtk2-devel
BuildRequires:  libwebkitgtk-devel
%endif
BuildRequires:  mpfr-devel
BuildRequires:  readline-devel
BuildRequires:  sqlite3-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Seed is a library and interpreter, dynamically bridging (through
gobject-introspection) the WebKit JavaScriptCore engine with the GObject type
system. In a more concrete sense, Seed enables you to immediately write
applications around a significant portion of the GNOME platform, and easily
embed JavaScript as a scripting language in your GObject library.

%if %{build_for_gtk3}

%package doc
Summary:        JavaScript bindings based on gobject-introspection and WebKit
Group:          Development/Libraries/GNOME
Requires:       %{name} = %{version}

%description doc
Seed is a library and interpreter, dynamically bridging (through
gobject-introspection) the WebKit JavaScriptCore engine with the GObject type
system. In a more concrete sense, Seed enables you to immediately write
applications around a significant portion of the GNOME platform, and easily
embed JavaScript as a scripting language in your GObject library.
%endif

%package -n libseed%{?_pkgsoname_suffix}0
Summary:        JavaScript bindings based on gobject-introspection and WebKit
Group:          System/Libraries
Recommends:     gnome-js-common
%if ! %{build_for_gtk3}
Provides:       libseed-0 = %{version}
Obsoletes:      libseed-0 < %{version}
%endif

%description -n libseed%{?_pkgsoname_suffix}0
Seed is a library and interpreter, dynamically bridging (through
gobject-introspection) the WebKit JavaScriptCore engine with the GObject type
system. In a more concrete sense, Seed enables you to immediately write
applications around a significant portion of the GNOME platform, and easily
embed JavaScript as a scripting language in your GObject library.

%package -n libseed%{?_gtk_suffix}-devel
Summary:        JavaScript bindings based on gobject-introspection and WebKit
Group:          Development/Libraries/GNOME
Requires:       libseed%{?_pkgsoname_suffix}0 = %{version}
# Just a helper provides
Provides:       seed-devel
# The pkg-config filename is the same, so there's a conflict between the GTK+ 2
# and GTK+ 3 devel packages
Conflicts:      otherproviders(seed-devel)

%description -n libseed%{?_gtk_suffix}-devel
Seed is a library and interpreter, dynamically bridging (through
gobject-introspection) the WebKit JavaScriptCore engine with the GObject type
system. In a more concrete sense, Seed enables you to immediately write
applications around a significant portion of the GNOME platform, and easily
embed JavaScript as a scripting language in your GObject library.

%prep
%setup -q -n %{_name}-%{version}

%build
%configure \
	--disable-static \
        --with-webkit=%{_webkitver} \
        --enable-debug
%__make %{?jobs:-j%jobs}

%install
%makeinstall
find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
%if ! %{build_for_gtk3}
# remove seed binary: the GTK+ 2 and GTK+ 3 versions are conflicting
rm %{buildroot}%{_bindir}/seed
rm %{buildroot}%{_mandir}/man?/seed.*
rm -r %{buildroot}%{_datadir}/doc/seed
%endif

%clean
rm -rf %{buildroot}

%post -n libseed%{?_pkgsoname_suffix}0 -p /sbin/ldconfig

%postun -n libseed%{?_pkgsoname_suffix}0 -p /sbin/ldconfig

%if %{build_for_gtk3}

%files
%defattr(-,root,root)
%{_bindir}/seed
%{_mandir}/man?/seed.*

%files doc
%defattr(-,root,root)
%doc %{_datadir}/doc/seed
%endif

%files -n libseed%{?_pkgsoname_suffix}0
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING README
%{_datadir}/seed%{?_gtk_suffix}
%{_libdir}/*.so.*
%dir %{_libdir}/seed%{?_gtk_suffix}
%{_libdir}/seed%{?_gtk_suffix}/*.so

%files -n libseed%{?_gtk_suffix}-devel
%defattr(-,root,root)
%{_includedir}/seed%{?_gtk_suffix}/
%{_libdir}/*.so
# If the file becomes versioned, we can remove the Conflicts between seed-devel
# providers
%{_libdir}/pkgconfig/seed.pc
# Own these repositories to not depend on gtk-doc while building:
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%doc %{_datadir}/gtk-doc/html/seed

%changelog
openSUSE Build Service is sponsored by