added pgsql 14

This commit is contained in:
2022-02-23 21:27:06 +02:00
parent 9899ea62fa
commit ec50cc1a5d
15 changed files with 2111 additions and 0 deletions

153
data/postgresql14/Makefile Normal file
View File

@@ -0,0 +1,153 @@
#
# $Id: Makefile 1575 2008-07-31 07:53:53Z root $
#
PORTNAME= postgresql
PORTVERSION= 14.2
CATEGORIES= databases
MASTER_SITES+= http://ftp.postgresql.org/pub/%SUBDIR%/
MASTER_SITES+= http://ftp.de.postgresql.org/%SUBDIR%/
MASTER_SITES+= ftp://ftp.digex.net/pub/packages/database/postgresql/%SUBDIR%/
MASTER_SITES+= ftp://ftp.sunet.se/pub/unix/databases/relational/postgresql/%SUBDIR%/
MASTER_SITES+= ftp://ftp.chg.ru/pub/databases/postgresql/%SUBDIR%/
MASTER_SITES+= ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,misc/db/postgresql/&,}
MASTER_SITE_SUBDIR= source/v${PORTVERSION}
DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= onborodin@gmail.com
COMMENT= A robust, next generation, object-relational DBMS
LIB_DEPENDS+= libiconv.so:text/libiconv
LIB_DEPENDS+= libintl.so:devel/gettext
#LIB_DEPENDS+= libicuuc.so:devel/libicu
USES+= tar:bzip2 gmake bison pkgconfig
PG_OWNER= pgsql
PG_OWNER_ID= 90
PG_GROUP= pgsql
PG_GROUP_ID= 90
PG_DOC_SUBDIR= doc
PG_DOC_DIR= ${PREFIX}/${PG_DOC_SUBDIR}
PG_VAR_DIR= /var
PG_DB_DIR= ${PG_VAR_DIR}/db/pgsql
PG_LOGDIR= ${PG_VAR_DIR}/log/pgsql
PG_RUN_DIR= ${PG_VAR_DIR}/run/pgsql
USES+= gmake
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc
CONFIGURE_ARGS+= --with-includes=${LOCALBASE}/include
CONFIGURE_ARGS+= --with-libraries=${LOCALBASE}/lib
CONFIGURE_ARGS+= --libdir=${PREFIX}/lib
CONFIGURE_ARGS+= --includedir=${PREFIX}/include/${PORTNAME}
CONFIGURE_ARGS+= --datarootdir=${PREFIX}/share/postgresql
CONFIGURE_ARGS+= --mandir=${PREFIX}/man
CONFIGURE_ARGS+= --infodir=${PREFIX}/info
CONFIGURE_ARGS+= --htmldir=${PREFIX}/share/doc/postgresql
CONFIGURE_ARGS+= --without-perl
CONFIGURE_ARGS+= --without-tcl
CONFIGURE_ARGS+= --without-python
CONFIGURE_ARGS+= --without-pam
CONFIGURE_ARGS+= --enable-thread-safety
CONFIGURE_ARGS+= --enable-nls
CONFIGURE_ARGS+= --with-system-tzdata=/usr/share/zoneinfo
######CONFIGURE_ARGS+= --disable-integer-datetimes
CONFIGURE_ARGS+= --with-icu
CONFIGURE_ARGS+= --enable-depend
CONFIGURE_ARGS+= --without-ldap
CONFIGURE_ARGS+= --with-openssl
#CONFIGURE_ARGS+= --with-libedit-preferred
#CFLAGS+= -I/usr/include/edit
#CPPFLAGS+= -I/usr/include/edit
CFLAGS+= -pthread
CONFIGURE_ENV+= INCLUDES="${INCLUDES}"
CONFIGURE_ENV+= PTHREAD_LIBS="-lpthread"
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
PKGINSTALL= ${WRKDIR}/pkg-install
PKGMESSAGE= ${WRKDIR}/pkg-message
SUB_FILES= pkg-install pkg-deinstall pkg-message
USE_RC_SUBR+= pgsql
PLIST_SUB+= PG_DOC_SUBDIR=${PG_DOC_SUBDIR}
SUB_LIST+= PG_OWNER=${PG_OWNER}
SUB_LIST+= PG_GROUP=${PG_GROUP}
SUB_LIST+= PG_OWNER_ID=${PG_OWNER_ID}
SUB_LIST+= PG_GROUP_ID=${PG_GROUP_ID}
SUB_LIST+= PG_DB_DIR=${PG_DB_DIR}
SUB_LIST+= PG_RUN_DIR=${PG_RUN_DIR}
SUB_LIST+= PG_LOG_DIR=${PG_LOG_DIR}
BINS+= clusterdb
BINS+= createdb
BINS+= createuser
BINS+= dropdb
BINS+= dropuser
BINS+= initdb
BINS+= reindexdb
BINS+= vacuumdb
BINS+= vacuumlo
BINS+= oid2name
BIN_PREFIX= pg_
SUB_LIST+= BIN_PREFIX=${BIN_PREFIX}
PLIST_SUB= BIN_PREFIX=${BIN_PREFIX}
_LIBS+= libecpg.a
_LIBS+= libecpg.so
_LIBS+= libecpg.so.6
_LIBS+= libecpg_compat.a
_LIBS+= libecpg_compat.so
_LIBS+= libecpg_compat.so.3
_LIBS+= libpgport.a
_LIBS+= libpgtypes.a
_LIBS+= libpgtypes.so
_LIBS+= libpgtypes.so.3
_LIBS+= libpq.a
_LIBS+= libpq.so
_LIBS+= libpq.so.5
post-patch:
${RM} -f ${WRKSRC}/src/backend/parser/gram.c
${RM} -f ${WRKSRC}/src/backend/parser/gram.h
${RM} -f ${WRKSRC}/src/interfaces/ecpg/preproc/preproc.c
${RM} -f ${WRKSRC}/src/interfaces/ecpg/preproc/preproc.h
post-build:
cd ${WRKSRC}/contrib && ${GMAKE} all
post-install:
cd ${WRKSRC}/contrib && ${GMAKE} DESTDIR=${STAGEDIR} install
cd ${WRKSRC} && ${GMAKE} DESTDIR=${STAGEDIR} install-docs
.for file in ${BINS}
cd ${STAGEDIR}/${PREFIX}/bin && ${MV} ${file} ${BIN_PREFIX}${file}
cd ${STAGEDIR}/${PREFIX}/man/man1 && ${MV} ${file}.1 ${BIN_PREFIX}${file}.1
.endfor
.for file in ${MAN1_DEL}
cd ${STAGEDIR}/${PREFIX}/man/man1 && ${RM} -f ${file}
.endfor
#post-patch:
# cd ${WRKSRC} && autoconf
.include <bsd.port.pre.mk>
.if ${OSVERSION} > 1100000
LIB_DEPENDS+= libreadline.so:devel/libreadline
.endif
.include <bsd.port.post.mk>
#EOF

