diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-02-11 22:53:43 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-02-11 22:53:43 -0500 |
commit | 24d1280c4d75038f130495a25844c60d6810faab (patch) | |
tree | c651beccc87a06729abe3c88c62a8f634d451bf9 /src/makefiles | |
parent | 1214749901fc3c66732cfd9f276b989635c01360 (diff) | |
download | postgresql-24d1280c4d75038f130495a25844c60d6810faab.tar.gz |
Clean up installation directory choices for extensions.
Arrange for the control files to be in $SHAREDIR/extension not
$SHAREDIR/contrib, since we're generally trying to deprecate the term
"contrib" and this is a once-in-many-moons opportunity to get rid of it in
install paths. Fix PGXS to install the $EXTENSION file into that directory
no matter what MODULEDIR is set to; a nondefault MODULEDIR should only
affect the script and secondary extension files. Fix the control file
directory parameter to be interpreted relative to $SHAREDIR, to avoid a
surprising disconnect between how you specify that and what you set
MODULEDIR to.
Per discussion with David Wheeler.
Diffstat (limited to 'src/makefiles')
-rw-r--r-- | src/makefiles/pgxs.mk | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index 655c5f9e38..412bf5c930 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -25,9 +25,10 @@ # # The following variables can also be set: # -# MODULEDIR -- subdirectory into which EXTENSION, DATA and DOCS files -# should be installed (if not set, default is "contrib") # EXTENSION -- name of extension (there must be a $EXTENSION.control file) +# MODULEDIR -- subdirectory of $PREFIX/share into which DATA and DOCS files +# should be installed (if not set, default is "extension" if EXTENSION +# is set, or "contrib" if not) # 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 @@ -72,11 +73,16 @@ override CFLAGS += $(CFLAGS_SL) endif ifdef MODULEDIR -datamoduledir = $(MODULEDIR) -docmoduledir = $(MODULEDIR) +datamoduledir := $(MODULEDIR) +docmoduledir := $(MODULEDIR) else -datamoduledir = contrib -docmoduledir = contrib +ifdef EXTENSION +datamoduledir := extension +docmoduledir := extension +else +datamoduledir := contrib +docmoduledir := contrib +endif endif ifdef PG_CPPFLAGS @@ -96,8 +102,14 @@ endif # MODULE_big install: all installdirs -ifneq (,$(DATA)$(DATA_built)$(EXTENSION)) - @for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built) $(addsuffix .control, $(EXTENSION)); do \ +ifneq (,$(EXTENSION)) + @for file in $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))); do \ + echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \ + $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \ + done +endif # EXTENSION +ifneq (,$(DATA)$(DATA_built)) + @for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \ echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \ $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \ done @@ -168,8 +180,11 @@ endif # MODULE_big uninstall: -ifneq (,$(DATA)$(DATA_built)$(EXTENSION)) - rm -f $(addprefix '$(DESTDIR)$(datadir)/$(datamoduledir)'/, $(notdir $(DATA) $(DATA_built) $(addsuffix .control, $(EXTENSION)))) +ifneq (,$(EXTENSION)) + rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(addsuffix .control, $(EXTENSION)))) +endif +ifneq (,$(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))) |