%global srcname pdfminer Name: python-pdfminer Version: 20140328 Release: 2%{?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 BuildRequires: cmap-japan1-6 BuildRequires: cmap-korean1-2 BuildRequires: cmap-gb1-5 BuildRequires: cmap-cns1-6 %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/cmap-japan*/cid2code.txt cmaprsrc/cid2code_Adobe_Japan1.txt cp %{_datadir}/cmap/cmap-korea*/cid2code.txt cmaprsrc/cid2code_Adobe_Korea1.txt cp %{_datadir}/cmap/cmap-gb*/cid2code.txt cmaprsrc/cid2code_Adobe_GB1.txt cp %{_datadir}/cmap/cmap-cns*/cid2code.txt cmaprsrc/cid2code_Adobe_CNS1.txt %build make cmap %{__python} setup.py build %install chmod +x build/lib/pdfminer/* %{__python} setup.py install --skip-build --root %{buildroot} # Rename the python scripts to get rid of the *.py suffix mv %{buildroot}%{_bindir}/dumppdf.py %{buildroot}%{_bindir}/dumppdf mv %{buildroot}%{_bindir}/pdf2txt.py %{buildroot}%{_bindir}/pdf2txt mv %{buildroot}%{_bindir}/latin2ascii.py %{buildroot}%{_bindir}/latin2ascii %files %{_bindir}/dumppdf %{_bindir}/latin2ascii %{_bindir}/pdf2txt %{python_sitelib}/%{srcname}-%{version}-py2.7.egg-info %{python_sitelib}/%{srcname}/ %doc docs/* %changelog * Sat Aug 23 2014 Ben Rosser 20140328-2 - Replaced /usr/bin with bindir macro in install section. * Sat Aug 16 2014 Ben Rosser 20140328-1 - Updated to latest version of pdfminer. - Changed specfile to depend on the correct cmap-* packages. * Thu Sep 20 2012 Ben Rosser 20110515-4 - Removed bundled cmap, changed to depend on cmap package instead * Thu Jul 05 2012 Ben Rosser 20110515-3 - 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-2 - Fixed unowned directory issue and cleaned up the spec file * Fri May 18 2012 Ben Rosser 20110515-1 - Initial version of the package