Ticket #311: postgis-contrib-directory.patch

File postgis-contrib-directory.patch, 5.0 KB (added by mcayland, 2 years ago)
  • postgis/Makefile.in

     
    1111# ********************************************************************** 
    1212 
    1313MODULE_big=postgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@ 
     14MODULEDIR=contrib/$(MODULE_big) 
    1415 
    1516# Files to be copied to the contrib/ directory 
    1617DATA_built=postgis.sql uninstall_postgis.sql postgis_upgrade_15_minor.sql postgis_upgrade_14_to_15.sql postgis_upgrade_13_to_15.sql 
     
    7879PGXS := @PGXS@ 
    7980include $(PGXS) 
    8081 
     82# PGXS override feature. The ability to allow PostGIS to install itself 
     83# in a versioned directory is only available in PostgreSQL >= 8.5. To 
     84# do this by default on older PostgreSQL versions, we need to override 
     85# the existing PGXS targets. 
     86# 
     87# Once PostgreSQL 8.5 becomes the minimum supported version, this entire 
     88# section and its associated Makefile.pgxs should be removed. 
     89PGXSOVERRIDE = @PGXSOVERRIDE@ 
     90ifeq ($(PGXSOVERRIDE),1) 
     91        include Makefile.pgxs 
     92endif 
     93 
    8194# If REGRESS=1 passed as a parameter, change the default install paths 
    8295# so that no prefix is included. This allows us to relocate to a temporary 
    8396# directory for regression testing. 
  • postgis/Makefile.pgxs

     
     1# 
     2# PostGIS PGXS override file for PostgreSQL <= 8.5 
     3# (updates relevant targets for MODULEDIR as per the 
     4# PostgreSQL 8.5 PGXS Makefile) 
     5# 
     6 
     7ifdef MODULEDIR 
     8datamoduledir = $(MODULEDIR) 
     9docmoduledir = $(MODULEDIR) 
     10else 
     11datamoduledir = contrib 
     12docmoduledir = contrib 
     13endif 
     14 
     15install: all installdirs 
     16ifneq (,$(DATA)$(DATA_built)) 
     17        @for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \ 
     18          echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \ 
     19          $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \ 
     20        done 
     21endif # DATA 
     22ifneq (,$(DATA_TSEARCH)) 
     23        @for file in $(addprefix $(srcdir)/, $(DATA_TSEARCH)); do \ 
     24          echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'"; \ 
     25          $(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'; \ 
     26        done 
     27endif # DATA_TSEARCH 
     28ifdef MODULES 
     29        @for file in $(addsuffix $(DLSUFFIX), $(MODULES)); do \ 
     30          echo "$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'"; \ 
     31          $(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'; \ 
     32        done 
     33endif # MODULES 
     34ifdef DOCS 
     35ifdef docdir 
     36        @for file in $(addprefix $(srcdir)/, $(DOCS)); do \ 
     37          echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'"; \ 
     38          $(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'; \ 
     39        done 
     40endif # docdir 
     41endif # DOCS 
     42ifdef PROGRAM 
     43        $(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)' 
     44endif # PROGRAM 
     45ifdef SCRIPTS 
     46        @for file in $(addprefix $(srcdir)/, $(SCRIPTS)); do \ 
     47          echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \ 
     48          $(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \ 
     49        done 
     50endif # SCRIPTS 
     51ifdef SCRIPTS_built 
     52        @for file in $(SCRIPTS_built); do \ 
     53          echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \ 
     54          $(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \ 
     55        done 
     56endif # SCRIPTS_built 
     57 
     58installdirs: 
     59ifneq (,$(DATA)$(DATA_built)) 
     60        $(mkinstalldirs) '$(DESTDIR)$(datadir)/$(datamoduledir)' 
     61endif 
     62ifneq (,$(DATA_TSEARCH)) 
     63        $(mkinstalldirs) '$(DESTDIR)$(datadir)/tsearch_data' 
     64endif 
     65ifneq (,$(MODULES)) 
     66        $(mkinstalldirs) '$(DESTDIR)$(pkglibdir)' 
     67endif 
     68ifdef DOCS 
     69ifdef docdir 
     70        $(mkinstalldirs) '$(DESTDIR)$(docdir)/$(docmoduledir)' 
     71endif # docdir 
     72endif # DOCS 
     73ifneq (,$(PROGRAM)$(SCRIPTS)$(SCRIPTS_built)) 
     74        $(mkinstalldirs) '$(DESTDIR)$(bindir)' 
     75endif 
     76 
     77uninstall: 
     78ifneq (,$(DATA)$(DATA_built)) 
     79        rm -f $(addprefix '$(DESTDIR)$(datadir)/$(datamoduledir)'/, $(notdir $(DATA) $(DATA_built))) 
     80endif 
     81ifneq (,$(DATA_TSEARCH)) 
     82        rm -f $(addprefix '$(DESTDIR)$(datadir)/tsearch_data'/, $(notdir $(DATA_TSEARCH))) 
     83endif 
     84ifdef MODULES 
     85        rm -f $(addprefix '$(DESTDIR)$(pkglibdir)'/, $(addsuffix $(DLSUFFIX), $(MODULES))) 
     86endif 
     87ifdef DOCS 
     88        rm -f $(addprefix '$(DESTDIR)$(docdir)/$(docmoduledir)'/, $(DOCS)) 
     89endif 
     90ifdef PROGRAM 
     91        rm -f '$(DESTDIR)$(bindir)/$(PROGRAM)$(X)' 
     92endif 
     93ifdef SCRIPTS 
     94        rm -f $(addprefix '$(DESTDIR)$(bindir)'/, $(SCRIPTS)) 
     95endif 
     96ifdef SCRIPTS_built 
     97        rm -f $(addprefix '$(DESTDIR)$(bindir)'/, $(SCRIPTS_built)) 
     98endif 
     99 
  • configure.ac

     
    306306        fi 
    307307fi       
    308308 
     309dnl Temporary hack until minimum PostgreSQL version is 8.5: 
     310dnl If PostgreSQL < 8.5 is detected, trigger the inclusion of the new versioned PGXS targets 
     311PGXSOVERRIDE=0 
     312if test ! "$PGSQL_MINOR_VERSION" -ge 5; then 
     313        PGXSOVERRIDE=1 
     314fi 
     315 
     316AC_SUBST([PGXSOVERRIDE]) 
     317 
    309318dnl Note: We don't need the server-side LDFLAGS or CPPFLAGS because we get these from PGXS  
    310319 
    311320dnl Extract the linker and include flags for the frontend (for programs that use libpq)