Blob Blame History Raw
Summary: Computes number of pages or quantity of ink needed to print documents
Name:    pkpgcounter
Version: 3.50
Release: 8%{?dist}
License: GPLv3+
Group:   Applications/System
URL:     http://www.pykota.com/software/pkpgcounter
Source0: http://www.pykota.com/software/pkpgcounter/download/tarballs/pkpgcounter-%{version}.tar.gz
Patch0:  pkpgcounter-postscript-multiple-copies.patch

BuildArch:     noarch
BuildRequires: python2-devel
BuildRequires: python-imaging
Requires:      python-imaging
Requires:      ghostscript

%description
pkpgcounter parses files and outputs the number of pages needed to print them.
It can also, for certain file formats, compute the percentage of ink colors
covering each page. It currently recognizes almost 20 Page Description Languages
or file formats, including the most used ones like Postscript, PDF,
the PCL family, DVI, OpenDocument, or even Microsoft Word, corresponding to
hundreds of different printer drivers. This utility and Python library is often
used as the PDL parsing engine in print accounting software like PyKota or
JASMine, but can of course be used independently.

%prep
%setup -q

# This change corrects the page count of postscript files when printed
# with multiple copies from the MS Office suite. Without this patch, every time
# that a user try to print a job using multiple copies from MS office it counts
# much more than the correct quantity of copies.
%patch0 -p1 -b .multiple_copies

iconv -f iso-8859-1 -t utf-8 -o NEWS.tmp NEWS && mv NEWS.tmp NEWS
iconv -f iso-8859-1 -t utf-8 -o CREDITS.tmp CREDITS && mv CREDITS.tmp CREDITS

# Remove shebang /usr/bin/env python
for file in pkpgpdls/*.py; do
    sed -i '/\/usr\/bin\/env/d' ${file}
done


%build
%py2_build

%install
%py2_install
rm -rf %{buildroot}%{_docdir}/pkpgcounter


%files
%doc BUGS COPYING CREDITS NEWS README
%{python_sitelib}/pkpgpdls
%{python_sitelib}/pkpgcounter*.egg-info
%{_bindir}/pkpgcounter
%{_mandir}/man1/pkpgcounter.1.gz

%changelog
* Tue Aug 11 2015 Jiri Popelka <jpopelka@redhat.com> - 3.50-8
- %%py2_build && %%py2_install

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Sep 01 2012 Jiri Popelka <jpopelka@redhat.com> 3.50-3
- Correct page count of postscript files when printed
  with multiple copies from the MS Office (#852410)

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jan 09 2012 Jiri Popelka <jpopelka@redhat.com> 3.50-1
- Initial RPM spec file.