e4648fa
Summary: Computes number of pages or quantity of ink needed to print documents
e4648fa
Name:    pkpgcounter
e4648fa
Version: 3.50
8edf54e
Release: 6%{?dist}
e4648fa
License: GPLv3+
7947b50
Group:   Applications/System
e4648fa
URL:     http://www.pykota.com/software/pkpgcounter
e4648fa
Source0: http://www.pykota.com/software/pkpgcounter/download/tarballs/pkpgcounter-%{version}.tar.gz
7947b50
Patch0:  pkpgcounter-postscript-multiple-copies.patch
e4648fa
e4648fa
BuildArch:     noarch
e4648fa
BuildRequires: python2-devel
e4648fa
BuildRequires: python-imaging
e4648fa
Requires:      python-imaging
e4648fa
Requires:      ghostscript
e4648fa
e4648fa
%description
e4648fa
pkpgcounter parses files and outputs the number of pages needed to print them.
e4648fa
It can also, for certain file formats, compute the percentage of ink colors
e4648fa
covering each page. It currently recognizes almost 20 Page Description Languages
e4648fa
or file formats, including the most used ones like Postscript, PDF,
e4648fa
the PCL family, DVI, OpenDocument, or even Microsoft Word, corresponding to
e4648fa
hundreds of different printer drivers. This utility and Python library is often
e4648fa
used as the PDL parsing engine in print accounting software like PyKota or
e4648fa
JASMine, but can of course be used independently.
e4648fa
e4648fa
%prep
e4648fa
%setup -q
e4648fa
7947b50
# This change corrects the page count of postscript files when printed
7947b50
# with multiple copies from the MS Office suite. Without this patch, every time
7947b50
# that a user try to print a job using multiple copies from MS office it counts
7947b50
# much more than the correct quantity of copies.
7947b50
%patch0 -p1 -b .multiple_copies
7947b50
e4648fa
iconv -f iso-8859-1 -t utf-8 -o NEWS.tmp NEWS && mv NEWS.tmp NEWS
e4648fa
iconv -f iso-8859-1 -t utf-8 -o CREDITS.tmp CREDITS && mv CREDITS.tmp CREDITS
e4648fa
e4648fa
# Remove shebang /usr/bin/env python
e4648fa
for file in pkpgpdls/*.py; do
e4648fa
    sed -i '/\/usr\/bin\/env/d' ${file}
e4648fa
done
e4648fa
e4648fa
e4648fa
%build
e4648fa
%{__python} setup.py build
e4648fa
e4648fa
%install
e4648fa
%{__python} setup.py install --skip-build --root %{buildroot}
e4648fa
rm -rf %{buildroot}%{_docdir}/pkpgcounter
e4648fa
e4648fa
e4648fa
%files
e4648fa
%doc BUGS COPYING CREDITS NEWS README
e4648fa
%{python_sitelib}/pkpgpdls
e4648fa
%{python_sitelib}/pkpgcounter*.egg-info
e4648fa
%{_bindir}/pkpgcounter
e4648fa
%{_mandir}/man1/pkpgcounter.1.gz
e4648fa
e4648fa
%changelog
8edf54e
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-6
8edf54e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
8edf54e
755d112
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-5
755d112
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
755d112
22e6968
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-4
22e6968
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
22e6968
7947b50
* Sat Sep 01 2012 Jiri Popelka <jpopelka@redhat.com> 3.50-3
7947b50
- Correct page count of postscript files when printed
7947b50
  with multiple copies from the MS Office (#852410)
7947b50
5cd0faa
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.50-2
5cd0faa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5cd0faa
e4648fa
* Mon Jan 09 2012 Jiri Popelka <jpopelka@redhat.com> 3.50-1
e4648fa
- Initial RPM spec file.