[packages/python-pyudev] - build and package HTML docs instead of rst sources - added offline patch to avoid using network wh

qboosh qboosh at pld-linux.org
Sat Sep 1 11:20:00 CEST 2012


commit 68e557164e790665305d860b6d776d2f9446962e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Sep 1 11:20:11 2012 +0200

    - build and package HTML docs instead of rst sources
    - added offline patch to avoid using network when building docs

 python-pyudev-offline.patch | 19 +++++++++++++++++++
 python-pyudev.spec          | 33 ++++++++++++++++++++++++++++-----
 2 files changed, 47 insertions(+), 5 deletions(-)
---
diff --git a/python-pyudev.spec b/python-pyudev.spec
index 1713341..a7b2fcc 100644
--- a/python-pyudev.spec
+++ b/python-pyudev.spec
@@ -1,20 +1,37 @@
 #
 # Conditional build:
+%bcond_without	doc	# HTML documentation build
 %bcond_without	tests	# do not perform "make test"
-
+#
 %define 	module	pyudev
 Summary:	Pure Python binding for libudev
 Summary(pl.UTF-8):	Czysto pythonowe wiązanie do libudev
 Name:		python-%{module}
 Version:	0.16.1
-Release:	1
+Release:	2
 License:	LGPL v2.1+
 Group:		Development/Languages/Python
 Source0:	http://pypi.python.org/packages/source/p/pyudev/%{module}-%{version}.tar.gz
 # Source0-md5:	4034de584b6d9efcbfc590a047c63285
+Source1:	http://docs.python.org/objects.inv#/python-objects.inv
+# Source1-md5:	9128e774ec21dcd62dc5bca61cdd91ee
+Source2:	http://pytest.org/latest/objects.inv#/pytest-objects.inv
+# Source2-md5:	f53cc331c951c20a9d8926d901342309
+Source3:	http://www.pyside.org/docs/pyside/objects.inv#/pyside-objects.inv
+# Source3-md5:	8cc5c1ff0bb5ef9f4e9968c9b4a01984
+Patch0:		%{name}-offline.patch
 URL:		http://pyudev.readthedocs.org/
+BuildRequires:	python-devel >= 1:2.6
 BuildRequires:	python-distribute
 BuildRequires:	rpm-pythonprov
+%if %{with doc}
+# for tests 1.0b1 is required, but for docs generation 0.8 is sufficient
+#BuildRequires:	python-mock >= 1.0-0.b1
+BuildRequires:	python-mock >= 0.8
+BuildRequires:	python-sphinxcontrib-issuetracker >= 0.9
+BuildRequires:	python-pytest >= 2.2
+BuildRequires:	sphinx-pdg >= 1.0.7
+%endif
 Requires:	python-modules
 Requires:	udev-libs >= 1:151
 BuildArch:	noarch
@@ -38,12 +55,20 @@ użyciem wątków albo wewnątrz pętli zdarzeń Qt, GLiba czy wxPythona.
 
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
+
+cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} doc
 
 %build
 %{__python} setup.py build
 
 %{?with_tests:%{__python} setup.py test}
 
+%if %{with doc}
+sphinx-build -W -b linkcheck -d doc/_doctrees doc doc/_linkcheck
+sphinx-build -W -b html -d doc/_doctrees doc doc/html
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 %{__python} setup.py install \
@@ -51,8 +76,6 @@ rm -rf $RPM_BUILD_ROOT
 	--optimize=2 \
 	--root=$RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-
 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
 
@@ -61,6 +84,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGES.rst README.rst doc/
+%doc CHANGES.rst README.rst %{?with_doc:doc/html}
 %{py_sitescriptdir}/%{module}
 %{py_sitescriptdir}/pyudev-%{version}-py*.egg-info
diff --git a/python-pyudev-offline.patch b/python-pyudev-offline.patch
new file mode 100644
index 0000000..4699863
--- /dev/null
+++ b/python-pyudev-offline.patch
@@ -0,0 +1,19 @@
+--- pyudev-0.16.1/doc/conf.py.orig	2012-08-01 21:25:48.000000000 +0200
++++ pyudev-0.16.1/doc/conf.py	2012-09-01 10:30:21.520539639 +0200
+@@ -103,12 +103,13 @@
+ html_sidebars = {'**': ['info.html', 'localtoc.html', 'relations.html',
+                         'sourcelink.html']}
+ 
+-intersphinx_mapping = {'python': ('http://docs.python.org/', None),
+-                       'pytest': ('http://pytest.org/latest', None),
+-                       'pyside': ('http://www.pyside.org/docs/pyside/', None)}
++intersphinx_mapping = {'python': ('http://docs.python.org/', 'python-objects.inv'),
++                       'pytest': ('http://pytest.org/latest', 'pytest-objects.inv'),
++                       'pyside': ('http://www.pyside.org/docs/pyside/', 'pyside-objects.inv')}
+ 
+ issuetracker = 'github'
+ issuetracker_project = 'lunaryorn/pyudev'
++issuetracker_plaintext_issues = False
+ 
+ 
+ class UDevVersion(Directive):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pyudev.git/commitdiff/68e557164e790665305d860b6d776d2f9446962e



More information about the pld-cvs-commit mailing list