File mono-kde4.spec of Package kdebindings4

#
# spec file for package mono-kde4
#
# Copyright (c) 2011 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 is_mono 1
%define is_python 0
%define is_ruby 0
%define is_perl 0
%define is_base 0
%define is_generator 0

Name:           mono-kde4
License:        LGPLv2.1+
Group:          Development/Libraries/KDE
%if ! %is_generator
Summary:        Smoke stand-alone generator for bindings for KDE 4.x libraries
%else
Summary:        Smoke stand-alone generator for bindings for KDE 4.x libraries
%endif
Version:        4.6.0
Release:        1
Source0:        kdebindings-%{version}.tar.bz2
BuildRequires:  mono-devel monodoc okular-devel
BuildRequires:  libQtWebKit-devel
BuildRequires:  libattica-devel
BuildRequires:  libkdepimlibs4-devel
BuildRequires:  libqimageblitz-devel
BuildRequires:  libsoprano-devel
BuildRequires:  soprano-backend-redland
BuildRequires:  sqlite-devel
BuildRequires:  libkde4-devel = %{version}
%if 0%{?suse_version} > 1020
BuildRequires:  libjasper-devel
%else
BuildRequires:  libjasper
%endif
%if %is_mono
%if 0%{?suse_version} > 1130
BuildRequires:  libmono-2_0-devel
%endif
%endif
# PATCH-UPSTREAM -- Generated from SVN
Patch0:         4_6_BRANCH.diff
%if %is_python
# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
Patch1:         pykde4_fix_pykdeuic4.patch
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %is_base
%define debug_package_requires libsmoke2 = %{version}-%{release}
%endif
%if %is_python
%requires_eq python-qt4
%requires_eq python-sip
%requires_eq libkde4
%py_requires
%endif
%if %is_ruby
%requires_eq ruby-qt4
%kde4_runtime_requires
%kde4_akonadi_requires
%endif
%if %is_perl
Requires:       perl-base = %{perl_version}
%endif

%if %is_mono
Requires:       mono-qt = %version
%endif

%description

%if %is_base

%package -n libsmoke2
License:        LGPLv2.1+
Summary:        Bindings for KDE 4.x libraries
Group:          Development/Libraries/KDE

%description -n libsmoke2

%package -n libsmoke-devel
License:        LGPLv2.1+
Summary:        Bindings for KDE 4.x libraries
Group:          Development/Libraries/KDE
Requires:       libsmoke2 = %{version}

%description -n libsmoke-devel

%endif

%if %is_ruby

%package -n ruby-qt4
License:        LGPLv2.1+
Summary:        Bindings for Qt4 libraries
Group:          Development/Libraries/KDE

%description -n ruby-qt4

%package -n ruby-qt4-devel
License:        LGPLv2.1+
Summary:        Development files for Qt4 libraries Ruby bindings
Group:          Development/Libraries/KDE
Requires:       ruby-qt4 = %{version}

%description -n ruby-qt4-devel

%endif

%if %is_mono

%package -n libqyoto2
License:        LGPLv2.1+
Summary:        Bindings for Qt4 libraries
Group:          Development/Libraries/KDE

%description -n libqyoto2
Shared library for the Mono bindings for the Qt4 toolkit.

%package -n mono-qt
License:        LGPLv2.1+
Summary:        Bindings for Qt4 libraries
Group:          Development/Libraries/KDE
Requires:       libqyoto2 = %{version}

%description -n mono-qt
This package contains Mono bindings for the Qt4 toolkit.

%package -n mono-qt-devel
License:        LGPLv2.1+
Summary:        Bindings for KDE 4.x libraries
Group:          Development/Libraries/KDE
Requires:       mono-qt = %{version}

%description -n mono-qt-devel
This package contains development files for the Mono bindings for the Qt4 toolkit.

%endif

%if %is_python

%package devel
License:        LGPLv2.1+
Summary:        Bindings for KDE 4.x libraries
Group:          Development/Libraries/KDE
Requires:       python-kde4 = %{version}
Requires:       python-qt4-devel

%description devel
This package contains development files for the Python bindings for KDE4.

%endif

%prep
%setup -q -n kdebindings-%{version}
%patch0 -p0
%if %is_python
%patch1 -p0
%endif

%build
  rm -rf xparts php
%if %is_base
  rm -rf perl java ruby python csharp
%endif
%if %is_python
  rm -rf perl java ruby csharp
%endif
%if %is_perl
  rm -rf python java ruby csharp
  EXTRA_FLAGS="-DCUSTOM_PERL_SITE_ARCH_DIR=`perl -MConfig -e 'print $Config{vendorarch}'`"
