[Python-modules-commits] r18880 - in packages/sphinx/trunk/debian (changelog rules)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Wed Oct 12 17:50:58 UTC 2011


    Date: Wednesday, October 12, 2011 @ 17:50:56
  Author: jwilk
Revision: 18880

Refactor the code responsible for moving data into a private directory.

Modified:
  packages/sphinx/trunk/debian/changelog
  packages/sphinx/trunk/debian/rules

Modified: packages/sphinx/trunk/debian/changelog
===================================================================
--- packages/sphinx/trunk/debian/changelog	2011-10-12 17:45:53 UTC (rev 18879)
+++ packages/sphinx/trunk/debian/changelog	2011-10-12 17:50:56 UTC (rev 18880)
@@ -4,8 +4,11 @@
     emitted if they ever get out of date again.
   * Make the build actually fail if integration tests for the JavaScript code
     fail.
+  * Refactor the code responsible for moving data into a private directory.
+    Rename some variables to make them lowercase. Don't use CURDIR where it's
+    not necessary.
 
- -- Jakub Wilk <jwilk at debian.org>  Wed, 12 Oct 2011 10:46:05 +0200
+ -- Jakub Wilk <jwilk at debian.org>  Wed, 12 Oct 2011 19:50:12 +0200
 
 sphinx (1.0.8+dfsg-2) unstable; urgency=low
 

Modified: packages/sphinx/trunk/debian/rules
===================================================================
--- packages/sphinx/trunk/debian/rules	2011-10-12 17:45:53 UTC (rev 18879)
+++ packages/sphinx/trunk/debian/rules	2011-10-12 17:50:56 UTC (rev 18880)
@@ -10,10 +10,8 @@
 upstream_dfsg_version = $(firstword $(subst -, ,$(debian_version)))
 upstream_version = $(firstword $(subst +, ,$(debian_version)))
 
-PACKAGE_NAME=python-sphinx
-PACKAGE_DIR=$(CURDIR)/debian/$(PACKAGE_NAME)
-SITE_PACKAGES_DIR=$(PACKAGE_DIR)$(call py_libdir,$(shell pyversions -d))
-
+debroot = debian/python-sphinx/
+site_packages = $(call py_libdir,$(shell pyversions -d))
 javascript_path = /usr/share/javascript/sphinxdoc/1.0/
 
 build-arch:
@@ -47,33 +45,36 @@
 	dh_testdir
 	dh_testroot
 	dh_installdirs
-	python setup.py install --no-compile --install-layout=deb --root $(PACKAGE_DIR)
+	python setup.py install --no-compile --install-layout=deb --root $(debroot)
 	# 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/
-	mv $(SITE_PACKAGES_DIR)/sphinx/pycode/Grammar.txt $(PACKAGE_DIR)/usr/share/sphinx/pycode/
-	cp sphinx/pycode/Grammar.pickle $(PACKAGE_DIR)/usr/share/sphinx/pycode/
-	mv $(SITE_PACKAGES_DIR)/sphinx/ext/autosummary/templates $(PACKAGE_DIR)/usr/share/sphinx/ext/autosummary/
+	cd $(debroot) && mv -t usr/share/sphinx/ .$(site_packages)/sphinx/texinputs \
+		.$(site_packages)/sphinx/themes
+	cd $(debroot) && mv -t usr/share/sphinx/pycode/ \
+		.$(site_packages)/sphinx/pycode/Grammar.txt
+	cp -t $(debroot)/usr/share/sphinx/pycode/ sphinx/pycode/Grammar.pickle
+	cd $(debroot) && mv -t usr/share/sphinx/ext/autosummary/ \
+		.$(site_packages)/sphinx/ext/autosummary/templates
 	set -e; \
-	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
+	cd $(debroot) && \
+		for lang in $$(find .$(site_packages)/sphinx/locale \
+			-maxdepth 1 -mindepth 1 -type d -printf "%f "); \
+		do \
+			mkdir -p usr/share/sphinx/locale/$$lang/; \
+			mkdir -p usr/share/locale/$$lang/LC_MESSAGES/; \
+			mv -t usr/share/sphinx/locale/$$lang/ \
+				.$(site_packages)/sphinx/locale/$$lang/LC_MESSAGES/sphinx.js; \
+			mv -t usr/share/locale/$$lang/LC_MESSAGES/ \
+				.$(site_packages)/sphinx/locale/$$lang/LC_MESSAGES/sphinx.mo; \
+			rm -rf .$(site_packages)/sphinx/locale/$$lang; \
+		done
+	rm -f $(debroot)$(site_packages)/sphinx/locale/sphinx.pot
 	# 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
+	install -m 755 sphinx-build.py $(debroot)/usr/bin/sphinx-build
+	install -m 755 sphinx-quickstart.py $(debroot)/usr/bin/sphinx-quickstart
+	install -m 755 sphinx-autogen.py $(debroot)/usr/bin/sphinx-autogen
 	# Move JavaScript code to libjs-sphinxdoc:
 	set -e; \
-	for js in $$(find $(PACKAGE_DIR)/usr/share/sphinx/themes/ -name '*.js'); do \
+	for js in $$(find $(debroot)/usr/share/sphinx/themes/ -name '*.js'); do \
 		mv $$js debian/libjs-sphinxdoc/$(javascript_path); \
 		ln -sf "$(javascript_path)/$${js##*/}" $$js; \
 	done




More information about the Python-modules-commits mailing list