Name:		pdfchain
Version:	0.3.3
Release:	1%{?_dist_release}
Epoch: 1
Summary:	A GUI for pdftk
Summary(ja):	pdftk のグラフィカルユーザーインターフェイス

Group:		Applications/Productivity
License:	GPLv3
URL:		http://sourceforge.net/projects/pdfchain
Source0:	http://downloads.sourceforge.net/pdfchain/%{name}-%{version}.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
# Patch to make desktop file conform to standards
Patch0:		pdfchain-desktop.patch

BuildRequires:	desktop-file-utils
BuildRequires:	gettext
BuildRequires:	glibmm-devel
BuildRequires:	gtkmm3-devel
BuildRequires:	intltool
BuildRequires:	perl-XML-Parser

# For dir ownership
Requires:	hicolor-icon-theme
Requires:	pdftk
Requires(post):	desktop-file-utils
Requires(postun):	desktop-file-utils

%description
PDF Chain is a GUI for pdftk written with gtkmm. You can merge some pdf files
to one pdf file or split. There are also some options and tools.

%description -l ja
PDF Chain は gtkmm で書かれた pdftk のグラフィカルユーザーインターフェイスです。
複数の pdf ファイルを一つのファイルにマージしたり、分割したりすることができます。
また、幾つかのオプションとツールがあります。

%prep
%setup -q
%patch0 -p1
#%patch1 -p1
#%patch2 -p1
# Stop if files acquire content
#[ -s NEWS ] && exit 1
#[ -s README ] && exit 1

%build
%configure
make %{?_smp_mflags}

%install
rm -rf %{buildroot} 
make install DESTDIR=%{buildroot}
# Remove doc dir
rm -rf %{buildroot}%{_prefix}/doc/pdfchain
# Validate desktop file
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop

%post
# Update mime types
update-desktop-database &> /dev/null || :
# Update icon cache
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
# Update mime types
update-desktop-database &> /dev/null || :

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

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

%clean
rm -rf %{buildroot} 

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/pixmaps/%{name}.png

%changelog
* Sat Dec 03 2011 Toshiahru Kudoh <toshi.kd2@gmail.com> - 0.3.3-1
- new upstream release
- added Epoch:1
- dropt patch1,2
- changed BuildRequires: gtkmm2-devel to gtkmm3-devel

* Sat Sep 18 2010 Toshiahru Kudoh <toshi.kd2@gmail.com> - 0.123-1
- initial build for VineSeed

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.123-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Jul 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.123-1
- Update to 0.123.

* Wed May 27 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.99-3
- Added missing BR: desktop-file-utils.
- Set license as GPLv3 for now.

* Wed May 27 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 0.99-2
- Clean up spec file for inclusion into Fedora.

* Wed May 6 2009  Leigh Scott <leigh123linux@googlemail.com> - 0.99-1
- Initial build
