1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/quilt/quilt.make
include /usr/share/python/python.mk
PACKAGE_NAME=python-sphinx
PACKAGE_DIR=$(CURDIR)/debian/$(PACKAGE_NAME)
SITE_PACKAGES_DIR=$(PACKAGE_DIR)$(call py_libdir,$(shell pyversions -d))
build: build-stamp
build-stamp: patch
dh_testdir
# documentation cannot be easily built with move_static_files_outside_site-packages applied, so pop it:
quilt pop
mkdir -p _build/html
python sphinx-build.py doc _build/html
quilt push
touch build-stamp
clean: clean-patched unpatch
dh_testdir
dh_testroot
find . -name '*.py[co]' -delete
rm -rf _build build
dh_clean sphinx/pycode/*.pickle
clean-patched: patch
dh_testdir
python setup.py clean
install: build patch
dh_testdir
dh_testroot
dh_installdirs
python setup.py install --no-compile --install-layout=deb --root $(PACKAGE_DIR)
# move static files outside {site,dist}-packages
mv $(SITE_PACKAGES_DIR)/sphinx/texinputs $(PACKAGE_DIR)/usr/share/sphinx/
mv $(SITE_PACKAGES_DIR)/sphinx/themes $(PACKAGE_DIR)/usr/share/sphinx/
for lang in `find $(SITE_PACKAGES_DIR)/sphinx/locale\
-maxdepth 1 -mindepth 1 -type d -printf "%f "`;\
do\
mkdir $(PACKAGE_DIR)/usr/share/sphinx/locale/$$lang;\
mkdir -p $(PACKAGE_DIR)/usr/share/locale/$$lang/LC_MESSAGES;\
mv $(SITE_PACKAGES_DIR)/sphinx/locale/$$lang/LC_MESSAGES/sphinx.js\
$(PACKAGE_DIR)/usr/share/sphinx/locale/$$lang/;\
mv $(SITE_PACKAGES_DIR)/sphinx/locale/$$lang/LC_MESSAGES/sphinx.mo\
$(PACKAGE_DIR)/usr/share/locale/$$lang/LC_MESSAGES;\
rm -rf $(SITE_PACKAGES_DIR)/sphinx/locale/$$lang;\
done
rm -f $(SITE_PACKAGES_DIR)/sphinx/locale/sphinx.pot
# use packaged jQuery
dh_link /usr/share/javascript/jquery/jquery.js \
/usr/share/sphinx/themes/basic/static/jquery.js
# install scripts not touched by easy install
install -m 755 $(CURDIR)/sphinx-build.py $(PACKAGE_DIR)/usr/bin/sphinx-build
install -m 755 $(CURDIR)/sphinx-quickstart.py $(PACKAGE_DIR)/usr/bin/sphinx-quickstart
install -m 755 $(CURDIR)/sphinx-autogen.py $(PACKAGE_DIR)/usr/bin/sphinx-autogen
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs CHANGES
dh_installdocs
rm -rf $(PACKAGE_DIR)/usr/share/doc/python-sphinx/html/.doctrees
dh_link /usr/share/doc/python-sphinx/html/_sources/ /usr/share/doc/python-sphinx/rst
dh_installexamples
dh_installman
dh_pysupport
dh_compress -X.py -X.js -X.rst -X.json -X.doctree -X.txt
dh_link /usr/share/javascript/jquery/jquery.js \
/usr/share/doc/python-sphinx/html/_static/jquery.js
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary-arch: build install
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|