Name:    libktorrent
Summary: Library providing torrent downloading code
Version: 1.1.2
Release: 1%{?_dist_release}

Group:   System Environment/Libraries
License: GPLv2+
URL:     http://ktorrent.org/

Source0: http://ktorrent.org/downloads/4.1.2/libktorrent-%{version}.tar.bz2 

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gettext
BuildRequires: gmp-devel
BuildRequires: kdelibs4-devel
BuildRequires: libboost-devel
BuildRequires: libgcrypt-devel
BuildRequires: qca2-devel

%description
%{summary}.

%package devel
Summary: Developer files for %{name}
Summary(ja): %{name} の開発用ファイル
Group:   Development/Libraries
Obsoletes: ktorrent-devel <= 4.0
Requires: %{name} = %{version}-%{release}
Requires: kdelibs4-devel 

%description devel
%{summary}.


%prep
%setup -q

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
unset QTDIR || : ; . /etc/profile.d/qt4.sh
%cmake \
    -DCMAKE_BUILD_TYPE=release \
    -DDATA_INSTALL_DIR:PATH=%{_datadir}/kde4/apps \
    -DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/kde4 \
    -DLIBEXEC_INSTALL_DIR:PATH=%{_libexecdir}/kde4 \
    ..
popd

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


%install
rm -rf %{buildroot}

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

%find_lang %{name} --with-kde


%clean
rm -rf %{buildroot} 


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc ChangeLog COPYING
%{_libdir}/libktorrent.so.*

%files devel
%defattr(-,root,root,-)
%{_datadir}/kde4/apps/cmake/modules/FindKTorrent.cmake
%{_includedir}/kde4/libktorrent/
%{_libdir}/libktorrent.so


%changelog
* Wed Oct  5 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.1.2-1
- new upstream release
- added BR: libgcrypt-devel

* Wed Jan 26 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.5-1
- new upstream release

* Tue Aug 17 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.0.2-3
- initial build for Vine Linux

* Fri Jul  9 2010 Alexey Kurov <nucleo@fedoraproject.org> - 1.0.2-2
- fixed license tag
- added license text

* Thu Jul  8 2010 Alexey Kurov <nucleo@fedoraproject.org> - 1.0.2-1
- libktorrent-1.0.2

* Tue Jun 15 2010 Alexey Kurov <nucleo@fedoraproject.org> - 1.0.1-1
- libktorrent-1.0.1

* Mon May 24 2010 Rex Dieter <rdieter@fedoraproject.org> 1.0.0-1
- libktorrent-1.0.0

* Wed May 05 2010 Rex Dieter <rdieter@fedoraproject.org> 1.0-0.2.rc1
- -devel: Obsoletes: ktorrent-devel

* Mon May 03 2010 Rex Dieter <rdieter@fedoraproject.org> 1.0-0.1.rc1
- libktorrent-1.0rc1

