Skip to content

Commit bd456e8

Browse files
committed
chore(postgresql): up postgresql
1 parent 53ba142 commit bd456e8

3 files changed

Lines changed: 73 additions & 97 deletions

File tree

scripts/checker.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,6 @@
133133
"owner": "containers",
134134
"match": "^v[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
135135
},
136-
"postgis": {
137-
"name": "postgis",
138-
"type": "github",
139-
"owner": "postgis",
140-
"match": "^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$",
141-
},
142136
"postgresql": {
143137
"name": "postgres",
144138
"type": "github",
@@ -322,4 +316,4 @@ def main():
322316

323317

324318
if __name__ == "__main__":
325-
main()
319+
main()

stacks/postgis/build.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

stacks/postgresql/build.sh

Lines changed: 72 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
# Load stack utils
44
. /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)
66
# Implement build function
77
function build() {
88
# Generate binary
99
PG_VER=${STACK_VERSION}
1010
PG_MAJOR=$(echo "${STACK_VERSION}"|cut -d"." -f1)
1111

12-
cat << EOF > /workspace/"${TARNAME}"/meta/dependencies
12+
cat << EOF > "${META_DIR}"/dependencies
1313
binutils
1414
gdal-bin
1515
libproj-dev
@@ -39,67 +39,83 @@ zlib1g
3939
EOF
4040

4141
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
6571

72+
# postgresql
6673
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
96113

97-
mkdir -p "${PROFILE_DIR}"
98114
cat << EOF > "${PROFILE_DIR}/${STACK_NAME}.sh"
99115
export PATH="/opt/drycc/postgresql/$PG_MAJOR/bin:\$PATH"
100116
EOF
101117
cp -rf /opt/drycc/postgresql/* "${DATA_DIR}"
102-
cd ../ && rm "postgresql-${STACK_VERSION}" -rf
118+
cd /workspace && rm "postgresql-${PG_VER}" -rf
103119
}
104120

105121
# call build stack

0 commit comments

Comments
 (0)