From 847a6c37a13850c6a2bbe785b7b7a602cfc51621 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 13 Jul 2012 21:34:33 -0400 Subject: [PATCH] I've been meaning to play more with PostgreSQL ...so here goes. --- postgresql/installation/.gitignore | 8 +++++++ postgresql/installation/Makefile | 36 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 postgresql/installation/.gitignore create mode 100644 postgresql/installation/Makefile diff --git a/postgresql/installation/.gitignore b/postgresql/installation/.gitignore new file mode 100644 index 0000000..bd9a169 --- /dev/null +++ b/postgresql/installation/.gitignore @@ -0,0 +1,8 @@ +/bin/ +/data/ +/include/ +/lib/ +/postgresql-9.1.4.tar.bz2 +/postgresql-9.1.4/ +/share/ +/log/ diff --git a/postgresql/installation/Makefile b/postgresql/installation/Makefile new file mode 100644 index 0000000..73b33d9 --- /dev/null +++ b/postgresql/installation/Makefile @@ -0,0 +1,36 @@ +HERE := $(PWD) +DOWNLOAD_ROOT := http://ftp.postgresql.org/pub/source/ +PG_VERSION := 9.1.4 +TARBALL_BASENAME := postgresql-$(PG_VERSION) +TARBALL_URL := $(DOWNLOAD_ROOT)/v$(PG_VERSION)/$(TARBALL_BASENAME).tar.bz2 + +all: $(HERE)/bin/pg_ctl $(HERE)/data $(HERE)/log + +start: $(HERE)/bin/pg_ctl $(HERE)/data $(HERE)/log + $(HERE)/bin/pg_ctl start -D $(HERE)/data -l $(HERE)/log/postgres.log + +stop: $(HERE)/bin/pg_ctl $(HERE)/data $(HERE)/log + $(HERE)/bin/pg_ctl stop -D $(HERE)/data + +restart: $(HERE)/bin/pg_ctl $(HERE)/data $(HERE)/log + $(HERE)/bin/pg_ctl restart -D $(HERE)/data + +$(TARBALL_BASENAME).tar.bz2: + curl -L -O $(TARBALL_URL) + +$(TARBALL_BASENAME): $(TARBALL_BASENAME).tar.bz2 + tar xjvf $< + +$(TARBALL_BASENAME)/Makefile: $(TARBALL_BASENAME) + cd $< && ./configure --prefix=$(HERE) + +$(HERE)/bin/postgres: $(TARBALL_BASENAME)/Makefile + cd $(TARBALL_BASENAME) && \ + make && \ + make install + +$(HERE)/data: + mkdir -p $@ + +$(HERE)/log: + mkdir -p $@