%endif
%if %is_ruby
  rm -rf perl java python csharp
  sed -i -r -e 's,add_subdirectory\( examples\),,' ruby/korundum/CMakeLists.txt
%endif
%if %is_mono
  rm -rf perl java python ruby
  sed -i -r -e 's,add_subdirectory\( examples\),,' csharp/kimono/CMakeLists.txt
%endif
%if %is_generator
  cd generator
%endif
  %cmake_kde4 -d build -- -DENABLE_SMOKEKDEVPLATFORM=OFF -DENABLE_PHONON_SMOKE=OFF $EXTRA_FLAGS
  %make_jobs

%install
  cd build
  %makeinstall

%if !%is_base
  rm -rf $RPM_BUILD_ROOT/%_bindir/smokeapi
  rm -rf $RPM_BUILD_ROOT/%_libdir/smokegen
  rm -rf $RPM_BUILD_ROOT/%_libdir/libsmoke*
  rm -rf $RPM_BUILD_ROOT/usr/include/smoke.h
  rm -rf $RPM_BUILD_ROOT/usr/include/smoke
  rm -rf $RPM_BUILD_ROOT/usr/include/smokegen
  rm -rf $RPM_BUILD_ROOT/usr/share/smokegen
%if !%is_generator
  rm -rf $RPM_BUILD_ROOT/%_libdir/libcppparser.so
  rm -rf $RPM_BUILD_ROOT/usr/bin/smokegen
%endif
%endif

%if %is_ruby
  rm -rf $RPM_BUILD_ROOT/usr/share/applications/kde4/dbpedia_references.desktop
%kde_post_install

%post -n ruby-kde4 -p /sbin/ldconfig

%postun -n ruby-kde4 -p /sbin/ldconfig

%post -n ruby-qt4 -p /sbin/ldconfig

%postun -n ruby-qt4 -p /sbin/ldconfig

%endif

%if %is_perl

%post -n perl-kde4 -p /sbin/ldconfig

%postun -n perl-kde4 -p /sbin/ldconfig
%endif

%if %is_base

%post -n libsmoke2 -p /sbin/ldconfig

%postun -n libsmoke2  -p /sbin/ldconfig
%endif

%if %is_mono

%post -n libqyoto2 -p /sbin/ldconfig

%postun -n libqyoto2 -p /sbin/ldconfig
%endif

%clean
rm -rf %{buildroot}

%if %is_base

%files -n libsmoke2
%defattr(-,root,root)
%dir %_kde4_libdir/smokegen
%_kde4_libdir/libsmokeakonadi.so.*
%_kde4_libdir/libsmokeattica.so.*
#%_kde4_libdir/libsmokekde.so.*
#%_kde4_libdir/libsmokeqt.so.*
%_kde4_libdir/libsmokebase.so.*
%_kde4_libdir/libsmokeqt3support.so.*
%_kde4_libdir/libsmokeqt3support.so.*
%_kde4_libdir/libsmokekhtml.so.*
%_kde4_libdir/libsmokektexteditor.so.*
%_kde4_libdir/libsmokeqtuitools.so.*
%_kde4_libdir/libsmokeqtwebkit.so.*
%_kde4_libdir/libsmokesolid.so.*
%_kde4_libdir/libsmokenepomuk.so.*
%_kde4_libdir/libsmokenepomukquery.so.*
%_kde4_libdir/libsmokeqtscript.so.*
%_kde4_libdir/libsmokesoprano*.so.*
%_kde4_libdir/libsmokeplasma.so.*
%_kde4_libdir/libsmokephonon.so.*
%_kde4_libdir/libsmokeqttest.so.*
%_kde4_libdir/libsmokeqimageblitz.so.*
%_kde4_libdir/libsmokeokular.so.*
%_kde4_libdir/libsmokeqtcore.so.*
%_kde4_libdir/libsmokeqtgui.so.*
%_kde4_libdir/libsmokeqtnetwork.so.*
%_kde4_libdir/libsmokeqtdbus.so.*
%_kde4_libdir/libsmokeqtopengl.so.*
%_kde4_libdir/libsmokeqtsql.so.*
%_kde4_libdir/libsmokeqtsvg.so.*
%_kde4_libdir/libsmokeqtxml.so.*
%_kde4_libdir/libsmokeqtxmlpatterns.so.*
%_kde4_libdir/libsmokekdecore.so.*
%_kde4_libdir/libsmokekdeui.so.*
%_kde4_libdir/libsmokekfile.so.*
%_kde4_libdir/libsmokekio.so.*
%_kde4_libdir/libsmokeknewstuff2.so.*
%_kde4_libdir/libsmokeknewstuff3.so.*
%_kde4_libdir/libsmokekparts.so.*
%_kde4_libdir/libsmokekutils.so.*
%_kde4_libdir/libsmokeqtmultimedia.so.*
#%_kde4_libdir/libsmokekdevplatform.so.*
%_kde4_libdir/libsmokeqtdeclarative.so.*
%_kde4_libdir/libsmokeqthelp.so.*