View File

@@ -0,0 +1,3 @@
TIMESTAMP = 1645640481
SHA256 (postgresql-14.2.tar.bz2) = 2cf78b2e468912f8101d695db5340cf313c2e9f68a612fb71427524e8c9a977a
SIZE (postgresql-14.2.tar.bz2) = 21964841

View File

@@ -0,0 +1,14 @@
--- ./contrib/Makefile.orig 2022-02-07 23:15:36.000000000 +0200
+++ ./contrib/Makefile 2022-02-23 20:23:06.873598000 +0200
@@ -5,6 +5,11 @@
include $(top_builddir)/src/Makefile.global
SUBDIRS = \
+ oid2name \
+ vacuumlo
+
+
+NOSUBDIRS = \
adminpack \
amcheck \
auth_delay \

View File

@@ -0,0 +1,9 @@
--- ./doc/Makefile.orig 2022-02-07 23:15:36.000000000 +0200
+++ ./doc/Makefile 2022-02-23 20:23:06.819396000 +0200
@@ -12,5 +12,5 @@
top_builddir = ..
include $(top_builddir)/src/Makefile.global
-all distprep html man install installdirs uninstall clean distclean maintainer-clean:
+all distprep man install installdirs uninstall clean distclean maintainer-clean:
$(MAKE) -C src $@

View File

