File project.diff of Package python-pyscard

--- python-pyscard.changes.orig
+++ python-pyscard.changes
@@ -1,4 +1,22 @@
 -------------------------------------------------------------------
+Thu Jul 14 23:59:36 CEST 2011 - hpj@urpla.net - 1.6.14
+
+- add add-hash-methods.diff patch
+- relocate docs into package doc dir
+- run fdupes
+
+-------------------------------------------------------------------
+Fri Jul  8 23:35:23 CEST 2011 - hpj@urpla.net - 1.6.14
+
+- separate docs
+
+-------------------------------------------------------------------
+Wed Jul  6 18:43:57 CEST 2011 - hpj@urpla.net - 1.6.14
+
+- update to 1.6.14 svn 538
+- generate epydoc reference docs
+
+-------------------------------------------------------------------
 Fri May 27 22:43:07 CEST 2011 - hpj@urpla.net - 1.6.14
 
 - update to 1.6.14 svn 529
--- python-pyscard.spec.orig
+++ python-pyscard.spec
@@ -21,18 +21,24 @@
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
 %define modname pyscard
+%define svnrev 538
 
 Name:           python-pyscard
 Version:        1.6.14
-Release:        0.svn529.<CI_CNT>.<B_CNT>
+Release:        0.svn%{svnrev}.<CI_CNT>.<B_CNT>
 Summary:        Python module adding smart card support
 URL:            http://pyscard.sourceforge.net/
 License:        LGPL
 Group:          Development/Libraries/Python
 Source:         %{modname}-%{version}.tar.bz2
+Source1:	build-doc.py
+Source2:	epydoc.cfg
+Patch:		add-hash-methods.diff
 BuildRoot:      %{_tmppath}/%{name}-buildroot
-BuildRequires:  pcsc-lite-devel python-devel swig recode
-Requires:       python-wxGTK
+BuildRequires:  pcsc-lite-devel python-devel python-wxGTK
+BuildRequires:  swig recode epydoc fdupes
+Requires:       pcsc-lite python-wxGTK
+Recommends:     pcsc-ccid
 
 %if 0%{?suse_version}
 %py_requires
@@ -44,7 +50,25 @@ Windows smart card base components (also
 lite on linux and Mac OS X Tiger and Leopard, and smartcard, a higher level
 python framework built on top of the raw PCSC API. 
 
-This package is build from rev 529 of the svn repo at:
+This package is build from rev %{svnrev} of the svn repo at:
+https://pyscard.svn.sourceforge.net/svnroot/pyscard/trunk
+
+Authors:
+--------
+    Jean-Daniel Aussel <aussel.jean-daniel@gemalto.com>
+
+%package doc
+License:        LGPL
+Group:          Development/Libraries/Python
+Summary:        Python module adding smart card support
+
+%description doc
+Python-pyscard consists of smartcard.scard, an extension module wrapping
+Windows smart card base components (also known as PCSC) on Windows and PCSC
+lite on linux and Mac OS X Tiger and Leopard, and smartcard, a higher level
+python framework built on top of the raw PCSC API. 
+
+This package is build from rev %{svnrev} of the svn repo at:
 https://pyscard.svn.sourceforge.net/svnroot/pyscard/trunk
 
 Authors:
@@ -53,9 +77,9 @@ Authors:
 
 %prep
 %setup -q -n %{modname}-%{version}
-mv smartcard/{ACKS,ChangeLog,doc,Examples,TODO} .
-recode lat1..utf8 ACKS
-sed -i 's/\r//g' LICENSE Examples/wx/*/setup.py
+cp %{SOURCE1} .
+cp %{SOURCE2} smartcard/doc/
+%patch
 
 %build
 export CFLAGS="%{optflags}"
@@ -63,13 +87,29 @@ python setup.py build
 
 %install
 python setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
+# generate reference doc
+python build-doc.py $RPM_BUILD_ROOT/%{python_sitearch}
+mv generated/doc .
+# relocate and fix other docs
+mv smartcard/{ACKS,ChangeLog,Examples,LICENSE,README,TODO} .
+recode lat1..utf8 ACKS
+sed -i 's/\r//g' LICENSE Examples/wx/*/setup.py
+
+# copy docs manually to separate them and keep fdupes work :-(
+DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/packages/%{name}
+mkdir -p $DOCDIR
+cp -pr ACKS ChangeLog doc Examples LICENSE PKG-INFO README TODO $DOCDIR
+%fdupes $DOCDIR
 
 %clean
 rm -rf %{buildroot}
 
 %files -f INSTALLED_FILES
 %defattr(0644,root,root,0755)
-%doc ACKS ChangeLog doc Examples LICENSE PKG-INFO README TODO 
+%dir /usr/share/doc/packages/%{name}
+/usr/share/doc/packages/%{name}/LICENSE
+/usr/share/doc/packages/%{name}/PKG-INFO
+/usr/share/doc/packages/%{name}/README 
 %dir %python_sitearch/smartcard
 %dir %python_sitearch/smartcard/pcsc
 %dir %python_sitearch/smartcard/reader
@@ -79,4 +119,12 @@ rm -rf %{buildroot}
 %dir %python_sitearch/smartcard/wx
 %dir %python_sitearch/smartcard/wx/resources
 
+%files doc
+%defattr(0644,root,root,0755)
+/usr/share/doc/packages/%{name}/ACKS
+/usr/share/doc/packages/%{name}/ChangeLog
+/usr/share/doc/packages/%{name}/doc
+/usr/share/doc/packages/%{name}/Examples
+/usr/share/doc/packages/%{name}/TODO
+
 %changelog