%files -n libsmoke-devel
%defattr(-,root,root)
%_kde4_libdir/libcppparser.so
%_kde4_bindir/smokeapi
%_kde4_bindir/smokegen
%{_includedir}/smoke*
%_kde4_libdir/libsmoke*.so
%_kde4_libdir/smokegen/generator_smoke.so
%_kde4_libdir/smokegen/generator_dump.so
%dir %{_datadir}/smokegen
%{_datadir}/smokegen/kde-config.xml
%{_datadir}/smokegen/qt-config.xml
%{_datadir}/smokegen/qtdefines
%endif

%if %is_python

%files devel
%defattr(-,root,root)
%_kde4_appsdir/pykde4/examples
%{_datadir}/sip/PyKDE4

%files
%defattr(-,root,root)
%_kde4_modulesdir/krosspython.so
%py_sitedir/PyKDE4
%exclude %_kde4_appsdir/pykde4/examples
%_kde4_appsdir/pykde4
%_kde4_modulesdir/kpythonpluginfactory.so
%_kde4_bindir/pykdeuic4
%_kde4_libdir/python*/site-packages/PyQt4/uic/widget-plugins
%_kde4_libdir/python*/site-packages/PyQt4/uic/pykdeuic4.*
%endif

%if %is_ruby

%files
%defattr(-,root,root)
%_kde4_modulesdir/krossruby.so
%_kde4_modulesdir/krubypluginfactory.so
%_kde4_libdir/ruby/site_ruby/*/akonadi
%_kde4_libdir/ruby/site_ruby/*/*-linux/akonadi.so
%_kde4_libdir/ruby/site_ruby/*/KDE
%_kde4_libdir/ruby/site_ruby/*/*-linux/khtml.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/korundum4.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/ktexteditor.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/solid.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/nepomuk.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/okular.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/kio.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/phonon.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/soprano.so
%_kde4_libdir/ruby/site_ruby/*/khtml
%_kde4_libdir/ruby/site_ruby/*/nepomuk
%_kde4_libdir/ruby/site_ruby/*/ktexteditor
%_kde4_libdir/ruby/site_ruby/*/solid
%_kde4_libdir/ruby/site_ruby/*/soprano
%_kde4_libdir/ruby/site_ruby/*/*-linux/plasma_applet.so
%_kde4_libdir/ruby/site_ruby/*/okular
%_kde4_libdir/ruby/site_ruby/*/kio
%_kde4_libdir/ruby/site_ruby/*/phonon
%_kde4_appsdir/dbpedia_references
%_kde4_bindir/krubyapplication
%_kde4_bindir/rbkconfig_compiler4
%_kde4_libdir/kde4/krossruby.so

%files -n ruby-qt4
%defattr(-,root,root)
%_kde4_libdir/libqtruby4shared.so.*
%_kde4_libdir/ruby/site_ruby/*/*-linux/qtruby4.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/qtuitools.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/qtwebkit.so
%_kde4_libdir/ruby/site_ruby/*/Qt
%_kde4_libdir/ruby/site_ruby/*/Qt3.rb
%_kde4_libdir/ruby/site_ruby/*/Qt4.rb
%_kde4_libdir/ruby/site_ruby/*/Qt.rb
%_kde4_libdir/ruby/site_ruby/*/*-linux/qtscript.so
%_kde4_libdir/ruby/site_ruby/*/*-linux/qtdeclarative.so
%_kde4_libdir/ruby/site_ruby/*/qtdeclarative
%_kde4_libdir/ruby/site_ruby/*/qtscript
%_kde4_libdir/ruby/site_ruby/*/qtuitools
%_kde4_libdir/ruby/site_ruby/*/qtwebkit
%_kde4_libdir/ruby/site_ruby/*/*-linux/qttest.so
%_kde4_libdir/ruby/site_ruby/*/qttest
%_kde4_bindir/rbqtapi

%files -n ruby-qt4-devel
%defattr(-,root,root)
%_kde4_libdir/libqtruby4shared.so
%_kde4_bindir/rbrcc
%_kde4_bindir/rbuic4
%_kde4_includedir/qtruby
%endif

%if %is_mono

%files -n libqyoto2
%defattr(-,root,root)
%_kde4_libdir/libqyoto.so.*

