[gimp-help-2/gimp-help-2-6-0] [make] Change HTML packaging to provide meta files



commit 6634385d35e6010dc0a8a67b346016f98daf5f9e
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date:   Wed Sep 9 13:30:08 2009 +0200

    [make] Change HTML packaging to provide meta files

 Makefile.GNU                |   15 ++++++++++-----
 Makefile.am                 |   11 ++++++++---
 tools/Makefile.html-package |   29 +++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.GNU b/Makefile.GNU
index 2ed153b..6243435 100644
--- a/Makefile.GNU
+++ b/Makefile.GNU
@@ -753,13 +753,20 @@ $(AUTHORS_DOCBOOK_XML): $(AUTHORS_SOURCE_XML) $(AUTHORS_DOCBOOK_STYLESHEETS)
 
 tarball_prefix = gimp-help-2-html
 tarball_dir    = gimp-help-2
+HTMLMETAFILES  = README AUTHORS COPYING MAINTAINERS
 
-$(tarball_prefix)-%.tar: html/%/index.html html/%/gimp-help.xml
+#.SECONDARY: $(tarball_prefix)-%.tar
+
+$(tarball_prefix)-%.tar: html/%/index.html html/%/gimp-help.xml \
+		$(HTMLMETAFILES) tools/Makefile.html-package
 	$(msg) "Making $@ ..."
-	$(cmd) rm -rf $(tarball_dir)/html
+	$(cmd) test ! -d $(tarball_dir)
 	$(cmd) $(mkdir_p) $(tarball_dir)/html
 	$(cmd) cd $(tarball_dir)/html && $(ln_s) ../../html/$* .
-	$(cmd) tar -chf $@ $(tarball_dir)/html/$*
+	$(cmd) cp $(HTMLMETAFILES) $(tarball_dir)/
+	$(cmd) $(SED) -e '/LANGUAGE *=/s/en/$*/' \
+		tools/Makefile.html-package > $(tarball_dir)/Makefile
+	$(cmd) tar -chf $@ $(tarball_dir)/
 	$(cmd) rm -rf $(tarball_dir)
 
 $(tarball_prefix)-%.tar.gz: $(tarball_prefix)-%.tar
@@ -782,8 +789,6 @@ $(tarball_prefix)-%.zip: $(tarball_prefix)-%.tar
 	$(cmd) zip -9rq $@ $(tarball_dir)/html
 	$(cmd) rm -rf $(tarball_dir)
 
-.SECONDARY: $(tarball_prefix)-%.tar
-
 
 ########################################################################
 ####            Clean up                                            ####
diff --git a/Makefile.am b/Makefile.am
index b4040d6..2132193 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -723,14 +723,19 @@ draft-po/%.po:   preview-po/%.po   ;
 
 tarball_prefix = gimp-help-2-html
 tarball_dir    = gimp-help-2
+HTMLMETAFILES  = README AUTHORS COPYING MAINTAINERS
 
 .SECONDARY: $(tarball_prefix)-%.tar
-$(tarball_prefix)-%.tar: html/%/index.html html/%/gimp-help.xml
+$(tarball_prefix)-%.tar: html/%/index.html html/%/gimp-help.xml \
+		$(HTMLMETAFILES) tools/Makefile.html-package
 	$(msg) "Making $@ ..."
-	$(cmd) rm -rf $(tarball_dir)/html
+	$(cmd) test ! -d $(tarball_dir)
 	$(cmd) $(MKDIR_P) $(tarball_dir)/html
 	$(cmd) cd $(tarball_dir)/html && $(LN_S) ../../html/$* .
-	$(cmd) tar -chf $@ $(tarball_dir)/html/$*
+	$(cmd) cp $(HTMLMETAFILES) $(tarball_dir)/
+	$(cmd) $(SED) -e '/LANGUAGE *=/s/en/$*/' \
+		tools/Makefile.html-package > $(tarball_dir)/Makefile
+	$(cmd) tar -chf $@ $(tarball_dir)/
 	$(cmd) rm -rf $(tarball_dir)
 
 $(tarball_prefix)-%.tar.gz: $(tarball_prefix)-%.tar
diff --git a/tools/Makefile.html-package b/tools/Makefile.html-package
new file mode 100644
index 0000000..ba076f3
--- /dev/null
+++ b/tools/Makefile.html-package
@@ -0,0 +1,29 @@
+LANGUAGE    = en
+PREFIX      = /usr
+DATADIR     = $(PREFIX)/share
+GIMPDATADIR = $(shell pkg-config --variable=gimpdatadir gimp-2.0 2>/dev/null || \
+                      echo $(DATDIR)/gimp/2.0)
+DESTDIR     = 
+install_dir = install -d -m 755
+copy_r      = cp -R
+remove      = rm -rf
+
+.PHONY: help
+help:
+	@echo "Type 'make install' to install the HTML files for "
+	@echo "language '$(LANGUAGE)' to \$$DESTDIR$(GIMPDATADIR)/help/$(LANGUAGE))."
+	@echo
+	@echo "Controlling (environment) variables:"
+	@echo "    GIMPDATADIR:  $(GIMPDATADIR)"
+	@echo "    DESTDIR:      $(DESTDIR)"
+	@test -d $(GIMPDATADIR) || \
+	{ echo; echo "WARNING: $(GIMPDATADIR) does not exist!"; }
+	@echo
+
+install: html/$(LANGUAGE)
+	$(install_dir) $(DESTDIR)$(GIMPDATADIR)/help
+	$(copy_r) $< $(DESTDIR)$(GIMPDATADIR)/help
+
+uninstall:
+	test -n "$(LANGUAGE)" && \
+	$(remove) $(DESTDIR)$(GIMPDATADIR)/help/$(LANGUAGE)



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