%bcond_with mp4v2

Summary: GUI tool for Apple's iPod
Summary(ja): アップルのiPod用GUIツール
Name: gtkpod
Version: 0.99.14
Release: 2%{?_dist_release}
Source0: %{name}-%{version}.tar.gz
Source1: %{name}-0.99.8-ja.po
License: GPL
Group: Applications/Multimedia
URL: http://gtkpod.sourceforge.net/

BuildRequires: gtk2-devel, libid3tag-devel, libgpod-devel, curl-devel
BuildRequires: gettext-devel, flex
%if %{with mp4v2}
BuildRequires: self-build-libmp4v2}
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux

%description
gtkpod is a platform independent GUI tool for Apple's iPod using GTK2. 
It supports the first to fourth Generation as well as the iPod mini, 
iPod Photo, iPod shuffle and iPod Video.

%description -l ja
gtkpodは、GTK2を利用したプラットフォームに依存しないアップルの iPod 用
GUIツールです。初代 iPod 〜第四世代の iPod、及び iPod(mini、Photo、
shuffle、Video)に対応しています。

%prep
%setup -q
cp -p %{SOURCE1} po/ja.po

%build
%configure \
%{?!with_mp4v2:	--without-mp4v2} 

make

%install
rm -rf $RPM_BUILD_ROOT
%makeinstall

mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
cat > $RPM_BUILD_ROOT%{_datadir}/applications/gtkpod.desktop << EOF
[Desktop Entry]
Name=gtkpod
Comment=GUI tool for Apple's iPod
Comment[ja]=アップルのiPod用GUIツール
Icon=gtkpod
Exec=gtkpod
Type=Application
Categories=Application;GTK;AudioVideo;
Terminal=0
EOF

#mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
#pushd $RPM_BUILD_ROOT%{_datadir}/pixmaps
#ln -s ../gtkpod/pixmaps/gtkpod-icon-32.png .
#popd

# remove unused file
rm -f $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/icon-theme.cache

%post
update-desktop-database -q ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache -q %{_datadir}/icons/hicolor ||:
fi

%postun
update-desktop-database -q ||:
touch --no-create %{_datadir}/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  gtk-update-icon-cache -q %{_datadir}/icons/hicolor ||:
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc AUTHORS TODOandBUGS.txt COPYING ChangeLog INSTALL NEWS README
%{_bindir}/gtkpod
%{_datadir}/gtkpod
%{_localedir}/*/*/gtkpod.mo
#{_sysconfdir}/X11/applnk/Multimedia/gtkpod.desktop
#{_datadir}/pixmaps/*
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*

%changelog
* Sat Jul 11 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.99.14-2
- build without libmp4v2 by default
- add %%post/%%postun script to update desktop db and icon cache

* Wed Jun 10 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.99.14-1
- new upstream release
- spec in utf-8

* Thu Apr 10 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.99.12-1vl5
- applied new versioning policy
- fixed Icon path of gtkpod.desktop

* Sun Jan 06 2008 Shu KONNO <owa@bg.wakwak.com> 0.99.12-0vl1
- new upstream release
- dropt gtkpod-0.99.8_libgpod-0.4.2.diff
- added icons in %%files section
- rebuilt with libgpod-0.6.0

* Tue May 29 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.99.8-0vl3
- for VineSeedPlus
- rebuilt with new toolchain and libgpod-0.4.2
- add Patch0 (derived from FC)

* Sun Jan  7 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.99.8-0vl1
- new upstream release
- added SOURCE1
- rebuilt with libgpod-devel 0.4.0
- moved gtkpod.desktop to %{_datadir}/applications <BTS:454>

* Sun Jan  8 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.99.2-0vl2
- rebuilt for VineSeed Plus

* Sun Jan  8 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.99.2-0vl1
- new upstream release

* Fri Dec 23 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.99.0-0vl3
- rebuilt for VineSeed Plus

* Fri Dec 23 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.99.0-0vl2
- rebuilt for VinePlus/3.0 
- added BuildRequires: curl-devel, flex

* Wed Dec 14 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.99.0-0vl1
- new upstream release.
- add BuildRequires: libgpod-devel

* Tue Aug 16 2005 TOSHI <toshi-52@s5.dion.ne.jp> 0.94.0-0vl1
-new upstream release.

* Mon Jun 16 2005 TOSHI <toshi-52@s5.dion.ne.jp> 0.8.22-0vl3
-A revision %description -l ja
-A revision %files
-add %doc

* Thu Jun 2 2005 TOSHI <toshi-52@s5.dion.ne.jp> 0.8.22-0vl2
-add macro
-add BuildRequires

* Tue May 17 2005 TOSHI <toshi-52@s5.dion.ne.jp> 0.8.22-0vl1
First release.

- initial build for Vine Linux

# end of file
