%global ruby_vendorlib %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]')
%global ruby_vendorarch %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorarchdir"]')

Name:    korundum
Summary:  Ruby bindings for KDE
Summary(ja): KDE の Ruby バインディング
Version: 4.14.3
Release: 1%{?_dist_release}

License: LGPLv2+ and GPLv2+
Group:   System Environment/Libraries
URL:     https://techbase.kde.org/Development/Languages/Ruby

Source0: http://download.kde.org/stable/%{version}/src/%{name}-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: cmake
BuildRequires: akonadi-devel
BuildRequires: kate-devel >= %{version}
BuildRequires: kdelibs4-devel >= %{version} 
BuildRequires: kdepimlibs-devel >= %{version}
BuildRequires: okular-devel >= %{version}
BuildRequires: QtRuby-devel >= %{version}
BuildRequires: ruby-devel >= 1.8
BuildRequires: shared-desktop-ontologies-devel
BuildRequires: smokekde-devel >= %{version}
BuildRequires: smokeqt-devel >= %{version}
BuildRequires: soprano-devel

Requires: QtRuby >= %{version}
Requires: smokekde >= %{version}
Requires: smokeqt >= %{version}

%description
%{summary}.

%package devel
Summary: Development libraries for %{name} 
Summary(ja): %{name} の開発用ファイル 
Group:   Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
%{summary}.


%prep
%setup -q 


%build
mkdir -p %{_target_platform}
pushd %{_target_platform}

%cmake \
    -DCMAKE_BUILD_TYPE=release \
    -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
    -DDATA_INSTALL_DIR:PATH=%{_datadir}/kde4/apps \
    -DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/kde4 \
    -DLIBEXEC_INSTALL_DIR:PATH=%{_libexecdir}/kde4 \
    -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
    -DCUSTOM_RUBY_SITE_ARCH_DIR:PATH=%{ruby_vendorarch} \
    -DCUSTOM_RUBY_SITE_LIB_DIR:PATH=%{ruby_vendorlib} \
    ..
popd

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


%install
rm -rf $RPM_BUILD_ROOT
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}


