Package: python-pelican
Version: 3.5.0-1
Followup-For: Bug #754071

Hello Vincent and thank you for maintaining the package. Attached is a patch to
build the -doc package. I had to switch debian/watch to use the tarball from
GitHub as the PyPI version has no documentation in it.
Also I switched to dh_python to simplify the build, I hope you don't mind.

Bye,
--
Federico
diff --git a/debian/changelog b/debian/changelog
index edc9f85..bd9b4c4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+pelican (3.5.0-2) UNRELEASED; urgency=medium
+
+  * Build documentation (Closes: #754071)
+  * Update debian/watch to fetch sources from GitHub
+  * Switch to dh_python, enable optional unit testing
+  * Bump debhelper version to 9
+
+ -- Federico Ceratto <federico.cera...@gmail.com>  Fri, 02 Jan 2015 14:58:35 +0000
+
 pelican (3.5.0-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/compat b/debian/compat
index 7f8f011..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+9
diff --git a/debian/control b/debian/control
index 9c8e784..63b55ad 100644
--- a/debian/control
+++ b/debian/control
@@ -4,9 +4,10 @@ Priority: optional
 Maintainer: Debian Python Applications Team <python-apps-t...@lists.alioth.debian.org>
 Uploaders: Ondřej Surý <ond...@debian.org>, Vincent Cheng <vch...@debian.org>
 Build-Depends:
- debhelper (>= 7.4.3),
+ debhelper (>= 9~),
  python-all (>= 2.6.6-3),
- python-setuptools (>= 0.6b3)
+ python-setuptools (>= 0.6b3),
+ python-sphinx
 Standards-Version: 3.9.6
 X-Python-Version: >= 2.7
 Homepage: http://getpelican.com/
@@ -31,3 +32,18 @@ Description: blog aware, static website generator
  that is easy to host anywhere.  Pelican includes a simple CLI tool to
  (re)generate the weblog and it is easy to interface with DVCSes and web
  hooks.
+
+Package: python-pelican-doc
+Architecture: all
+Section: doc
+Depends:
+ ${misc:Depends},
+ ${python:Depends},
+ ${sphinxdoc:Depends}
+Description: blog aware, static website generator (documentation)
+ Pelican is a static site generator, written in Python.  It allows you
+ to write your weblog entries directly with your editor of choice in
+ reStructuredText or Markdown, and generates completely static output
+ that is easy to host anywhere.  Pelican includes a simple CLI tool to
+ (re)generate the weblog and it is easy to interface with DVCSes and web
+ hooks.
diff --git a/debian/python-pelican-doc.doc-base b/debian/python-pelican-doc.doc-base
new file mode 100644
index 0000000..e001084
--- /dev/null
+++ b/debian/python-pelican-doc.doc-base
@@ -0,0 +1,9 @@
+Document: python-pelican
+Title: Pelican Static Site Generator
+Author: Justin Mayer, Alexis Métaireau and others
+Abstract: Pelican is a static site generator written in Python
+Section: Web Development
+
+Format: HTML
+Index: /usr/share/doc/python-pelican-doc/html/index.html
+Files: /usr/share/doc/python-pelican-doc/html
diff --git a/debian/python-pelican-doc.docs b/debian/python-pelican-doc.docs
new file mode 100644
index 0000000..6d28621
--- /dev/null
+++ b/debian/python-pelican-doc.docs
@@ -0,0 +1 @@
+build/html
diff --git a/debian/rules b/debian/rules
index 4d987f0..7b303cd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,27 @@
 #!/usr/bin/make -f
+# -*- makefile -*-
+
+export DH_VERBOSE=1
+export PYBUILD_NAME=pelican
 
 %:
-	dh $@ --with python2 --buildsystem=python_distutils
+	dh $@ --with python2,sphinxdoc  --buildsystem=pybuild
+
+
+override_dh_auto_build:
+	dh_auto_build
+	PYTHONPATH=. http_proxy='http://127.0.0.1:9/' sphinx-build -N -E -bhtml docs build/html
+	rm -rf ./build/html/.doctrees
+
+override_dh_sphinxdoc:
+ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
+	dh_sphinxdoc -ppython-pelican-doc
+endif
+
+override_dh_auto_test:
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+	dh_auto_test
+endif
 
 override_dh_clean:
 	dh_clean
@@ -10,6 +30,8 @@ override_dh_clean:
 override_dh_installchangelogs:
 	dh_installchangelogs docs/changelog.rst
 
+
+
 generate_manpages:
 	# Generate manpages using help2man
 	[ -x /usr/bin/pelican ] && help2man -N --no-discard-stderr -n "tool to generate a static blog" /usr/bin/pelican > debian/pelican.1
diff --git a/debian/watch b/debian/watch
index 08fd7ee..c01f2bc 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,2 @@
 version=3
-https://pypi.python.org/packages/source/p/pelican/pelican-(.*)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
+opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/pelican-$1\.tar\.gz/ https://github.com/getpelican/pelican/tags .*/v?(\d\S*)\.tar\.gz

Reply via email to