Name: k3b-extra
Summary: K3b additional plugins
Summary(ja): K3b 追加プラグイン集
Version: 2.0.2
Release: 2%{?_dist_release}

Group: Applications/Archiving
License: GPLv2+
URL: http://www.k3b.org/

Source0: http://downloads.sourceforge.net/sourceforge/k3b/k3b-%{version}.tar.bz2

ExcludeArch: s390 s390x
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: kdelibs4-devel
BuildRequires: kdemultimedia4-devel
BuildRequires: libdvdread-devel
BuildRequires: libmusicbrainz-devel
BuildRequires: libsamplerate-devel
BuildRequires: libXpm-devel
BuildRequires: taglib-devel
BuildRequires: self-build-lame
BuildRequires: self-build-libmad
BuildRequires: self-build-ffmpeg

Requires: k3b >= %{version}
Requires(post,postun): desktop-file-utils

Vendor: Project Vine
Distribution: Vine Linux

%description
This package provides the following additional plugins for K3b.

- FFMpeg decoder for decoding WMA file(s)
- MAD decoder for decoding MP3 file(s)
- Lame MP3 encoder for encoding MP3 file(s)

%description -l ja
K3b 向けに以下の追加プラグインを提供します．

- WMA ファイルをデコードするための FFMpeg デコーダ
- MP3 ファイルをデコードするための MAD デコーダ
- MP3 ファイルをエンコードするための Lame MP3 エンコーダ

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

%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 \
    -DK3B_BUILD_OGGVORBIS_DECODER_PLUGIN:BOOL=OFF \
    -DK3B_BUILD_OGGVORBIS_ENCODER_PLUGIN:BOOL=OFF \
    -DK3B_BUILD_MUSE_DECODER_PLUGIN::BOOL=OFF \
    -DK3B_BUILD_FLAC_DECODER_PLUGIN:BOOL=OFF \
    -DK3B_BUILD_SNDFILE_DECODER_PLUGIN:BOOL=OFF \
    -DK3B_BUILD_SOX_ENCODER_PLUGIN:BOOL=OFF \
    -DK3B_BUILD_EXTERNAL_ENCODER_PLUGIN:BOOL=OFF \
    -DK3B_BUILD_WAVE_DECODER_PLUGIN:BOOL=OFF \
    -DK3B_BUILD_K3BSETUP:BOOL=OFF \
    ..
popd

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


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

# remove unpackage files
rm -f $RPM_BUILD_ROOT%{_libdir}/kde4/k3baudiometainforenamerplugin.so
rm -f $RPM_BUILD_ROOT%{_libdir}/kde4/k3baudioprojectcddbplugin.so
rm -f $RPM_BUILD_ROOT%{_datadir}/kde4/services/k3baudiometainforenamerplugin.desktop
rm -f $RPM_BUILD_ROOT%{_datadir}/kde4/services/k3baudioprojectcddbplugin.desktop

%clean
rm -rf $RPM_BUILD_ROOT

%postun
if [ $1 -eq 0 ] ; then
    update-desktop-database -q %{_datadir}/applications > /dev/null 2>&1 ||:
fi

%posttrans
update-desktop-database -q %{_datadir}/applications > /dev/null 2>&1 ||:


%files 
%defattr(-,root,root,755)
%{_libdir}/kde4/*.so
%{_datadir}/kde4/services/*

%changelog
* Fri Mar  4 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.2-2
- added BR: libXpm-devel

* Sat Feb 26 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.2-1
- new upstream release

* Sun Sep 12 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.1-2
- fixed %%build section to remove qt-devel dependency 

* Wed Sep  8 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.1-1
- new upstream release

* Thu Jul 22 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.0.0-1
- initial build for self-build framework