@@ -0,0 +1,41 @@
--- ./doc/src/sgml/Makefile.orig 2022-02-07 23:15:36.000000000 +0200
+++ ./doc/src/sgml/Makefile 2022-02-23 20:23:06.825980000 +0200
@@ -15,7 +15,7 @@
# Make "html" the default target, since that is what most people tend
# to want to use.
-html:
+man:
# We don't need the tree-wide headers or install support here.
NO_GENERATED_HEADERS=yes
@@ -26,7 +26,7 @@
include $(top_builddir)/src/Makefile.global
-all: html man
+all: man
distprep: html distprep-man
@@ -65,7 +65,6 @@
## Man pages
##
-man distprep-man: man-stamp
man-stamp: stylesheet-man.xsl postgres.sgml $(ALLSGML)
$(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
@@ -220,10 +219,10 @@
## Install
##
-install: install-html install-man
+install: install-man
installdirs:
- $(MKDIR_P) '$(DESTDIR)$(htmldir)'/html $(addprefix '$(DESTDIR)$(mandir)'/man, 1 3 $(sqlmansectnum))
+ $(MKDIR_P) $(addprefix '$(DESTDIR)$(mandir)'/man, 1 3 $(sqlmansectnum))
# If the install used a man directory shared with other applications, this will remove all files.
uninstall:

View File

@@ -0,0 +1,11 @@
--- ./src/backend/Makefile.orig 2022-02-07 23:15:36.000000000 +0200
+++ ./src/backend/Makefile 2022-02-23 20:23:06.868037000 +0200
@@ -116,6 +116,8 @@
$(top_builddir)/src/port/libpgport_srv.a: | submake-libpgport
+symlinks: $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/storage/lwlocknames.h
+
# The postgres.o target is needed by the rule in Makefile.global that
# creates the exports file when MAKE_EXPORTS = true.

View File

@@ -0,0 +1,19 @@
--- ./src/backend/jit/llvm/llvmjit_inline.cpp.orig 2022-02-07 23:15:36.000000000 +0200
+++ ./src/backend/jit/llvm/llvmjit_inline.cpp 2022-02-23 20:23:06.814278000 +0200
@@ -609,6 +609,16 @@
elog(FATAL, "failed to materialize metadata");
/*
+ * Don't inline functions with thread-local variables until
+ * related crashes are investigated (see BUG #16696)
+ */
+ if (rv->isThreadLocal()) {
+ ilog(DEBUG1, "cannot inline %s due to thread-local variable %s",
+ F.getName().data(), rv->getName().data());
+ return false;
+ }
+
+ /*
* Don't inline functions that access thread local variables. That
* doesn't work on current LLVM releases (but might in future).
*/

View File

@@ -0,0 +1,21 @@
--- ./src/backend/utils/misc/postgresql.conf.sample.orig 2022-02-07 23:15:36.000000000 +0200
+++ ./src/backend/utils/misc/postgresql.conf.sample 2022-02-23 20:23:06.850278000 +0200
@@ -430,6 +430,7 @@
# - Where to Log -
+log_destination = 'syslog'
#log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
@@ -586,7 +587,9 @@
#cluster_name = '' # added to process titles if nonempty
# (change requires restart)
-#update_process_title = on
+
+# On FreeBSD, this is a performance hog, so keep it off if you need speed
+update_process_title = off
#------------------------------------------------------------------------------

View File

@@ -0,0 +1,20 @@
--- ./src/include/storage/s_lock.h.orig 2022-02-07 23:15:36.000000000 +0200
+++ ./src/include/storage/s_lock.h 2022-02-23 20:23:06.858809000 +0200
@@ -321,7 +321,7 @@
* We use the int-width variant of the builtin because it works on more chips
* than other widths.
*/
-#if defined(__arm__) || defined(__arm) || defined(__aarch64__) || defined(__aarch64)
+#if defined(__arm__) || defined(__arm) || defined(__aarch64__) || defined(__aarch64) || defined(__riscv)
#ifdef HAVE_GCC__SYNC_INT32_TAS
#define HAS_TEST_AND_SET
@@ -338,7 +338,7 @@
#define S_UNLOCK(lock) __sync_lock_release(lock)
#endif /* HAVE_GCC__SYNC_INT32_TAS */
-#endif /* __arm__ || __arm || __aarch64__ || __aarch64 */
+#endif /* __arm__ || __arm || __aarch64__ || __aarch64 || __riscv */
/*

View File

@@ -0,0 +1,67 @@
#!/bin/sh
# PROVIDE: pgsql
# REQUIRE: LOGIN
prefix="%%PREFIX%%";
pgsql_data="%%PG_DB_DIR%%";
. /etc/rc.subr
# -i - enable internet sockets
# -l - enable ssl
pgsql_flags=" -i ";
pgsql_owner="%%PG_OWNER%%";
name="pgsql";
rcvar="pgsql_enable";
procname="${prefix}/bin/postgres";
pidfile="${pgsql_data}/postmaster.pid";
pgctl="${prefix}/bin/pg_ctl";
pgctl_args="-s -w -m fast -D ${pgsql_data} -o \"${pgsql_flags}\"";
extra_commands="initdb reload";
start_cmd="pgsql_command_start";
stop_cmd="pgsql_command_stop";
restart_cmd="pgsql_command_restart";
reload_cmd="pgsql_command_reload";
initdb_cmd="pgsql_initdb";
pgsql_command_start() {
if [ "$(check_process $procname)x" != "x" ]; then
echo "$name already running? ($(check_process $procname))";
exit 0;
fi
su ${pgsql_owner} -c "exec ${pgctl} ${pgctl_args} start" && echo "Starting pgsql.";
}
pgsql_command_stop() {
su ${pgsql_owner} -c "exec ${pgctl} ${pgctl_args} stop" && echo "Stoping pgsql.";
wait_for_pids $(check_process "$procname")
}
pgsql_command_restart() {
pgsql_command_stop;
# wait_for_pids $(check_process "$procname")
pgsql_command_start;
}
pgsql_command_reload() {
su ${pgsql_owner} -c "exec ${pgctl} ${pgctl_args} reload" && echo "Reload pgsql.";
}
pgsql_initdb() {
su ${pgsql_owner} -c "exec ${prefix}/bin//%%BIN_PREFIX%%initdb -D ${pgsql_data} -E UTF8 --locale en_GB.UTF-8 -U pgsql -W -A md5" && echo "Init pgsql database in ${pgsql_data}";
}
load_rc_config $name
: ${pgsql_enable=NO}
run_rc_command "$1"
#EOF

View File

@@ -0,0 +1,15 @@
#!/bin/sh -x
PG_OWNER="%%PG_OWNER%%"
PG_GROUP="%%PG_GROUP%%"
PG_DB_DIR="%%PG_DB_DIR%%"
case $2 in
DEINSTALL)
;;
POST-DEINSTALL)
rmdir ${PG_DB_DIR} || (ls -l ${PG_DB_DIR} ; du -sch ${PG_DB_DIR})
;;
esac
#EOF

View File

@@ -0,0 +1,30 @@
#!/bin/sh -x
PG_OWNER="%%PG_OWNER%%"
PG_GROUP="%%PG_GROUP%%"
PG_OWNER_ID="%%PG_OWNER_ID%%"
PG_GROUP_ID="%%PG_GROUP_ID%%"
PG_DB_DIR="%%PG_DB_DIR%%"
PKG__PPREFIX="/notexist"
case $2 in
PRE-INSTALL)
pw group add ${PG_GROUP} -g ${PG_GROUP_ID}
pw user add ${PG_OWNER} -u ${PG_OWNER_ID} -g ${PG_GROUP} \
-d ${PKG_PREFIX} -m -s "/bin/sh" \
-c "postgresql"
pw group mod ${PG_GROUP} -M ${PG_OWNER}
pw user show ${PG_OWNER}
pw group show ${PG_GROUP}
mkdir -p ${PG_DB_DIR}
chown ${PG_OWNER}:${PG_GROUP} ${PG_DB_DIR}
chmod 0700 ${PG_DB_DIR}
;;
POST-INSTALL)
;;
esac
#EOF

View File

@@ -0,0 +1,17 @@
***************************************************************************
1 For initialize databases area with admin %%PG_OWNER%% and base
encoding UTF8:
su %%PG_OWNER%% -c '%%PREFIX%%/bin/pg_initdb -D %%PG_DB_DIR%% \
-E UTF8 --locale en_GB.UTF-8 -U %%PG_OWNER%% -W -A md5'
2 Add user:
su %%PG_OWNER%% -c '%%PREFIX%%/bin/pg_createuser --createrole \
--superuser --createdb --pwprompt --echo username'
3 Create database:
su %%PG_OWNER%% -c '%%PREFIX%%/bin/pg_createdb db_name'
***************************************************************************

View File

@@ -0,0 +1,24 @@
PostgreSQL is a robust, next-generation, Object-Relational DBMS (ORDBMS),
derived from the Berkeley Postgres database management system. While
PostgreSQL retains the powerful object-relational data model, rich data types
and easy extensibility of Postgres, it replaces the PostQuel query language
with an extended subset of SQL.
The original Postgres code was the effort of many graduate students,
undergraduate students, and staff programmers working under the direction of
Professor Michael Stonebraker at the University of California, Berkeley. In
1995, Andrew Yu and Jolly Chen took on the task of converting the DBMS query
language to SQL and created a new database system which came to known as
Postgres95. Many others contributed to the porting, testing, debugging and
enhancement of the Postgres95 code. As the code improved, and 1995 faded into
memory, PostgreSQL was born.
PostgreSQL development is presently being performed by a team of Internet
developers who are now responsible for all current and future development. The
development team coordinator is Marc G. Fournier (scrappy@PostgreSQL.ORG).
Support is available from the PostgreSQL developer/user community through the
support mailing list (questions@PostgreSQL.ORG).
PostgreSQL is free and the complete source is available.
WWW: http://www.postgresql.org

1667
data/postgresql14/pkg-plist Normal file

File diff suppressed because it is too large Load Diff