mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Teach pgxs.mk and Install.pm how to install files from a contrib module
into SHAREDIR/tsearch_data. Use this instead of ad-hoc coding in dict_xsyn/Makefile. Should fix current ContribCheck failures on MSVC.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
# PGXS: PostgreSQL extensions makefile
|
||||
|
||||
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.10 2007/06/26 22:05:04 tgl Exp $
|
||||
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.11 2007/10/16 15:59:59 tgl Exp $
|
||||
|
||||
# This file contains generic rules to build many kinds of simple
|
||||
# extension modules. You only need to set a few variables and include
|
||||
@ -22,6 +22,7 @@
|
||||
# DATA -- random files to install into $PREFIX/share/contrib
|
||||
# DATA_built -- random files to install into $PREFIX/share/contrib,
|
||||
# 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
|
||||
# SCRIPTS -- script files (not binaries) to install into $PREFIX/bin
|
||||
# SCRIPTS_built -- script files (not binaries) to install into $PREFIX/bin,
|
||||
@ -97,6 +98,12 @@ ifneq (,$(DATA)$(DATA_built))
|
||||
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/contrib'; \
|
||||
done
|
||||
endif # DATA
|
||||
ifneq (,$(DATA_TSEARCH))
|
||||
@for file in $(addprefix $(srcdir)/, $(DATA_TSEARCH)); do \
|
||||
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'"; \
|
||||
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'; \
|
||||
done
|
||||
endif # DATA_TSEARCH
|
||||
ifdef MODULES
|
||||
@for file in $(addsuffix $(DLSUFFIX), $(MODULES)); do \
|
||||
echo "$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'"; \
|
||||
@ -135,6 +142,9 @@ installdirs:
|
||||
ifneq (,$(DATA)$(DATA_built))
|
||||
$(mkinstalldirs) '$(DESTDIR)$(datadir)/contrib'
|
||||
endif
|
||||
ifneq (,$(DATA_TSEARCH))
|
||||
$(mkinstalldirs) '$(DESTDIR)$(datadir)/tsearch_data'
|
||||
endif
|
||||
ifneq (,$(MODULES)$(MODULE_big))
|
||||
$(mkinstalldirs) '$(DESTDIR)$(pkglibdir)'
|
||||
endif
|
||||
@ -152,6 +162,9 @@ uninstall:
|
||||
ifneq (,$(DATA)$(DATA_built))
|
||||
rm -f $(addprefix '$(DESTDIR)$(datadir)'/contrib/, $(notdir $(DATA) $(DATA_built)))
|
||||
endif
|
||||
ifneq (,$(DATA_TSEARCH))
|
||||
rm -f $(addprefix '$(DESTDIR)$(datadir)'/tsearch_data/, $(notdir $(DATA_TSEARCH)))
|
||||
endif
|
||||
ifdef MODULES
|
||||
rm -f $(addprefix '$(DESTDIR)$(pkglibdir)'/, $(addsuffix $(DLSUFFIX), $(MODULES)))
|
||||
endif
|
||||
|
@ -3,7 +3,7 @@ package Install;
|
||||
#
|
||||
# Package that provides 'make install' functionality for msvc builds
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.23 2007/10/03 13:20:40 mha Exp $
|
||||
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.24 2007/10/16 16:00:00 tgl Exp $
|
||||
#
|
||||
use strict;
|
||||
use warnings;
|
||||
@ -317,6 +317,20 @@ sub CopyContribFiles
|
||||
}
|
||||
}
|
||||
|
||||
$flist = '';
|
||||
if ($mf =~ /^DATA_TSEARCH\s*=\s*(.*)$/m) {$flist .= $1}
|
||||
if ($flist ne '')
|
||||
{
|
||||
$flist = ParseAndCleanRule($flist, $mf);
|
||||
|
||||
foreach my $f (split /\s+/,$flist)
|
||||
{
|
||||
lcopy('contrib/' . $d . '/' . $f,$target . '/share/tsearch_data/' . basename($f))
|
||||
|| croak("Could not copy file $f in contrib $d");
|
||||
print '.';
|
||||
}
|
||||
}
|
||||
|
||||
$flist = '';
|
||||
if ($mf =~ /^DOCS\s*=\s*(.*)$/mg) {$flist .= $1}
|
||||
if ($flist ne '')
|
||||
|
Reference in New Issue
Block a user