Re: Add subdirectory support for DATA/DOCS with PGXS

Поиск
Список
Период
Сортировка
От Mark Cave-Ayland
Тема Re: Add subdirectory support for DATA/DOCS with PGXS
Дата
Msg-id 4B41F253.1090606@siriusit.co.uk
обсуждение исходный текст
Ответ на Re: Add subdirectory support for DATA/DOCS with PGXS  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Add subdirectory support for DATA/DOCS with PGXS  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

> Why do DOCS still go into doc/contrib?  Shouldn't that become
> doc/$MODULEDIR for consistency?

Hmmm it looks as if the code was correct but I missed the comment at the
top of the file. Sorry for the confusion - revised version attached.


ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index a83dad3..76b585f 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -19,11 +19,14 @@
 #
 #   MODULES -- list of shared objects to be build from source file with
 #     same stem (do not include suffix in this list)
-#   DATA -- random files to install into $PREFIX/share/contrib
-#   DATA_built -- random files to install into $PREFIX/share/contrib,
+#   MODULEDIR -- subdirectory under contrib into which DATA and DOCS are
+#     installed (if not set, DATA and DOCS files are installed directly
+#     into the contrib/ directory)
+#   DATA -- random files to install into $PREFIX/share/$MODULEDIR
+#   DATA_built -- random files to install into $PREFIX/share/$MODULEDIR,
 #     which need to be built first
 #   DATA_TSEARCH -- random files to install into $PREFIX/share/tsearch_data
-#   DOCS -- random files to install under $PREFIX/doc/contrib
+#   DOCS -- random files to install under $PREFIX/doc/$MODULEDIR
 #   SCRIPTS -- script files (not binaries) to install into $PREFIX/bin
 #   SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
 #     which need to be built first
@@ -86,12 +89,19 @@ include $(top_srcdir)/src/Makefile.shlib
 all: all-lib
 endif # MODULE_big

+ifndef MODULEDIR
+datamoduledir = contrib
+docmoduledir = contrib
+else
+datamoduledir = $(MODULEDIR)
+docmoduledir = $(MODULEDIR)
+endif

 install: all installdirs
 ifneq (,$(DATA)$(DATA_built))
     @for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \
-      echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/contrib'"; \
-      $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/contrib'; \
+      echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \
+      $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \
     done
 endif # DATA
 ifneq (,$(DATA_TSEARCH))
@@ -109,8 +119,8 @@ endif # MODULES
 ifdef DOCS
 ifdef docdir
     @for file in $(addprefix $(srcdir)/, $(DOCS)); do \
-      echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/contrib'"; \
-      $(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/contrib'; \
+      echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'"; \
+      $(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'; \
     done
 endif # docdir
 endif # DOCS
@@ -137,7 +147,7 @@ endif # MODULE_big

 installdirs:
 ifneq (,$(DATA)$(DATA_built))
-    $(MKDIR_P) '$(DESTDIR)$(datadir)/contrib'
+    $(MKDIR_P) '$(DESTDIR)$(datadir)/$(datamoduledir)'
 endif
 ifneq (,$(DATA_TSEARCH))
     $(MKDIR_P) '$(DESTDIR)$(datadir)/tsearch_data'
@@ -147,7 +157,7 @@ ifneq (,$(MODULES))
 endif
 ifdef DOCS
 ifdef docdir
-    $(MKDIR_P) '$(DESTDIR)$(docdir)/contrib'
+    $(MKDIR_P) '$(DESTDIR)$(docdir)/$(docmoduledir)'
 endif # docdir
 endif # DOCS
 ifneq (,$(PROGRAM)$(SCRIPTS)$(SCRIPTS_built))
@@ -161,7 +171,7 @@ endif # MODULE_big

 uninstall:
 ifneq (,$(DATA)$(DATA_built))
-    rm -f $(addprefix '$(DESTDIR)$(datadir)'/contrib/, $(notdir $(DATA) $(DATA_built)))
+    rm -f $(addprefix '$(DESTDIR)$(datadir)'/$(datamoduledir)/, $(notdir $(DATA) $(DATA_built)))
 endif
 ifneq (,$(DATA_TSEARCH))
     rm -f $(addprefix '$(DESTDIR)$(datadir)'/tsearch_data/, $(notdir $(DATA_TSEARCH)))
@@ -170,7 +180,7 @@ ifdef MODULES
     rm -f $(addprefix '$(DESTDIR)$(pkglibdir)'/, $(addsuffix $(DLSUFFIX), $(MODULES)))
 endif
 ifdef DOCS
-    rm -f $(addprefix '$(DESTDIR)$(docdir)'/contrib/, $(DOCS))
+    rm -f $(addprefix '$(DESTDIR)$(docdir)'/$(docmoduledir)/, $(DOCS))
 endif
 ifdef PROGRAM
     rm -f '$(DESTDIR)$(bindir)/$(PROGRAM)$(X)'

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: pgsql: When estimating the selectivity of an inequality "column >
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: invalid UTF-8 via pl/perl