3 %bcond_without tests # do not perform "make test"
5 Summary: A GUI to produce PDFs from scanned documents
10 Group: Applications/Publishing
11 Source0: http://downloads.sourceforge.net/gscan2pdf/%{name}-%{version}.tar.gz
12 # Source0-md5: 97cdc74bcca61b9494b87bb155118eda
13 Patch0: %{name}-tesseract_polish.patch
14 URL: http://gscan2pdf.sourceforge.net/
15 BuildRequires: desktop-file-utils
16 BuildRequires: gettext-tools
17 %{?with_tests:BuildRequires: perl-Test-Pod}
18 BuildRequires: perl-devel
19 BuildRequires: rpm-perlprov >= 4.1-13
20 Requires(post,postun): gtk-update-icon-cache
21 Requires(post,postun): hicolor-icon-theme
23 Requires: ImageMagick-perl
26 Suggests: sane-backends >= 1.0.17
27 Suggests: sane-frontentds
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 Only two clicks are required to scan several pages and then save all
36 or a selection as a PDF file, including metadata if required.
38 gscan2pdf can control regular or sheet-fed (ADF) scanners with SANE
39 via scanimage or scanadf, and can scan multiple pages at once. It
40 presents a thumbnail view of scanned pages, and permits simple
41 operations such as rotating and deleting pages.
43 PDF conversion is done by PDF::API2.
45 The resulting document may be saved as a PDF or a multipage TIFF file.
52 %{__perl} Makefile.PL INSTALLDIRS=vendor
55 %{?with_tests:%{__make} test}
58 rm -rf $RPM_BUILD_ROOT
61 DESTDIR=$RPM_BUILD_ROOT
62 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
63 find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';'
64 %{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
65 chmod -R u+w $RPM_BUILD_ROOT/*
67 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable
68 mv $RPM_BUILD_ROOT%{_datadir}/pixmaps/gscan2pdf.svg \
69 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable
71 desktop-file-install --delete-original --vendor="" \
72 --dir=$RPM_BUILD_ROOT%{_desktopdir} \
73 $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
78 rm -rf $RPM_BUILD_ROOT
81 update-desktop-database &> /dev/null ||:
82 %update_icon_cache hicolor
85 update-desktop-database &> /dev/null ||:
86 %update_icon_cache hicolor
88 %files -f %{name}.lang
89 %defattr(644,root,root,755)
91 %attr(755,root,root) %{_bindir}/gscan2pdf
92 %attr(755,root,root) %{_bindir}/scanadf-perl
93 %attr(755,root,root) %{_bindir}/scanimage-perl
94 %{perl_vendorlib}/Gscan2pdf.pm
96 %{_desktopdir}/%{name}.desktop
98 %{_iconsdir}/hicolor/scalable/gscan2pdf.svg