%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files 
%defattr(-,root,root,-)
%doc AUTHORS COPYING COPYING.LIB README
%{_bindir}/krubyapplication
%{ruby_vendorlib}/KDE/
%{ruby_vendorlib}/akonadi/
%{ruby_vendorlib}/khtml/
%{ruby_vendorlib}/kio/
%{ruby_vendorlib}/ktexteditor/
%{ruby_vendorlib}/okular/
%{ruby_vendorlib}/solid/
%{ruby_vendorlib}/soprano/
%{ruby_vendorlib}/nepomuk/
%{ruby_vendorarch}/akonadi.so
%{ruby_vendorarch}/kate.so
%{ruby_vendorarch}/khtml.so
%{ruby_vendorarch}/kio.so
%{ruby_vendorarch}/korundum4.so
%{ruby_vendorarch}/ktexteditor.so
%{ruby_vendorarch}/okular.so
%{ruby_vendorarch}/plasma_applet.so
%{ruby_vendorarch}/solid.so
%{ruby_vendorarch}/soprano.so
%{ruby_vendorarch}/nepomuk.so
%{_libdir}/kde4/krubypluginfactory.so
%{_datadir}/applications/kde4/dbpedia_references.desktop
%{_datadir}/kde4/apps/dbpedia_references
%{_datadir}/kde4/apps/plasma_applet_ruby_clock/
%{_datadir}/kde4/apps/plasma_ruby_digital_clock/
%{_datadir}/kde4/services/*.desktop

%files devel
%defattr(-,root,root,-)
%{_bindir}/rbkconfig_compiler4

%changelog
* Sun Jan 11 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 4.14.3-1
- updated to 4.14.3
- built with okluar-libs 4.14.3

* Wed Nov 12 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 4.12.5-2
- installed modules to vendor_ruby

* Sun Nov  9 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 4.12.5-1
- splitted from kdebindings

* Thu Jun 16 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.4-1
- new upstream release

* Thu Apr 14 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.1-1
- updated to 4.6.1
- added BR: kdesdk-devel
- disabled attica plugins temporaly
- rebuilt with mono-2.10.1

* Sun Sep 26 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.5.1-2
- rebuilt with rpm-4.8.1 for pkg-config

* Sat Sep 18 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.5.1-1
- new upstream release
- added Patch50
- added more japanese summaries

* Tue Aug 17 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.5.0-1
- new upstream release

* Sun Jul  4 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.4.5-1
- new upstream release

* Fri May  7 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.4.3-1
- new upstream release

* Thu Apr 15 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.4.2-1
- new upstream release

* Tue Mar  9 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.4.1-1
- new upstream release
- added -DCMAKE_SKIP_RPATH:BOOL=OFF option to cmake
  (see https://bugs.kde.org/show_bug.cgi?id=214824)
- built with new toolchain

* Wed Nov 25 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.3.3-1
- new upstream release

* Thu Oct 29 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.3.2-4
- merged 4.3.1-2 %changelog 
- re-define %%{mono_dir} to %{_prefix}/lib/mono (again)

* Tue Oct 27 2009 Shu KONNO <owa@bg.wakwak.com> 4.3.2-3
- use %%{_prefix}/lib for mono-dll (for x86_64)

* Tue Oct 27 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.3.2-2
- new upstream release
- built with PyQt4-4.6

* Sun Sep 06 2009 NAKAMURA Kenta <kenta@vinelinux.org> 4.3.1-2
- define %%{mono_dir} to specify mono library install path

* Sun Sep  6 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.3.1-1
- new upstream release
- fixed ruby modules installation path

* Thu Aug 20 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.3.0-1
- new upstream release
- spilt sub package based on Fedora

* Mon May 11 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.5.8-1
- applied new versioning policy
- added Patch1 
  (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=484191)

* Fri Nov 23 2007 NAKAMURA Kenta <kenta@vinelinux.org> 3.5.8-0vl3
- added --with-qt-libraries option

* Mon Oct 29 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.8-0vl2
- rebuild for VineSeed

* Mon Oct 29 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.8-0vl1
- new upstream release

* Mon Jun 25 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.7-0vl2
- rebuild for VineSeed

* Thu May 31 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.7-0vl1
- new upstream release
- update Patch0
- drop Patch1

* Mon Jan 29 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.6-0vl1
- new upstream release
- add Patch1
- add --enable-libsuffix option

* Tue Oct  3 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.5-0vl2
- rebuild for VineSeed

* Tue Oct  3 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.5-0vl1
- new upstream release

* Wed Aug  2 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.4-0vl2
- rebuild for VineSeed

* Wed Aug  2 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.4-0vl1
- new upstream release

* Thu Jun  1 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.3-0vl2
- rebuild for VineSeed

* Thu Jun  1 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.3-0vl1
- new upstream release

* Wed Mar 22 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.2-0vl2
- rebuild for VineSeed

* Wed Mar 22 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.2-0vl1
- new upstream release

* Wed Feb  1 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.1-0vl2
- rebuild for VineSeed

* Wed Feb  1 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 3.5.1-0vl1
- new upstream release
- renew BuildPrereq and build section
- renew %%files
- enable python
- change spec to make main and devel package
- add BuildPrereq: ruby ruby-devel
- add Patch0 to install ruby-bindings under /usr/lib/ruby

* Sun Mar 17 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 2.2.2-1vl1
- build for VineSeed
- disable python and mozilla
- objprelink (i386 only)

* Wed Nov 21 2001 Than Ngo <than@redhat.com> <bero@redhat.com> 2.2.2-1
- 2.2.2
- build kmozilla binding only on x86/alpha

* Thu Aug  9 2001 Bernhard Rosenkraenzer <bero@redhat.com> 2.2-2
- Make sure %%{name}-kmozilla isn't built on ia64

* Mon Jul 23 2001 Bernhard Rosenkraenzer <bero@redhat.com> 2.2-0.cvs20010723.2
- Move python bindings to separate package
- Add perl bindings
- Shut up rpmlint

* Wed Feb 21 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.1

* Sun Jan 28 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- initial RPM
