blob: bcdb500b536e7999423c1d3e6b79963f782cef7c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
|
# Template file for 'postgresql15'
pkgname=postgresql15
version=15.8
revision=2
build_style=gnu-configure
make_build_target=world
_major="${version%%.*}"
_prefix="usr/lib/psql${_major}"
_sysconfdir="etc/psql${_major}"
configure_args="--with-openssl --with-python
--with-pam --enable-thread-safety
--with-perl --with-tcl --without-ldap --without-gssapi
--without-bonjour --with-libxml --with-libxslt
--with-system-tzdata=/usr/share/zoneinfo --enable-nls --with-uuid=e2fs"
hostmakedepends="docbook2x gettext flex openjade"
makedepends="libfl-devel openssl-devel libuuid-devel libxslt-devel pam-devel perl
python3-devel readline-devel tcl-devel"
short_desc="Sophisticated open-source Object-Relational DBMS"
maintainer="Piotr Wójcik <chocimier@tlen.pl>"
license="PostgreSQL"
homepage="https://www.postgresql.org"
changelog="https://www.postgresql.org/docs/current/release-${version//./-}.html"
distfiles="https://ftp.postgresql.org/pub/source/v${version}/postgresql-${version}.tar.bz2"
checksum=4403515f9a69eeb3efebc98f30b8c696122bfdf895e92b3b23f5b8e769edcb6a
make_check=ci-skip # Postgres server can't be run as root
conf_files="
/${_sysconfdir}/default/postgresql
/${_sysconfdir}/pam.d/postgresql
/${_sysconfdir}/postgresql/postgresql.conf
"
alternatives="
postgresql:/usr/bin/initdb:/usr/lib/psql15/bin/initdb
postgresql:/usr/bin/pg_amchec:/usr/lib/psql15/bin/pg_amcheck
postgresql:/usr/bin/pg_archivecleanup:/usr/lib/psql15/bin/pg_archivecleanup
postgresql:/usr/bin/pg_basebackup:/usr/lib/psql15/bin/pg_basebackup
postgresql:/usr/bin/pg_checksums:/usr/lib/psql15/bin/pg_checksums
postgresql:/usr/bin/pg_controldata:/usr/lib/psql15/bin/pg_controldata
postgresql:/usr/bin/pg_ctl:/usr/lib/psql15/bin/pg_ctl
postgresql:/usr/bin/pg_receivewal:/usr/lib/psql15/bin/pg_receivewal
postgresql:/usr/bin/pg_recvlogical:/usr/lib/psql15/bin/pg_recvlogical
postgresql:/usr/bin/pg_resetwal:/usr/lib/psql15/bin/pg_resetwal
postgresql:/usr/bin/pg_rewind:/usr/lib/psql15/bin/pg_rewind
postgresql:/usr/bin/pg_test_fsync:/usr/lib/psql15/bin/pg_test_fsync
postgresql:/usr/bin/pg_test_timing:/usr/lib/psql15/bin/pg_test_timing
postgresql:/usr/bin/pg_upgrade:/usr/lib/psql15/bin/pg_upgrade
postgresql:/usr/bin/pg_verifybackup:/usr/lib/psql15/bin/pg_verifybackup
postgresql:/usr/bin/pg_waldump:/usr/lib/psql15/bin/pg_waldump
postgresql:/usr/bin/pgbench:/usr/lib/psql15/bin/pgbench
postgresql:/usr/bin/postgres:/usr/lib/psql15/bin/postgres
postgresql:/usr/bin/postmaster:/usr/lib/psql15/bin/postmaster
"
# Create 'postgres' user for the server.
system_accounts="postgres"
postgres_homedir="/var/lib/postgresql"
postgres_shell="/bin/sh"
postgres_descr="PostgreSQL database server user"
make_dirs="
/var/lib/postgresql 0750 postgres postgres
/var/lib/postgresql${_major} 0750 postgres postgres"
if [ "$CROSS_BUILD" ]; then
configure_args+=" --without-perl --without-python --without-tcl"
fi
post_patch() {
cp "$FILESDIR"/pg_config.sh.in src/common/pg_config.sh.in
_substitute src/common/pg_config.sh.in
vsed -i -e "s,@XBPS_SYSROOT@,${XBPS_CROSS_BASE%/}," src/common/Makefile
}
pre_configure() {
_style_configure_args="${configure_args}"
configure_args=" "
for arg in ${_style_configure_args}; do
case $arg in
--prefix=*|*dir=*) : ;; # skip
*) configure_args+=" $arg"
esac
done
configure_args="--prefix=/${_prefix}
--sysconfdir=/${_sysconfdir}
--includedir=/usr/include
${configure_args}"
}
post_build() {
make -C contrib ${makejobs}
}
pre_check() {
ln -sr tmp_install/${_prefix} /${_prefix%/*}
}
post_install() {
vmkdir usr/share/man
cp -r doc/src/sgml/man? ${DESTDIR}/usr/share/man
for i in ${DESTDIR}/usr/share/man/*[^3]/*; do
mv $i ${i%.*}-${_major}.${i##*.}
done
vmkdir ${_prefix}/share/doc
cp -r doc/src/sgml/html ${DESTDIR}/${_prefix}/share/doc
vsv ${pkgname}
find "${DESTDIR}/etc/sv" -type f -exec sed -i -e s:@VERSION@:${_major}: -e s:@PREFIX@:${_prefix}: '{}' ';'
vlicense COPYRIGHT
vinstall ${FILESDIR}/postgresql.confd 644 ${_sysconfdir}/default postgresql
_substitute ${DESTDIR}/${_sysconfdir}/default/postgresql
vinstall ${FILESDIR}/postgresql.pam 644 ${_sysconfdir}/pam.d postgresql
_substitute ${DESTDIR}/${_sysconfdir}/pam.d/postgresql
vinstall ${DESTDIR}/${_prefix}/share/postgresql/postgresql.conf.sample \
644 ${_sysconfdir}/postgresql postgresql.conf
vbin src/common/pg_config.sh
vsed -i 's/install_bin = .*/install_bin = install/g' \
${DESTDIR}/${_prefix}/lib/postgresql/pgxs/src/Makefile.global
}
_substitute() {
sed -i "$1" -e s:@PREFIX@:${_prefix}: -e s:@VERSION@:${_major}: -e s:@FULL_VERSION@:${version}:
}
postgresql15-doc_package() {
short_desc="PostgreSQL documentation"
pkg_install() {
vmove ${_prefix}/share/doc
}
}
postgresql15-libs-devel_package() {
depends="postgresql-libs>=${version}_${revision} openssl-devel"
short_desc="PostgreSQL shared libraries (development files)"
conflicts="postgresql9.6-libs-devel>=0 postgresql12-libs-devel>=0 postgresql13-libs-devel>=0 postgresql14-libs-devel>=0"
pkg_install() {
# postgresql-libs
vmove "${_prefix}/lib/*.so*"
for d in $(find ${DESTDIR}/${_prefix}/share/locale \
-type f -name libpq5\*); do
mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
done
rm -r "${PKGDESTDIR}/${_prefix}"
# postgresql-libs-devel
vmkdir usr/bin
vmkdir usr/lib
for f in pg_config ecpg; do
vmove ${_prefix}/bin/${f}
vmove "usr/share/man/man1/$(basename ${f})*"
ln -sr "${PKGDESTDIR}/${_prefix}/bin/${f}" "${PKGDESTDIR}/usr/bin"
done
vmove usr/bin/pg_config.sh
vmove usr/include
vmove "${_prefix}/lib/*.a"
mv "${DESTDIR}/${_prefix}/lib/pkgconfig" "${PKGDESTDIR}/usr/lib"
vmove usr/share/man/man3
vmove ${_prefix}/lib/postgresql/pgxs
for f in libpq.so libpgtypes.so libecpg_compat.so libecpg.so; do
ln -sr "${PKGDESTDIR}/usr/lib/${f}" "${PKGDESTDIR}/${_prefix}/lib"
done
for d in $(find ${DESTDIR}/${_prefix}/share/locale \
-type f -name pg_config\* -o -name ecpg\*); do
mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
done
}
}
# XXX disabled for now in cross builds.
if [ -z "$CROSS_BUILD" ]; then
postgresql15-plperl_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc="PL/Perl procedural language for PostgreSQL"
pkg_install() {
vmove "${_prefix}/lib/postgresql/plperl*"
for d in $(find ${DESTDIR}/${_prefix}/share/locale \
-type f -name plperl\*); do
mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
done
}
}
postgresql15-plpython_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc="PL/Python procedural language for PostgreSQL"
pkg_install() {
vmove "${_prefix}/lib/postgresql/plpython*"
for d in $(find ${DESTDIR}/${_prefix}/share/locale \
-type f -name plpython\*); do
mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
done
}
}
postgresql15-pltcl_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc="PL/Tcl procedural language for PostgreSQL"
pkg_install() {
vmove "${_prefix}/lib/postgresql/pltcl*"
for d in $(find ${DESTDIR}/${_prefix}/share/locale \
-type f -name pltcl\*); do
mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
done
}
}
fi # !CROSS_BUILD
postgresql15-client_package() {
short_desc="Client frontends programs for PostgreSQL"
alternatives="
postgresql-client:/usr/bin/clusterdb:/usr/lib/psql15/bin/clusterdb
postgresql-client:/usr/bin/createdb:/usr/lib/psql15/bin/createdb
postgresql-client:/usr/bin/createuser:/usr/lib/psql15/bin/createuser
postgresql-client:/usr/bin/dropdb:/usr/lib/psql15/bin/dropdb
postgresql-client:/usr/bin/dropuser:/usr/lib/psql15/bin/dropuser
postgresql-client:/usr/bin/pg_dump:/usr/lib/psql15/bin/pg_dump
postgresql-client:/usr/bin/pg_dumpall:/usr/lib/psql15/bin/pg_dumpall
postgresql-client:/usr/bin/pg_isready:/usr/lib/psql15/bin/pg_isready
postgresql-client:/usr/bin/pg_restore:/usr/lib/psql15/bin/pg_restore
postgresql-client:/usr/bin/psql:/usr/lib/psql15/bin/psql
postgresql-client:/usr/bin/reindexdb:/usr/lib/psql15/bin/reindexdb
postgresql-client:/usr/bin/vacuumdb:/usr/lib/psql15/bin/vacuumdb
"
pkg_install() {
for f in clusterdb createdb createuser dropdb \
dropuser pg_dump pg_dumpall pg_isready pg_restore psql reindexdb \
vacuumdb; do
vmove ${_prefix}/bin/${f}
vmove usr/share/man/man1/$(basename ${f})-${_major}.1
done
vmove usr/share/man/man7
for d in $(find ${DESTDIR}/${_prefix}/share/locale \
-type f -name pgscripts\* -o \
-name psql\* -o \
-name pg_dump\*); do
mkdir -p ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
mv ${d} ${PKGDESTDIR}/$(dirname ${d#${DESTDIR}})
done
mv ${DESTDIR}/${_prefix}/share/postgresql/psqlrc.* \
${PKGDESTDIR}/${_prefix}/share
}
}
postgresql15-contrib_package() {
alternatives="
postgresql-contrib:/usr/bin/oid2name:/usr/lib/psql15/bin/oid2name
postgresql-contrib:/usr/bin/vacuumlo:/usr/lib/psql15/bin/vacuumlo
"
short_desc="PostgreSQL contributed programs and extensions"
pkg_install() {
make -C contrib install DESTDIR=${PKGDESTDIR}
mv ${PKGDESTDIR}/usr/include ${PKGDESTDIR}/${_prefix}
}
}
|