Project

General

Profile

« Previous | Next » 

Revision 6333

root Makefile: PostgreSQL: postgres-*: Factored postgresql.conf installation out in to $(postgresReload-*)

View differences:

Makefile
149 149
sleep 2
150 150
endef
151 151

  
152
postgres-Linux: _always
153
	-sudo apt-get install postgresql
154
	-sudo apt-get install postgresql-plpython3-$(pgVersion)
155
	-sudo apt-get install libpq-dev
156
	-sudo apt-get install postgresql-$(pgVersion)-postgis
157
	-sudo apt-get install phppgadmin
158
	$(editPhppgadminApacheConf)
159
	$(editApacheConfForPhppgadmin)
160
	$(if $(nonApacheOnPort80),$(editApachePortsConf))
161
	-sudo apache2ctl restart
162
	-sudo pip install psycopg2
163
	$(asAdmin) cp --preserve=timestamps schemas/postgresql.conf $(linuxPostgresDir)/postgresql.conf
164
	$(call pg_ctl-Linux,restart)
165
# run pg_version inline because it needs postgresql to be installed first
166
# ignore errors if conf files already edited
167

  
168 152
macPostgresDir := /Library/PostgreSQL/9.1
169 153
define macUsePostgresLib
170 154
sudo mv $(libDest) $(libDest).old||sudo rm -f $(libDest)
......
182 166
sleep 2
183 167
endef
184 168

  
169
define postgresReload-Linux
170
$(asAdmin) cp --preserve=timestamps schemas/postgresql.conf $(linuxPostgresDir)/postgresql.conf
171
$(call pg_ctl-Linux,restart)
172

  
173
endef
174

  
175
define postgresReload-Darwin
176
$(asAdmin) cp schemas/postgresql.Mac.conf $(macPostgresDir)/data/postgresql.conf
177
$(call pg_ctl-Darwin,restart)
178

  
179
endef
180

  
181
postgres-Linux: _always
182
	-sudo apt-get install postgresql
183
	-sudo apt-get install postgresql-plpython3-$(pgVersion)
184
	-sudo apt-get install libpq-dev
185
	-sudo apt-get install postgresql-$(pgVersion)-postgis
186
	-sudo apt-get install phppgadmin
187
	$(editPhppgadminApacheConf)
188
	$(editApacheConfForPhppgadmin)
189
	$(if $(nonApacheOnPort80),$(editApachePortsConf))
190
	-sudo apache2ctl restart
191
	-sudo pip install psycopg2
192
	$(postgresReload-Linux)
193
# run pg_version inline because it needs postgresql to be installed first
194
# ignore errors if conf files already edited
195

  
185 196
postgres-Darwin: _always
186 197
	@echo $(emph)'Installing PostgreSQL on Mac OS X:'$(endEmph)
187 198
	@echo 'Download it using the topmost "Mac OS X" link at http://http://www.enterprisedb.com/products-services-training/pgdownload'
......
189 200
	@echo 'Run the installer in it'
190 201
	@$(wait)
191 202
	$(foreach lib,$(macPostgresLibs),$(call macUsePostgresLib,$(lib)))
192
	$(asAdmin) cp schemas/postgresql.Mac.conf $(macPostgresDir)/data/postgresql.conf
193
	$(call pg_ctl-Darwin,restart)
203
	$(postgresReload-Darwin)
194 204

  
195 205
postgres-: _always ; # other OSes
196 206

  

Also available in: Unified diff