%global srcname pdfminer Name: python-pdfminer Version: 20110515 Release: 3%{?dist} Summary: Tool to extract information from a PDF Group: Development/Libraries License: MIT URL: http://www.unixuser.org/~euske/python/pdfminer/index.html Source0: http://pypi.python.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel, cmap %description PDFMiner is a tool for extracting information from PDF documents. Unlike other PDF-related tools, it focuses entirely on getting and analyzing text data. PDFMiner allows to obtain the exact location of texts in a page, as well as other information such as fonts or lines. It includes a PDF converter that can transform PDF files into other text formats (such as HTML). It has an extensible PDF parser that can be used for other purposes instead of text analysis. %prep %setup -q -n %{srcname}-%{version} # Remove the bundled cmap data and replace it with that provided by the package rm cmaprsrc/* cp %{_datadir}/cmap/aj16/cid2code.txt cmaprsrc/cid2code_Adobe_Japan1.txt cp %{_datadir}/cmap/ak12/cid2code.txt cmaprsrc/cid2code_Adobe_Korea1.txt cp %{_datadir}/cmap/ag15/cid2code.txt cmaprsrc/cid2code_Adobe_GB1.txt cp %{_datadir}/cmap/ac16/cid2code.txt cmaprsrc/cid2code_Adobe_CNS1.txt %build make cmap %{__python} setup.py build %install chmod +x build/lib/pdfminer/* # Rename the python scripts to get rid of the *.py suffix mv build/scripts-2.7/dumppdf.py build/scripts-2.7/dumppdf mv build/scripts-2.7/pdf2txt.py build/scripts-2.7/pdf2txt mv build/scripts-2.7/latin2ascii.py build/scripts-2.7/latin2ascii %{__python} setup.py install --skip-build --root %{buildroot} %files %{_bindir}/dumppdf %{_bindir}/latin2ascii %{_bindir}/pdf2txt %{python_sitelib}/%{srcname}-20110515-py2.7.egg-info %{python_sitelib}/%{srcname}/ %doc docs/* %changelog * Thu Sep 20 2012 'Ben Rosser' 20110515-3 - Removed bundled cmap, changed to depend on cmap package instead * Thu Jul 05 2012 'Ben Rosser' 20110515-2 - Removed BuildRoot, clean, and first line of install - Fixed issue with cmap data not being copied into package - Fixed license (cmap is under BSD, not MIT) * Tue May 22 2012 'Ben Rosser' 20110515-1 - Fixed unowned directory issue and cleaned up the spec file * Fri May 18 2012 'Ben Rosser' 20110515-0 - Initial version of the package