[nautilus-actions] Distribute admon-* icons with HTML documents



commit 5101c1026dbabdb095b4a94a2c5ce45ef8fd4ea0
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Dec 1 19:04:01 2010 +0100

    Distribute admon-* icons with HTML documents
    
    This is a workaround against bug #636175.

 ChangeLog            |    7 +++++
 doc/nact/.gitignore  |    2 -
 doc/nact/Makefile.am |   73 +++++++++++++++++++++++++++++++++++++------------
 3 files changed, 62 insertions(+), 20 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c3f84f2..7af22f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
+2010-12-01 Pierre Wieser <pwieser trychlos org>
+
+	* doc/nact/Makefile.am:
+	Distribute admon-* icons with html docs	(workaround for #636175).
+
 2010-11-30 Pierre Wieser <pwieser trychlos org>
 
+	* doc/nact/Makefile.am: Only rebuild manuals when needed.
+
 	* src/plugin-menu/nautilus-actions.c (create_menu_item):
 	Set a unique name per target menu so that icons are displayed even
 	when both toolbar and location context menu are targeted.
diff --git a/doc/nact/.gitignore b/doc/nact/.gitignore
index eeb1c78..3ddad32 100644
--- a/doc/nact/.gitignore
+++ b/doc/nact/.gitignore
@@ -5,5 +5,3 @@ de/html
 de/nautilus-actions-config-tool.xml
 es/html
 es/nautilus-actions-config-tool.xml
-all-html-manuals
-all-pdf-manuals
diff --git a/doc/nact/Makefile.am b/doc/nact/Makefile.am
index b46e7a3..de45e74 100644
--- a/doc/nact/Makefile.am
+++ b/doc/nact/Makefile.am
@@ -148,12 +148,14 @@ dist-hook: doc-dist-hook dist-html-manuals-hook dist-pdf-manuals-hook dist-manua
 #   files will be created, then is considered as the output filename
 # -d0: nochunks
 # The produced output is very close of what Yelp gives, with in particular
-# summaries in each chapter while db2html does not produce them.
+# a summary in each chapter while db2html does not produce them.
 # As of v 0.20.1:
-# - there is no icon for notes and tips.
+# - there is no icon for notes and tips (see #636175).
 # - does not produce the legal and abstract sections in top of the document
 # - does not honor external links: they are converted to simple links
 #   which target the same frame window.
+# gnome-doc-tool is so our preferred tool for its proximity with Yelp
+# and the summary in top of the chapters.
 #
 # db2html --nochunks nautilus-actions-config-tool.xml
 # Generate the html document(s) in a nautilus-actions-config-tool/
@@ -164,10 +166,18 @@ dist-hook: doc-dist-hook dist-html-manuals-hook dist-pdf-manuals-hook dist-manua
 #   which target the same frame window.
 
 if ENABLE_HTML_MANUALS
+all-html-manuals: html.stamp
+else
+all-html-manuals:
+endif
+
 # _DOC_LC_DOCS is the list of the translated (not C) DOC_MODULE.xml files
 # we so are sure that they exist and are up to date
 # (path is .po ->[msgfmt]-> .mo ->[xml2po]-> .xml)
-all-html-manuals: $(_DOC_LC_DOCS)
+#
+# - do not use '--copy_graphics' here (see #636175)
+# - admon-* icons will be installed in admon/ subdir
+html.stamp: $(_DOC_LC_DOCS)
 	@-for i in C $(_DOC_REAL_LINGUAS); do \
 		(cd $$i; \
 		 if test "x$(WITH_DB2HTML)" = "xyes"; then \
@@ -186,14 +196,12 @@ all-html-manuals: $(_DOC_LC_DOCS)
 			cmd="gnome-doc-tool html -o html -d0 $(DOC_MODULE).xml"; \
 			echo "$$cmd"; \
 			$$cmd; \
+			sed -i -e 's?url("admon?url("admon/admon?' html/$(DOC_MODULE).html; \
 		 fi; \
 		 chmod -R u+w html; \
 		); \
 	done
-	touch all-html-manuals
-else
-all-html-manuals:
-endif
+	touch html.stamp
 
 # Install HTML manuals if they exist (do not try to rebuild them)
 # in <htmldir>/<lang>/nact/ subdirectory; htmldir defaulting
@@ -201,8 +209,7 @@ endif
 #
 # Note that we do not honor here the --with-html-dir gtk-doc option,
 # but the --htmldir autotools one
-
-install-html-manuals: install-html-figs
+install-html-manuals: all-html-manuals install-html-figs install-html-admon
 	for lc in C $(_DOC_REAL_LINGUAS); do \
 		if test "x$(htmldir)" = "x$(docdir)"; then \
 			_instdir="$(DESTDIR)$(pkgdocdir)/html/$$lc/nact"; \
@@ -210,7 +217,9 @@ install-html-manuals: install-html-figs
 			_instdir="$(DESTDIR)$(htmldir)/$$lc/nact"; \
 		fi; \
 		_srcdir="$(top_builddir)/doc/nact/$$lc/html"; \
-		cp -vrp $$_srcdir/* $$_instdir/; \
+		if test -f "$$_srcdir/$(DOC_MODULE).html"; then \
+			cp -vrp $$_srcdir/* $$_instdir/; \
+		fi; \
 	done
 
 # copied from gnome-doc-utils.make install-doc-figs target
@@ -245,6 +254,26 @@ install-html-figs:
 	  fi; \
 	done
 
+# A workaround against the bug #636175 (do not install admon-* icons)
+# Only works when gnome-doc-utils is installed on the station
+# Install icons in the html/ dir
+admon_dir := /usr/share/gnome-doc-utils/icons/hicolor/48x48/status
+admon_png := $(wildcard $(admon_dir)/*.png)
+install-html-admon:
+	if test -d "$(admon_dir)"; then \
+		if test "x$(htmldir)" = "x$(docdir)"; then \
+			_instdir="$(DESTDIR)$(pkgdocdir)/html"; \
+		else \
+			_instdir="$(DESTDIR)$(htmldir)"; \
+		fi; \
+		for lc in C $(_DOC_REAL_LINGUAS); do \
+			if test -f "$(top_builddir)/doc/nact/$$lc/html/$(DOC_MODULE).html"; then \
+				$(mkinstalldirs) "$$_instdir/$$lc/nact/admon"; \
+				cp -v $(admon_png) "$$_instdir/$$lc/nact/admon/"; \
+			fi; \
+		done; \
+	fi
+
 uninstall-html-manuals:
 	if test "x$(htmldir)" = "x$(docdir)"; then \
 		_instdir="$(DESTDIR)$(pkgdocdir)/html"; \
@@ -255,11 +284,17 @@ uninstall-html-manuals:
 
 # locale figures (_DOC_LC_FIGURES) are distributed by gnome-doc-utils
 # when they exist
-dist-html-manuals-hook:
+#
+# - distribute admon-* icons
+dist-html-manuals-hook: all-html-manuals
 	for lc in C $(_DOC_REAL_LINGUAS); do \
 		if test -f $(top_builddir)/doc/nact/$$lc/html/$(DOC_MODULE).html; then \
 			cp -rpv $(top_builddir)/doc/nact/$$lc/html $(distdir)/$$lc/; \
 		fi; \
+		if test -d "$(admon_dir)"; then \
+			$(mkinstalldirs) "$(distdir)/$$lc/html/admon"; \
+			cp -v $(admon_png) "$(distdir)/$$lc/html/admon/"; \
+		fi; \
 	done
 
 # Build pdf manuals as <lang>/<module>.pdf
@@ -267,10 +302,15 @@ dist-html-manuals-hook:
 # We only use dblatex for now
 
 if ENABLE_PDF_MANUALS
+all-pdf-manuals: pdf.stamp
+else
+all-pdf-manuals:
+endif
+
 # _DOC_LC_DOCS is the list of the translated (not C) DOC_MODULE.xml files
 # we so are sure that they exist and are up to date
 # (path is .po ->[msgfmt]-> .mo ->[xml2po]-> .xml)
-all-pdf-manuals: $(_DOC_LC_DOCS)
+pdf.stamp: $(_DOC_LC_DOCS)
 	@-for lc in C $(_DOC_REAL_LINGUAS); do \
 		_target=$$lc/$(DOC_MODULE).pdf; \
 		echo "Generating $$_target ..."; \
@@ -293,16 +333,13 @@ all-pdf-manuals: $(_DOC_LC_DOCS)
 		  for i in `find $$lc/figures -type l`; do rm -f $$i; done; \
 		fi; \
 	done
-	touch all-pdf-manuals
-else
-all-pdf-manuals:
-endif
+	touch pdf.stamp
 
 # if --pdfdir has not been specified, then we default to PKGDOCDIR/pdf
 # in all case, we append the locale as a subdirectory level
 #
 # as pdf are monobloc documents, we do not create a per-document subdir
-install-pdf-manuals:
+install-pdf-manuals: all-pdf-manuals
 	@-for lc in C $(_DOC_REAL_LINGUAS); do \
 		_srcdir=$(top_builddir)/doc/nact/$$lc; \
 		if test "$(pdfdir)" = "$(docdir)"; then \
@@ -323,7 +360,7 @@ uninstall-pdf-manuals:
 	fi; \
 	rm -fr $$_instdir
 
-dist-pdf-manuals-hook:
+dist-pdf-manuals-hook: all-pdf-manuals
 	for _lc in C $(_DOC_REAL_LINGUAS); do \
 		cp -v $(top_builddir)/doc/nact/$$_lc/$(DOC_MODULE).pdf $(distdir)/$$_lc/ || :; \
 	done



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]