PyPDF2 and stapler (RPM build error for stapler)

Ralf Corsepius rc040203 at freenet.de
Mon Feb 16 15:40:52 UTC 2015


On 02/16/2015 03:42 PM, Ranjan Maitra wrote:

> So, these two files conflict:
>
> /usr/share/doc/stapler
> /usr/share/doc/stapler/CONTRIBUTORS
>
> Not sure how to get around this.

You need to change your package's name, i.e. the value on the right-hand 
side of the "Name: "-tag inside of your rpm spec.


This is an untested re-write of your spec:
--- snip ---
# spec file for package pdfstapler
#

%global snapdate 20150128
%global commit 8b5f409afc9b35e0fe71ceb46d97292d79a7158b
%global shortcommit %(c=%{commit}; echo ${c:0:7})

%global realname stapler

Name:           pdf%{realname}
# The Version is hidden in the stapler script
Version:        0.3.0
Release:        0.%{snapdate}git%{shortcommit}%{?dist}
Summary:        Python-based PDF toolkit alternative to obsoleted pdftk

Group:          Applications/System
License:        BSD
URL:            https://github.com/hellerbarde/%{realname}
Source0: 
https://github.com/hellerbarde/%{realname}/archive/%{commit}/%{realname}-%{snapdate}git%{shortcommit}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel, PyPDF2, python-setuptools
Requires:       PyPDF2


%description
PDFtk was written in Java and C++, and is natively compiled with gcj.
Sadly, it has been discontinued a few years ago and bitrot is setting
in (e.g., it does not compile easily on a number of platforms).

Philip Stark decided to look for an alternative and found pypdf, a
PDF library written in pure Python. He couldn't find a tool which
actually used the library, so he started writing his own.

This version of stapler is Fred Wenzel's fork of the project, with
a completely refactored source code, tests, and added functionality.

Like pdftk, stapler is a command-line tool.


%prep
%setup -q -n %{realname}-%{commit}


%build
%{__python} setup.py build


%install
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
install -m 755 -d $RPM_BUILD_ROOT/%{_sbindir}

%files
%doc CONTRIBUTORS LICENSE
%{_bindir}/stapler
%{python2_sitelib}/*


%changelog
* Mon Feb 09 2015 stat.maitra at inbox.com
- initial packaging of 0.3 version
--- snip ---

Ralf



More information about the users mailing list