Created
October 3, 2012 01:38
-
-
Save rnix/3824423 to your computer and use it in GitHub Desktop.
Build PostGIS on Amazon Linux AMI release 2012.03
This file contains hidden or 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
CUNIT=2.1-2 | |
CUNITD=CUnit-$(CUNIT) | |
install: required optional | |
@make -j8 -f PostGIS.makefile | |
required: | |
@sudo yum install postgresql postgresql-devel postgresql9-server libxml2-devel make gcc gcc-c++ swig automake autoconf gettext libtool git libcurl-devel numpy python-devel libxslt-devel | |
optional: CUnit | |
@sudo yum install ant docbook-utils docbook-style-xsl ImageMagick | |
CUnit: $(CUNITD)-src.tar.bz2 | |
@tar jxf $^ | |
@cd $(CUNITD); ./configure >../[email protected] 2>&1 | |
@cd $(CUNITD); make >../[email protected] 2>&1 | |
@cd $(CUNITD); sudo make install >../[email protected] 2>&1 | |
$(CUNITD)-src.tar.bz2: | |
@curl -L -o $@ 'http://downloads.sourceforge.net/project/cunit/CUnit/$(CUNIT)/$@' | |
cleandirs: | |
@make -f PostGIS.makefile cleandirs | |
clean: | |
@make -f PostGIS.makefile clean |
This file contains hidden or 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
POSTGIS=2.0.1 | |
PROJ=4.8.0 | |
GEOS=3.3.5 | |
JSON=0.10 | |
GDAL=1.9.1 | |
install: postgis | |
# | |
proj: proj-$(PROJ) | |
json-c: json-c-latest | |
geos: geos-$(GEOS) | |
gdal: gdal-$(GDAL) | |
# | |
postgis: proj geos json-c gdal postgis-$(POSTGIS) | |
postgis-$(POSTGIS): postgis-$(POSTGIS).tar.gz | |
@tar zxf $^ | |
@cd $@; ./configure >../[email protected] 2>&1 | |
@cd $@; make >../[email protected] 2>&1 | |
postgis-$(POSTGIS).tar.gz: | |
@curl --silent -LO http://postgis.refractions.net/download/$@ | |
# | |
proj-$(PROJ): proj-$(PROJ).tar.gz | |
@tar zxf $^ | |
@cd $@; ./configure >../[email protected] 2>&1 | |
@cd $@; make >../[email protected] 2>&1 | |
@cd $@; sudo make install >../[email protected] 2>&1 | |
proj-$(PROJ).tar.gz: | |
@curl --silent -LO http://download.osgeo.org/proj/$@ | |
# | |
geos-$(GEOS): geos-$(GEOS).tar.bz2 | |
@tar jxf $^ | |
@cd $@; CFLAGS=-m64 CPPFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64 FFLAGS=-m64 LDFLAGS=-L/usr/lib64/ ./configure --enable-python >../[email protected] 2>&1 | |
@cd $@; make >../[email protected] 2>&1 | |
@cd $@; sudo make install >../[email protected] 2>&1 | |
geos-$(GEOS).tar.bz2: | |
@curl --silent -LO http://download.osgeo.org/geos/$@ | |
# | |
json-c-$(JSON): json-c-$(JSON).tar.gz | |
@tar zxf $^ | |
@cd $@; ./configure >../[email protected] 2>&1 | |
@cd $@; make >../[email protected] 2>&1 | |
@cd $@; sudo make install >../[email protected] 2>&1 | |
json-c-$(JSON).tar.gz: | |
@curl --silent -LO https://github.com/downloads/json-c/json-c/$@ | |
@git clone https://github.com/json-c/json-c.git | |
json-c-latest: | |
@git clone https://github.com/json-c/json-c.git json-c-latest | |
@cd $@ ./autogen.sh >../[email protected] 2>&1 ; ./configure >../[email protected] 2>&1 | |
@cd $@; make >../[email protected] 2>&1 | |
@cd $@; sudo make install >../[email protected] 2>&1 | |
# | |
gdal-$(GDAL): gdal-$(GDAL).tar.gz | |
@tar zxf $^ | |
@cd $@; ./configure >../[email protected] 2>&1 | |
@cd $@; make >../[email protected] 2>&1 | |
@cd $@; sudo make install >../[email protected] 2>&1 | |
gdal-$(GDAL).tar.gz: | |
@curl -LO http://download.osgeo.org/gdal/$@ | |
@openssl md5 gdal-1.9.1.tar.gz | awk '{ if ($$NF == "c5cf09b92dac1f5775db056e165b34f5") exit 0; else exit 1}' | |
cleandirs: | |
find . -maxdepth 1 -type d -name '[a-z]*' -exec rm -rf {} \; | |
clean: | |
rm -rf proj-* geos-* gdal-* json-* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would say that on L38 should be tar jvf (it's a .tar.bz2 not a .tar.gz) and on L1 it's CUNIT=2.1-2 (build dir is 2.1-2 and 2.1.2 tarball doesn't exist)
-j8 seems a little bit aggressive (it brings to me some race conditions on download/compile phase, nothing to "hard" to solve), although it's better for compiling