%files -n mono-qt
%defattr(-,root,root)
%{_prefix}/lib/mono/gac/phonon
%{_prefix}/lib/mono/gac/qt-dotnet
%{_prefix}/lib/mono/gac/qtscript
%{_prefix}/lib/mono/gac/qttest
%{_prefix}/lib/mono/gac/qtuitools
%{_prefix}/lib/mono/gac/qtwebkit
%{_prefix}/lib/mono/gac/qimageblitz
%{_prefix}/lib/mono/qyoto/q*.dll
%_kde4_libdir/libphonon-sharp.so
%_kde4_libdir/libqtscript-sharp.so
%_kde4_libdir/libqyoto.so
%_kde4_libdir/libqttest-sharp.so
%_kde4_libdir/libqtuitools-sharp.so
%_kde4_libdir/libqtwebkit-sharp.so
%_kde4_libdir/libqimageblitz-sharp.so

%files -n mono-qt-devel
%defattr(-,root,root)
%_kde4_bindir/csrcc
%_kde4_bindir/uics
%{_includedir}/qyoto
%_kde4_libdir/pkgconfig/qyoto.pc
%_kde4_libdir/pkgconfig/qtwebkit-sharp.pc
%_kde4_libdir/pkgconfig/qttest-sharp.pc
%_kde4_libdir/pkgconfig/qtuitools-sharp.pc
%_kde4_libdir/pkgconfig/qtscript-sharp.pc

%files
%defattr(-,root,root)
%dir %{_prefix}/lib/mono/qyoto
%{_prefix}/lib/mono/gac/akonadi
%{_prefix}/lib/mono/gac/kde-dotnet
%{_prefix}/lib/mono/gac/khtml-dll
%{_prefix}/lib/mono/gac/ktexteditor-dotnet
%{_prefix}/lib/mono/gac/nepomuk-dll
%{_prefix}/lib/mono/gac/plasma-dll
%{_prefix}/lib/mono/gac/soprano
%{_prefix}/lib/mono/qyoto/phonon.dll
%{_prefix}/lib/mono/qyoto/akonadi.dll
%{_prefix}/lib/mono/qyoto/kde-dotnet.dll
%{_prefix}/lib/mono/qyoto/khtml-dll.dll
%{_prefix}/lib/mono/qyoto/ktexteditor-dotnet.dll
%{_prefix}/lib/mono/qyoto/plasma-dll.dll
%{_prefix}/lib/mono/qyoto/soprano.dll
%{_prefix}/lib/mono/qyoto/nepomuk-dll.dll
%_kde4_modulesdir/kimonopluginfactory.so
%_kde4_libdir/libakonadi-sharp.so
%_kde4_libdir/libkhtml-sharp.so
%_kde4_libdir/libkimono.so
%_kde4_libdir/libktexteditor-sharp.so
%_kde4_libdir/libnepomuk-sharp.so
%_kde4_libdir/libplasma-sharp.so
%_kde4_libdir/libsoprano-sharp.so
%{_datadir}/kde4/apps/plasma_scriptengine_kimono
%{_datadir}/kde4/services/plasma-scriptengine-kimono-applet.desktop
%{_datadir}/kde4/services/plasma-scriptengine-kimono-dataengine.desktop

%if 0

%files -n mono-kde4-examples
%defattr(-,root,root)
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/applets/analog-clock/csharp-analog-clock/contents/code/main
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/applets/analog-clock/csharp-analog-clock/contents/code/plasmaclock.dll
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/applets/analog-clock/csharp-analog-clock/metadata.desktop
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/applets/tiger/csharp-tiger/contents/code/main
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/applets/tiger/csharp-tiger/contents/images/tiger.svg
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/applets/tiger/csharp-tiger/metadata.desktop
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/dataengines/time/csharp-time/contents/code/main
%{_prefix}/src/packages/BUILD/kdebindings-4.2.0/build/csharp/plasma/examples/dataengines/time/csharp-time/metadata.desktop
%endif
%endif

%if %is_perl

%files
%defattr(-,root,root)
%_kde4_bindir/prcc4_bin
%_kde4_bindir/qdbusxml2perl
%_kde4_bindir/puic4
%_kde4_modulesdir/kperlpluginfactory.so
%{_prefix}/lib/perl5/vendor_perl/*/*/KDE*.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KIO4.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Plasma4.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Qt*.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/QtCore4
%{_prefix}/lib/perl5/vendor_perl/*/*/auto/*
%{_prefix}/lib/perl5/vendor_perl/*/*/Akonadi.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Attica.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KFile.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KHTML.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KNewStuff2.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KNewStuff3.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KParts.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KTextEditor.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/KUtils.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Nepomuk.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/NepomukQuery.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Okular.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Phonon.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/QImageBlitz.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Solid.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/Soprano.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/SopranoClient.pm
%{_prefix}/lib/perl5/vendor_perl/*/*/SopranoServer.pm
%endif

%changelog
openSUSE Build Service is sponsored by