monotone-commits-diffs
[Top][All Lists]
Advanced

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

[Monotone-commits-diffs] net.venge.monotone: abb05cc0eb02ed802750e82f1f


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: abb05cc0eb02ed802750e82f1f6c679f4e189ec6
Date: Fri, 18 Feb 2011 20:54:28 +0100 (CET)

revision:            abb05cc0eb02ed802750e82f1f6c679f4e189ec6
date:                2011-02-13T06:41:11
author:              Richard Levitte <address@hidden>
branch:              net.venge.monotone
changelog:
* Makefile.am (EXTRA_DIST): Because files in this variables are not
  installed, and we want to install the contrib, examples and extra
  directories, we need to have a different structure for them.
  (contribdir, contrib_prefix, contrib_data, examplesdir,
  examples_prefix, examples_data, extradir, extra_prefix, extra_data):
  New variables describing the files to be installed and in what
  directories.  {foo}dir and {foo}_DATA would have been sufficient if
  automake knew how to make targets to install a complete directory
  structure.  Unfortunately, automake doesn't, so we have to make our
  own, in a way that's close to what automake generates...
  (_install_data,_uninstall_data): Two variables containing the
  installation commands for any target that needs installed and
  uninstalled.  They should be called using the GNU make $(call)
  interface.
  ({install,uninstall}-{contrib,examples,extra}-data): New targets that
  do the actual installation and uninstallation of the directories
  contrib, examples and extra.
  (install-data-local, uninstall-local): Make these targets depend on the
  install and uninstall targets just mentioned.

manifest:
format_version "1"

new_manifest [30a289853a7d57a5a5e15403c48bbfbd0ac93e74]

old_revision [70d247ccc28541a9d9141ae8218912d68e77504e]

patch "Makefile.am"
 from [3b700e329823f0db098d6069d12c51bbfa181dbe]
   to [3cef20117aabcbf07317e8971e452201f764c244]
============================================================
--- Makefile.am	3b700e329823f0db098d6069d12c51bbfa181dbe
+++ Makefile.am	3cef20117aabcbf07317e8971e452201f764c244
@@ -324,6 +324,18 @@ endif
 
 # extra files
 
+extradir = $(docdir)/extra
+extra_prefix = extra
+extra_data = $(shell cd $(srcdir); find $(extra_prefix) | sed -e 's,^\./,,')
+
+contribdir = $(docdir)/contrib
+contrib_prefix = contrib
+contrib_data = $(shell cd $(srcdir); find $(contrib_prefix) | sed -e 's,^\./,,')
+
+examplesdir = $(docdir)/examples
+examples_prefix = examples
+examples_data = $(shell cd $(srcdir); find $(examples_prefix) | sed -e 's,^\./,,')
+
 EXTRA_DIST =								\
 	HACKING INSTALL INSTALL_windows_cygwin.txt			\
 	INSTALL_windows_native.txt README.visualc8 UPGRADE		\
@@ -346,7 +358,7 @@ EXTRA_DIST =								\
 									\
 	src/package_revision.txt src/package_full_revision_dist.txt	\
 									\
-	extra contrib examples mac notes visualc
+	mac notes visualc
 
 # Message translation support
 # INST_LINGUAS is set by configure, based on the po/LINGUAS file and
@@ -444,6 +456,54 @@ endif
 
 endif
 
+_install_data = \
+	list='$(1)'; test -n "$(3)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  src=""; \
+	  dest="`if [ "$$p" != "$(2)" ]; then echo $$p | sed -e 's,$(2)/,,'; fi`"; \
+	  if test -d "$$src"; then \
+	    echo " $(MKDIR_P) '$(DESTDIR)$(3)/$$dest'"; \
+	    $(MKDIR_P) "$(DESTDIR)$(3)/$$dest" || exit $$?; \
+	  else \
+	    echo " $(INSTALL_DATA) $$src '$(DESTDIR)$(3)/$$dest'"; \
+	    $(INSTALL_DATA) $$src "$(DESTDIR)$(3)/$$dest" || exit $$?; \
+	  fi; \
+	done
+_uninstall_data = \
+	list='$(1)'; test -n "$(3)" || list=; \
+	dirs_rev=; \
+	for p in $$list; do \
+	  to_rm="`if [ "$$p" != "$(2)" ]; then echo $$p | sed -e 's,$(2)/,,'; fi`"; \
+	  if [ -n "$$to_rm" ]; then \
+	    if test -d "$(DESTDIR)$(3)/$$to_rm"; then \
+	      dirs_rev="echo '$$to_rm';$${dirs_rev}"; \
+	    else \
+	      echo " rm -f '$(DESTDIR)$(3)/$$to_rm'"; \
+	      rm -f $$src "$(DESTDIR)$(3)/$$to_rm" || exit $$?; \
+	    fi; \
+	  fi; \
+	done; \
+	eval "$$dirs_rev" | while read to_rmdir; do \
+	  echo " rmdir '$(DESTDIR)$(3)/$$to_rmdir'"; \
+	  rmdir "$(DESTDIR)$(3)/$$to_rmdir" || exit $$?; \
+	done
+
+install-extra-data: $(extra_data)
+	@$(call _install_data,$(extra_data),$(extra_prefix),$(extradir))
+uninstall-extra-data:
+	@$(call _uninstall_data,$(extra_data),$(extra_prefix),$(extradir))
+
+install-contrib-data: $(contrib_data)
+	@$(call _install_data,$(contrib_data),$(contrib_prefix),$(contribdir))
+uninstall-contrib-data:
+	@$(call _uninstall_data,$(contrib_data),$(contrib_prefix),$(contribdir))
+
+install-examples-data: $(examples_data)
+	@$(call _install_data,$(examples_data),$(examples_prefix),$(examplesdir))
+uninstall-examples-data:
+	@$(call _uninstall_data,$(examples_data),$(examples_prefix),$(examplesdir))
+
 # build an OS X installer
 # requires sudo since packagemaker just looks at directory permissions.
 PKG_INST_ROOT = $(PWD)/$(top_builddir)/pkg_inst_root
@@ -753,8 +813,10 @@ all-local: all-nls
 # the things we want to do.  This is to support multiple things to do in
 # each of them, as dependencies.
 all-local: all-nls
-install-data-local: install-nls
-uninstall-local: uninstall-nls
+install-data-local: install-nls \
+	install-extra-data install-contrib-data install-examples-data
+uninstall-local: uninstall-nls \
+	uninstall-extra-data uninstall-contrib-data uninstall-examples-data
 mostlyclean-local: mostlyclean-tests
 check-local: check-testers
 # All hooks supported by automake here, depending on all the things we want

reply via email to

[Prev in Thread] Current Thread [Next in Thread]