%define kde KDE4

Name:           kdevplatform
Summary:        Libraries for use by %{kde} development tools
Summary(ja):    %{kde} 開発ツールが使用するライブラリ
Version:        1.7.0
Release:        1%{?_dist_release}

Group:          Development/Tools
License:        GPLv2
URL:            http://www.kdevelop.org/

Source0:        ftp://ftp.kde.org/pub/kde/stable/kdevelop/4.7.0/src/kdevplatform-%{version}.tar.xz

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
BuildRequires:  libboost-devel
BuildRequires:  gettext
BuildRequires:  kdelibs-devel >= 4.6
BuildRequires:  kdesdk-devel >= 4.6
BuildRequires:  pcre-devel
BuildRequires:  subversion-devel
BuildRequires:  apr-util-devel
BuildRequires:  soprano-devel
BuildRequires:  qjson-devel
BuildRequires:  grantlee-devel

Requires: %{name}-libs = %{version}-%{release}
Requires(postun): gtk2
Requires(posttrans): gtk2

Vendor: Project Vine
Distribution: Vine Linux

%description
%{kde} Development platform, the foundations upon which
KDevelop and Quanta are built.

%package libs
Summary: Runtime libraries for %{name}
Summary(ja): %{name} のランタイムライブラリ
Group:   System Environment/Libraries
Requires: kdelibs

%description libs
%{summary}.

%package devel
Summary:  Developer files for %{name}
Summary(ja): %{name} の開発用ファイル
Group:    Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
Requires: libboost-devel
Requires: commoncpp2-devel
Requires: kdelibs-devel
Requires: subversion-devel

%description devel
%{summary}.


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


%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 \
    -DLIB_INSTALL_DIR:PATH=%{_libdir} \
    -DLIBEXEC_INSTALL_DIR:PATH=%{_libexecdir}/kde4 \
    -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \
    ..
popd

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


%install
rm -rf %{buildroot}

make install/fast DESTDIR=%{buildroot} -C %{_target_platform}

%find_lang %{name} --all-name --with-kde


%clean
rm -rf %{buildroot}


%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING.PLUGINS COPYING.SRC
%{_bindir}/kdev_dbus_socket_transformer
%{_bindir}/kdev_format_source
%{_bindir}/kdevplatform_shell_environment.sh
%{_libdir}/kde4/imports/org/kde/%{name}
%{_libdir}/kde4/plugins/grantlee/0.3/kdev_filters.so
%{_datadir}/config/kdevappwizard.knsrc
%{_datadir}/config/kdevfiletemplates.knsrc
%{_datadir}/kde4/apps/kdev*/
%{_datadir}/kde4/apps/plasma/plasmoids
%{_datadir}/kde4/services/*.desktop
%{_datadir}/kde4/servicetypes/*.desktop
%{_datadir}/icons/hicolor/*/*/*

%files libs
%defattr(-,root,root,-)
%{_libdir}/lib*.so.*
%{_libdir}/kde4/*.so

%files devel
%defattr(-,root,root,-)
%{_libdir}/lib*.so
%{_includedir}/kde4/%{name}/
%{_libdir}/cmake/%{name}/


%changelog
* Sun Jan 04 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.7.0-1
- new upstream release

* Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.6.0-1
- new upstream release
- add BuildRequires: grentlee-devel

* Sun Dec 08 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.4.1-2
- rebuild with libboost-1.54.0

* Sun Nov 04 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.4.1-1
- new upstream release

* Sat Oct 20 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.4.0-1
- new upstream release
- add BuildRequires: qjson-devel

* Sat Sep 01 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.3.1-1
- new upstream release

* Sat Jun 25 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.2.3-1
- new upstream release

* Sat May 14 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.2.0-2
- add BuildRequires: soprano-devel

* Fri Feb 25 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.2.0-1
- new upstream release

* Thu Jan 13 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.1.2-1
- new upstream release
- added Japanese summary

* Sun May 23 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.0-3
- removed R: kdevplatform from libs package

* Sat May  8 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.0-2
- Initial build for Vine Linux

* Thu Apr 29 2010 Rex Dieter <rdieter@fedoraproject.org> - 1.0.0-1
- kdevplatform-1.0.0

* Sat Apr 17 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.10.2-1
- kdevplatform-0.10.2

* Thu Apr 08 2010 Rex Dieter <rdieter@fedoraproject.org. - 0.10.0-1
- kdevplatform-0.10.0

* Mon Mar 08 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.9.99-1
- kdevplatform-0.9.99

* Mon Feb 22 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.9.98-1
- kdevplatform-0.9.98

* Sat Jan 16 2010 Rex Dieter <rdieter@fedoraproject.org> - 0.9.97-2 
- rebuild (boost)
- BR: kdelibs4-devel

* Thu Jan 07 2010 Rex Dieter <rdieter@fedoraproject.org> 0.9.97-1
- kdevplatform-0.9.97
- kdevplatform: file conflict with kdelibs (FindKDevPlatform.cmake) (#541690)

* Sun Nov 22 2009 Rex Dieter <rdieter@fedoraproject.org> 0.9.95-0.6.20091015svn1035382
- rebuild (fc13+, qt-4.6.0-rc1)

* Thu Oct 15 2009 Ben Boeckel <MathStuf@gmail.com> - 0.9.95-0.5.20091015svn1035382
- New snapshot

* Sun Oct 11 2009 Ben Boeckel <MathStuf@gmail.com> - 0.9.95-0.4.beta5
- Fix finding Kompare includes

* Tue Sep 29 2009 Ben Boeckel <MathStuf@gmail.com> - 0.9.95-0.3.beta5
- Use official release

* Mon Sep 14 2009 Ben Boeckel <MathStuf@gmail.com> - 0.9.95-0.2
- Add icon scriptlets

* Mon Sep 14 2009 Ben Boeckel <MathStuf@gmail.com> - 0.9.95-0.1
- Update tarball

* Fri May 29 2009 Ben Boeckel <MathStuf@gmail.com> - 0.9.93-0.1
- 1.0 Beta 3

* Sat Feb 21 2009 Lorenzo Villani <lvillani@binaryhelix.net> - 0.9.91-0.2.20090221svn929301
- Post KDevplatform 1.0 Beta 1 snapshot

* Fri Jan 09 2009 Lorenzo Villani <lvillani@binaryhelix.net> - 0.9.85-1
- 0.9.85 snapshot