Name: kdiff3
Version: 0.9.95
Release: 1%{?_dist_release}

URL: http://kdiff3.sourceforge.net/
License: GPLv2
Summary: Tool for Comparison and Merge of Files and Directories
Summary(ja): ファイルやディレクトリの比較/マージを行うツール
Group: Development/Tools

Source: http://downloads.sourceforge.net/sourceforge/kdiff3/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root

# Remove bogus MimeType tag from kdiff3part.desktop
Patch0:         kdiff3part.desktop.diff
# Install kdiff3_part.rc into correct location
Patch1:		kdiff3part.rc.diff

Requires: kdelibs > 4.1
BuildRequires: desktop-file-utils
BuildRequires: cmake
BuildRequires: gettext
BuildRequires: libICE-devel
BuildRequires: libXau-devel
BuildRequires: libXext-devel
BuildRequires: libXdmcp-devel
BuildRequires: libXft-devel
BuildRequires: libXpm-devel
BuildRequires: kdelibs-devel >= 4.1
BuildRequires: kdebase-devel
BuildRequires: phonon-devel
BuildRequires: qt4-devel >= 4.4
BuildRequires: openssl-devel
BuildRequires: xorg-x11-devel

%description
Shows the differences line by line and character by character (!).
Provides an automatic merge-facility and
an integrated editor for comfortable solving of merge-conflicts.
Supports KIO on KDE (allows accessing ftp, sftp, fish, smb etc.).
Unicode & UTF-8 support

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1

%build
export QTDIR=/usr/lib/qt4
cmake . -DCMAKE_INSTALL_PREFIX=/usr
%{__make} %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
make install DESTDIR=%{buildroot}

# Desktop.
desktop-file-install --vendor="" \
    --dir=$RPM_BUILD_ROOT%{_datadir}/kde4/services \
    $RPM_BUILD_ROOT%{_datadir}/kde4/services/kdiff3part.desktop

desktop-file-install  --vendor="" \
    --dir=$RPM_BUILD_ROOT%{_datadir}/applications/kde4  \
    --add-category=Development \
        $RPM_BUILD_ROOT%{_datadir}/applications/kde4/kdiff3.desktop

# locale's
%find_lang %{name} || touch %{name}.lang
%find_lang %{name}plugin || touch %{name}.lang
cat %{name}plugin.lang >> %{name}.lang

%clean
%{__rm} -rf %{buildroot}

%post
touch --no-create %{_datadir}/icons/hicolor || :
touch --no-create %{_datadir}/icons/locolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor 2> /dev/null || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/locolor 2> /dev/null || :

%postun
touch --no-create %{_datadir}/icons/hicolor || :
touch --no-create %{_datadir}/icons/locolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor 2> /dev/null || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/icons/locolor 2> /dev/null || :

%files -f %{name}.lang
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%{_bindir}/kdiff3
%{_datadir}/applications/*
%{_datadir}/doc/HTML/*
%{_datadir}/kde4/apps/*
%{_datadir}/kde4/services/*
%{_datadir}/icons/hicolor/*
%{_datadir}/icons/locolor/*
%{_libdir}/kde4/*

%changelog
* Thu Aug 5 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> - 0.9.95-1
- initial build for VineSeed

* Fri Nov 21 2008 Joachim Eibl - 0.9.94-1
- Untested changes for KDE4.
* Mon May 15 2006 Vadim Likhota <vadim-lvv@yandex.ru> - 0.9.90-1.fc
- write spec for fc/rhel/centos/asp for kdiff3
