-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Makefile to the distribution so that 'sudo make install' and 's…
…udo make uninstall' commands respectively installs and uninstalls E-Maj. The components are installed into the Postgres installation directories. More precisely: 1) the SQL scripts are copied into a <PG_SHAREDIR>/emaj subdirectory, the emaj.control file is created into the regular <PG_SHAREDIR>/extension directory, 2) the 4 clients components are installed in the <PG_BINDIR> directory and 3) the distributed documentation is copied into the <PG_DOCDIR>/emaj subdirectory. The distribution can also be installed/uninstalled using the pgxn client. Note that the standart PGXS mechanism has not been used because it fails to uninstall documentation and client files coming from subdirectories. However, the Makefile uses the same files locations as PGXS. The documentation is updated to reflect the new installation procedure. (Many thanks to David Wheeler for the reported issue and his valuable advice)
- Loading branch information
Showing
9 changed files
with
168 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# File: Makefile | ||
# E-Maj extension | ||
|
||
# This Makefile doesn't use PGXS because PGXS fails to remove all doc and bin | ||
# files at uninstall time when these files come from subdirectories. | ||
# But it places the components at the same place, as if we had: | ||
# EXTENSION = emaj | ||
# MODULEDIR = emaj | ||
# DATA = $(wildcard sql/*) | ||
# DOCS = $(wildcard doc/*) | ||
# SCRIPTS = $(wildcard client/*) | ||
# PG_CONFIG ?= pg_config | ||
# PGXS := $(shell $(PG_CONFIG) --pgxs) | ||
# include $(PGXS) | ||
|
||
PG_CONFIG ?= pg_config | ||
PG_SHAREDIR := $(shell $(PG_CONFIG) --sharedir) | ||
PG_BINDIR := $(shell $(PG_CONFIG) --bindir) | ||
PG_DOCDIR := $(shell $(PG_CONFIG) --docdir) | ||
|
||
all: | ||
|
||
install: | ||
mkdir -p $(PG_SHAREDIR)/extension | ||
mkdir -p $(PG_SHAREDIR)/emaj | ||
mkdir -p $(PG_DOCDIR)/emaj | ||
cp sql/* $(PG_SHAREDIR)/emaj/. | ||
sed -r "s|^#directory\s+=.*$$|directory = 'emaj'|" emaj.control >$(PG_SHAREDIR)/extension/emaj.control | ||
-cp doc/* $(PG_DOCDIR)/emaj/. | ||
cp client/* $(PG_BINDIR)/. | ||
|
||
uninstall: | ||
rm -f $(PG_BINDIR)/emaj* | ||
rm -rf $(PG_DOCDIR)/emaj | ||
rm -rf $(PG_SHAREDIR)/emaj | ||
rm -f $(PG_SHAREDIR)/extension/emaj.control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters