|
2 | 2 |
|
3 | 3 | # Load stack utils |
4 | 4 | . /usr/bin/stack-utils |
5 | | - |
| 5 | +POSTGIS_VERSION=$(curl -Ls https://github.com/postgis/postgis/tags|grep /postgis/postgis/releases/tag/ | sed -E 's/.*\/postgis\/postgis\/releases\/tag\/([0-9\.]{1,}(-rc.[0-9]{1,})?)".*/\1/g' | head -1) |
6 | 6 | # Implement build function |
7 | 7 | function build() { |
8 | 8 | # Generate binary |
9 | 9 | PG_VER=${STACK_VERSION} |
10 | 10 | PG_MAJOR=$(echo "${STACK_VERSION}"|cut -d"." -f1) |
11 | 11 |
|
12 | | - cat << EOF > /workspace/"${TARNAME}"/meta/dependencies |
| 12 | + cat << EOF > "${META_DIR}"/dependencies |
13 | 13 | binutils |
14 | 14 | gdal-bin |
15 | 15 | libproj-dev |
@@ -39,67 +39,83 @@ zlib1g |
39 | 39 | EOF |
40 | 40 |
|
41 | 41 | install-packages \ |
42 | | - clang \ |
43 | | - dirmngr \ |
44 | | - gnupg \ |
45 | | - libclang-dev \ |
46 | | - libicu-dev \ |
47 | | - libipc-run-perl \ |
48 | | - libkrb5-dev \ |
49 | | - libldap2-dev \ |
50 | | - liblz4-dev \ |
51 | | - libpam-dev \ |
52 | | - libperl-dev \ |
53 | | - libpython3-dev \ |
54 | | - libreadline-dev \ |
55 | | - libssl-dev \ |
56 | | - libxml2-dev \ |
57 | | - libxslt1-dev \ |
58 | | - llvm \ |
59 | | - llvm-dev \ |
60 | | - locales \ |
61 | | - python3-dev \ |
62 | | - tcl-dev \ |
63 | | - uuid-dev \ |
64 | | - pkg-config |
| 42 | + clang \ |
| 43 | + dirmngr \ |
| 44 | + gnupg \ |
| 45 | + libclang-dev \ |
| 46 | + libicu-dev \ |
| 47 | + libipc-run-perl \ |
| 48 | + libkrb5-dev \ |
| 49 | + libldap2-dev \ |
| 50 | + liblz4-dev \ |
| 51 | + libpam-dev \ |
| 52 | + libperl-dev \ |
| 53 | + libpython3-dev \ |
| 54 | + libreadline-dev \ |
| 55 | + libssl-dev \ |
| 56 | + libxml2-dev \ |
| 57 | + libxslt1-dev \ |
| 58 | + llvm \ |
| 59 | + llvm-dev \ |
| 60 | + locales \ |
| 61 | + python3-dev \ |
| 62 | + tcl-dev \ |
| 63 | + uuid-dev \ |
| 64 | + pkg-config \ |
| 65 | + libgdal-dev \ |
| 66 | + libgeos-dev \ |
| 67 | + libjson-c-dev \ |
| 68 | + libproj-dev \ |
| 69 | + libprotobuf-c-dev \ |
| 70 | + protobuf-c-compiler |
65 | 71 |
|
| 72 | + # postgresql |
66 | 73 | curl -sSL "https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz" | tar -xz && \ |
67 | | - cd postgresql-"${PG_VER}" && \ |
68 | | - ./configure \ |
69 | | - --prefix=/opt/drycc/postgresql/"${PG_MAJOR}" \ |
70 | | - --enable-integer-datetimes \ |
71 | | - --enable-thread-safety \ |
72 | | - --enable-tap-tests \ |
73 | | - --with-uuid=e2fs \ |
74 | | - --with-gnu-ld \ |
75 | | - --with-pgport=5432 \ |
76 | | - --with-system-tzdata=/usr/share/zoneinfo \ |
77 | | - --with-includes=/usr/local/include \ |
78 | | - --with-libraries=/usr/local/lib \ |
79 | | - --with-krb5 \ |
80 | | - --with-gssapi \ |
81 | | - --with-ldap \ |
82 | | - --with-pam \ |
83 | | - --with-tcl \ |
84 | | - --with-perl \ |
85 | | - --with-python \ |
86 | | - --with-openssl \ |
87 | | - --with-libxml \ |
88 | | - --with-libxslt \ |
89 | | - --with-icu \ |
90 | | - --with-llvm \ |
91 | | - --with-lz4 \ |
92 | | - && \ |
93 | | - # we can change from world to world-bin in newer releases |
94 | | - make world && \ |
95 | | - make install-world |
| 74 | + cd postgresql-"${PG_VER}" && \ |
| 75 | + ./configure \ |
| 76 | + --prefix=/opt/drycc/postgresql/"${PG_MAJOR}" \ |
| 77 | + --enable-integer-datetimes \ |
| 78 | + --enable-thread-safety \ |
| 79 | + --enable-tap-tests \ |
| 80 | + --with-uuid=e2fs \ |
| 81 | + --with-gnu-ld \ |
| 82 | + --with-pgport=5432 \ |
| 83 | + --with-system-tzdata=/usr/share/zoneinfo \ |
| 84 | + --with-includes=/usr/local/include \ |
| 85 | + --with-libraries=/usr/local/lib \ |
| 86 | + --with-krb5 \ |
| 87 | + --with-gssapi \ |
| 88 | + --with-ldap \ |
| 89 | + --with-pam \ |
| 90 | + --with-tcl \ |
| 91 | + --with-perl \ |
| 92 | + --with-python \ |
| 93 | + --with-openssl \ |
| 94 | + --with-libxml \ |
| 95 | + --with-libxslt \ |
| 96 | + --with-icu \ |
| 97 | + --with-llvm \ |
| 98 | + --with-lz4 \ |
| 99 | + && \ |
| 100 | + # we can change from world to world-bin in newer releases |
| 101 | + make world && \ |
| 102 | + make install-world |
| 103 | + |
| 104 | + # postgis |
| 105 | + curl -sSL "https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}.tar.gz" | tar -xz && \ |
| 106 | + cd postgis-"${POSTGIS_VERSION}" && \ |
| 107 | + ./configure \ |
| 108 | + --prefix="/opt/drycc/postgresql/${PG_MAJOR}/postgis/${POSTGIS_VERSION}" \ |
| 109 | + --with-pgconfig=/opt/drycc/postgresql/"${PG_MAJOR}"/bin/pg_config \ |
| 110 | + && \ |
| 111 | + make && \ |
| 112 | + make install |
96 | 113 |
|
97 | | - mkdir -p "${PROFILE_DIR}" |
98 | 114 | cat << EOF > "${PROFILE_DIR}/${STACK_NAME}.sh" |
99 | 115 | export PATH="/opt/drycc/postgresql/$PG_MAJOR/bin:\$PATH" |
100 | 116 | EOF |
101 | 117 | cp -rf /opt/drycc/postgresql/* "${DATA_DIR}" |
102 | | - cd ../ && rm "postgresql-${STACK_VERSION}" -rf |
| 118 | + cd /workspace && rm "postgresql-${PG_VER}" -rf |
103 | 119 | } |
104 | 120 |
|
105 | 121 | # call build stack |
|
0 commit comments