Blob Blame History Raw
%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')}
%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
%global python_ver %(%{__python} -c "import sys ; print sys.version[:3]")
%global python_sitelib  %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
%global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")

Name: kdebindings
Version: 4.0.0 
Release: 1%{?dist}
Summary: KDE bindings to non-C++ languages

Group: User Interface/Desktops
License: GPLv2
URL: http://developer.kde.org/language-bindings/
Source0: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/%{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Patch0: kdebindings-3.97.0-libsmokeqt-lib64.patch
Patch1: kdebindings-3.97.0-pykde4-lib64.patch

# FIXME/TODO: missing BRs (taken from CMakeCache.txt)
#QSCINTILLA_INCLUDE_DIR:PATH=QSCINTILLA_INCLUDE_DIR-NOTFOUND
#QSCINTILLA_LIBRARY:FILEPATH=QSCINTILLA_LIBRARY-NOTFOUND
# We currently only have Qt 3 QScintilla.

BuildRequires:  kde-filesystem >= 4
BuildRequires:  kdelibs4-devel >= %{version}
BuildRequires:  kdebase-workspace-devel >= %{version}
BuildRequires:  cmake
# FIMXE:TODO: disabled for now
#BuildRequires:  mono-core
BuildRequires:  python-devel
BuildRequires:  ruby-devel
BuildRequires:  ruby
BuildRequires:  giflib-devel
BuildRequires:  pcre-devel
# causes smokeqt to fail to build
#BuildRequires:  qwt-devel
BuildRequires:  sip-devel >= 4.7.1
BuildRequires:  PyQt4-devel >= 4.3.1

Requires: PyQt4

# FIXME/TODO: are there other explicit Requires?
Requires(post): /sbin/ldconfig 
Requires(postun): /sbin/ldconfig 
Requires: kdelibs4 >= %{version}
Requires: kdebase-workspace >= %{version}

%description
KDE bindings to non-C++ languages

%package devel
Group:    Development/Libraries
Summary:  Header files for %{name}
Requires: %{name} = %{version}-%{release}
Requires: kdelibs4-devel kdebase-workspace-devel PyQt4-devel
%description devel
Header files for developing applications using %{name}.

%prep
%setup -q
%patch0 -p1
%patch1 -p1


%build

mkdir -p %{_target_platform}
pushd %{_target_platform}
# FIXME/TODO: Get csharp to compile
%{cmake_kde4} -DRUBY_SITE_LIB_DIR=%{ruby_sitelib} -DRUBY_SITE_ARCH_DIR=%{ruby_sitearch} -DBUILD_csharp=OFF ..
popd

make %{?_smp_mflags} -C %{_target_platform}


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
make install DESTDIR=%{buildroot} -C %{_target_platform}

# move devel symlinks
mkdir -p %{buildroot}%{_kde4_libdir}/kde4/devel
pushd %{buildroot}%{_kde4_libdir}
for i in lib*.so
do
  case "$i" in
    libkdeinit4_*.so)
      ;;
    *)
      linktarget=`readlink "$i"`
      rm -f "$i"
      ln -sf "../../$linktarget" "kde4/devel/$i"
      ;;
  esac
done
popd


%clean
rm -rf %{buildroot}


%post
/sbin/ldconfig ||:

%postun
/sbin/ldconfig ||:


%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING COPYING.LIB NEWS README
%{_kde4_bindir}/*
%{_kde4_libdir}/*.so.*
%{ruby_sitelib}/KDE/
%{ruby_sitelib}/Qt.rb
%{ruby_sitelib}/Qt/
%{ruby_sitelib}/Qt3.rb
%{ruby_sitelib}/Qt4.rb
%{ruby_sitearch}/*.so
%{python_sitearch}/PyKDE4/
%{_kde4_appsdir}/pykde4/
%{_kde4_libdir}/kde4/*.so
%exclude %{_kde4_libdir}/kde4/devel/

%files devel
%defattr(-,root,root,-)
%{_includedir}/smoke.h
%{_kde4_datadir}/sip/PyKDE4/
%doc %{_kde4_docdir}/HTML/PyKDE4/
%{_kde4_libdir}/kde4/devel/*


%changelog
* Tue Jan 08 2008 Rex Dieter <rdieter[AT]fedoraproject.org> 4.0.0-1
- kde-4.0.0

* Thu Jan 03 2008 Kevin Kofler <Kevin@tigcc.ticalc.org> 3.97.0-8
- smoke.h is in %%{_includedir}, not %%{_kde4_includedir}

* Wed Dec 12 2007 Kevin Kofler <Kevin@tigcc.ticalc.org> 3.97.0-7
- rebuild for changed _kde4_includedir

* Tue Dec 11 2007 Kevin Kofler <Kevin@tigcc.ticalc.org> 3.97.0-6
- use patch to override PYTHON_SITE_PACKAGES_DIR (cmake -D doesn't work)

* Tue Dec 11 2007 Kevin Kofler <Kevin@tigcc.ticalc.org> 3.97.0-5
- override PYTHON_SITE_PACKAGES_DIR

* Tue Dec 11 2007 Kevin Kofler <Kevin@tigcc.ticalc.org> 3.97.0-4
- rewrite libsmokeqt-lib64 patch so it actually works
- add PyKDE4 files to file list
- specify minimum versions of sip-devel and PyQt4-devel
- require PyQt4 in main package, PyQt4-devel in -devel
- fix unowned Qt and KDE directories under ruby_sitelib

* Tue Dec 11 2007 Kevin Kofler <Kevin@tigcc.ticalc.org> 3.97.0-3
- omit BR: qwt-devel for now, causes build failure in smokeqt
- add BRs: sip-devel PyQt4-devel for PyKDE4

* Tue Dec 11 2007 Kevin Kofler <Kevin@tigcc.ticalc.org> 3.97.0-2
- remove X11 BRs now Required by kdelibs-devel
- add BR: qwt-devel
- fix libsmokeqt being in /usr/lib even on 64-bit arches
- use ruby_sitelib and ruby_sitearch properly

* Mon Dec 10 2007 Than Ngo <than@redhat.com> 3.97.0-1
- 3.97.0

* Sun Nov 18 2007 Sebastian Vahl <fedora@deadbabylon.de> 3.96.0-1
- Initial version for Fedora