posgresql port (from freebsd)

most of major bugs cleaned, some of the smaller ones.
openbsd profile sent to the patches mailist.
This commit is contained in:
mickey 1997-11-20 20:34:05 +00:00
parent fba21c1eee
commit 11b1f7d292
15 changed files with 604 additions and 0 deletions

View File

@ -0,0 +1,114 @@
# New ports collection makefile for: PostgreSQL
# Version required: 6.1
# Date created: November 19, 1997
# Whom: mickey
# from: Marc G. Fournier <scrappy@FreeBSD.ORG>
#
# $OpenBSD: Makefile,v 1.1 1997/11/20 20:34:05 mickey Exp $
DISTNAME= postgresql-6.2.1
CATEGORIES= databases
MASTER_SITES= ftp://ftp.PostgreSQL.org/pub/ \
ftp://ftp.luga.or.at/pub/postgres95/ \
ftp://ftp.jaist.ac.jp/pub/dbms/postgres95/
MAINTAINER= mickey@openbsd.org
# if you want to use the tcl/tk frontend pgaccess, then you need to build
# postgresql with tcl support by typing: make USE_TCL=yes
.if defined(USE_TCL)
MAKE_ENV+= USE_TCL=true TCL_INCDIR=${PREFIX}/include/tcl8.0
LIB_DEPENDS= tcl80\\.1\\.:${PORTSDIR}/lang/tcl80
.endif
NO_PACKAGE= "Requires pgsql uid"
WRKSRC= ${WRKDIR}/${DISTNAME}/src
USE_GMAKE= YES
MAKEFILE= GNUmakefile
HAS_CONFIGURE= YES
CONFIGURE_ARGS+=--prefix=${PREFIX}/pgsql \
--enable-locale \
--with-template=freebsd
# --with-template=`uname -s | ${TR} '[A-Z]' '[a-z]'`
MAN1= cleardbdir.1 createdb.1 createuser.1 destroydb.1 \
destroyuser.1 initdb.1 ipcclean.1 monitor.1 pg_dump.1 \
pg_dumpall.1 pg_passwd.1 pgintro.1 postgres.1 \
postmaster.1 psql.1
MAN3= catalogs.3 large_objects.3 libpq.3 oracle_compat.3 pgbuiltin.3
MAN5= bki.5 page.5 pg_hba.conf.5
MANL= abort.l alter_table.l begin.l close.l cluster.l \
commit.l copy.l create_aggregate.l create_database.l \
create_function.l create_index.l create_operator.l \
create_rule.l create_sequence.l create_table.l \
create_trigger.l create_type.l create_version.l \
create_view.l declare.l delete.l drop.l drop_aggregate.l \
drop_database.l drop_function.l drop_index.l drop_operator.l \
drop_rule.l drop_sequence.l drop_table.l drop_trigger.l \
drop_type.l drop_view.l end.l explain.l fetch.l grant.l \
insert.l listen.l load.l move.l notify.l purge.l rename.l \
reset.l revoke.l rollback.l select.l set.l show.l sql.l \
update.l vacuum.l
MANPREFIX= ${PREFIX}/pgsql
pre-fetch:
.if !defined(USE_TCL)
@${ECHO_MSG} "To build the \"PostgreSQL to Tcl interface library\", libpgtcl, type:"
@${ECHO_MSG} " make USE_TCL=yes"
.else
@${ECHO_MSG} "Building PostgreSQL with \"libpgtcl\"."
.endif
post-build:
@ ${ECHO} "------------------------------------------------------------"
@ ${ECHO} "Dump existing databases, before installing new db version !!"
@ ${ECHO} "Detailed instructions, see INSTALL file under ${WRKDIR}... "
@ ${ECHO} "------------------------------------------------------------"
pre-install:
@ ${MKDIR} ${PREFIX}/pgsql
@ ${SETENV} ${MAKE_ENV} perl ${SCRIPTDIR}/createuser
post-install:
@ if [ ! -f ${PREFIX}/pgsql/.profile ]; then \
${ECHO} "PATH=${PATH}:${PREFIX}/pgsql/bin" \
> ${PREFIX}/pgsql/.profile; \
${ECHO} "MANPATH=${MANPATH}:${PREFIX}/pgsql/bin" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "PGLIB=${PREFIX}/pgsql/lib" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "# note: PGDATA overwrites the -D startup option" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "PGDATA=${PREFIX}/pgsql/data" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "DISPLAY=:0" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "export PATH MANPATH PGLIB PGDATA DISPLAY" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "# if you want to make regression tests use this TZ" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "#TZ=PST8PDT" \
>> ${PREFIX}/pgsql/.profile; \
${ECHO} "#export TZ" \
>> ${PREFIX}/pgsql/.profile; \
fi
@ chown -R pgsql:pgsql ${PREFIX}/pgsql
@ ${ECHO} 'Initializing PostgreSQL Databases - this may take a few minutes...'
@ ${LDCONFIG} -m ${PREFIX}/pgsql/lib
@ su -l pgsql -c '${PREFIX}/pgsql/bin/initdb --pglib=${PREFIX}/pgsql/lib --pgdata=${PREFIX}/pgsql/data'
@ ${SED} -e "s=!!PREFIX!!=${PREFIX}=g" < ${FILESDIR}/pgsql.sh.tmpl \
> ${PREFIX}/etc/rc.pgsql
@ chmod 554 ${PREFIX}/etc/rc.pgsql
@ chown root.pgsql ${PREFIX}/etc/rc.pgsql
@ ${INSTALL_DATA} ${FILESDIR}/post-install-notes ${PREFIX}/pgsql
.if !defined(NOPORTDOCS)
${MKDIR} ${PREFIX}/share/doc/pgsql
${CP} -r ${WRKDIR}/${DISTNAME}/doc/* ${PREFIX}/share/doc/pgsql
.endif
.if !defined(BATCH)
@ more -e ${FILESDIR}/post-install-notes
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (postgresql-6.2.1.tar.gz) = bd606dcab6b09a3a3d276d88b504a1d3

View File

@ -0,0 +1,26 @@
#!/bin/sh
# $OpenBSD: pgsql.sh.tmpl,v 1.1 1997/11/20 20:34:06 mickey Exp $
# from Id: pgsql.sh.tmpl,v 1.3 1997/10/05 21:00:49 andreas Exp
# pgsql.sh - postgresql startup file for FreeBSD and possibly *BSD (untested)
# Changes:
# - renamed startup script to be in sync with INSTALL file
# - merged ldconfig start sequence from former postgrsql.sh script (andreas)
# - modified the postmaster startup sequence as suggested in the
# INSTALL file which was given as example for FreeBSD 2.2 (andreas)
# - removed the commandline option
# -D!!PREFIX!!/pgsql/data \
# because the postmaster process, which starts up under the
# environment of the pgsql user, sets this with the PGDATA
# environment variable in !!PREFIX!!/pgsql/.profile
#
[ -d !!PREFIX!!/pgsql/lib ] && /sbin/ldconfig -m !!PREFIX!!/pgsql/lib
[ -x !!PREFIX!!/pgsql/bin/postmaster ] && {
su -l pgsql -c 'exec !!PREFIX!!/pgsql/bin/postmaster \
-S -o -F > !!PREFIX!!/pgsql/errlog'
echo -n ' pgsql'
}

View File

@ -0,0 +1,13 @@
Now that PostgreSQL is installed, you should read the documentation and
implementation guides. These can be found at:
http://www.PostgreSQL.org/docs
You may wish to subscribe to the PostgreSQL user-support mailing list.
Send an e-mail to pgsql-questions-request@postgresql.org with the
text "subscribe" in the message body.
If you build PostgreSQL with TCL support, then you can use the
TCL/TK based database frontend "pgaccess" for database operations.

View File

@ -0,0 +1,10 @@
--- bin/initdb/initdb.sh.orig Wed Apr 2 07:09:13 1997
+++ bin/initdb/initdb.sh Wed Apr 2 07:09:33 1997
@@ -344,6 +344,5 @@
if [ $debug -eq 0 ]; then
echo "vacuuming template1"
- echo "vacuum" | postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "^DEBUG:"
+ echo "vacuum" | postgres -o /dev/null -F -Q -D$PGDATA template1 > /dev/null
fi

View File

@ -0,0 +1,29 @@
--- configure.orig Wed Nov 19 17:53:21 1997
+++ configure Wed Nov 19 17:53:08 1997
@@ -576,7 +576,7 @@
sunos*) PORTNAME='sunos4' ;;
linux*) PORTNAME='linux' ;;
bsdi*) PORTNAME='bsdi' ;;
- freebsd*|netbsd*) PORTNAME='BSD44_derived';;
+ freebsd*|netbsd*|openbsd*) PORTNAME='BSD44_derived';;
dgux*) PORTNAME='dgux';;
aix*) PORTNAME='aix';;
nextstep*) PORTNAME='nextstep';;
@@ -691,7 +691,7 @@
echo "enter 'none' or new directories to override default"
echo ""
$ECHO_N "Additional directories to search for include files { $SRCH_INC }: $ECHO_C"
-read a
+a=$SRCH_INC
if test "$a." = "none."
then
SRCH_INC=
@@ -708,7 +708,7 @@
echo "- setting CPPFLAGS=$CPPFLAGS"
$ECHO_N "Additional directories to search for library files { $SRCH_LIB }: $ECHO_C"
-read a
+a=$SRCH_LIB
if test "$a." = "none."
then
SRCH_LIB=

View File

@ -0,0 +1,12 @@
--- template/openbsd Sat Jun 14 20:13:06 1997
+++ /dev/null Sat Jun 14 20:12:51 1997
@@ -0,0 +1,9 @@
+AROPT:cq
+SHARED_LIB:-fpic -DPIC
+CFLAGS:-pipe -O2
+SRCH_INC:/usr/local/include
+SRCH_LIB:/usr/local/lib
+USE_LOCALE:yes
+DLSUFFIX:.so
+YFLAGS:-d
+YACC:

View File

@ -0,0 +1,26 @@
--- Makefile.global.in.orig Sat Oct 4 23:21:46 1997
+++ Makefile.global.in Sat Oct 4 23:27:22 1997
@@ -162,15 +162,15 @@
# USE_TCL= true
# customize these to your site's needs
#
-TCL_INCDIR= /home/tools/include
-TCL_LIBDIR= /home/tools/lib
-TCL_LIB= -ltcl7.5
-TK_INCDIR= /home/tools/include
-TK_LIBDIR= /home/tools/lib
-TK_LIB= -ltk4.1
+TCL_INCDIR= /usr/local/include/tcl8.0
+TCL_LIBDIR= /usr/local/lib
+TCL_LIB= -ltcl80
+TK_INCDIR= /usr/local/include/tk8.0
+TK_LIBDIR= /usr/local/lib
+TK_LIB= -ltk80
-X11_INCDIR= /usr/include
-X11_LIBDIR= /usr/lib
+X11_INCDIR= /usr/X11R6/include
+X11_LIBDIR= /usr/X11R6/lib
X11_LIB= -lX11 @SOCKET_LIB@ @NSL_LIB@

View File

@ -0,0 +1,47 @@
--- interfaces/libpgtcl/Makefile.orig Mon Sep 29 23:02:46 1997
+++ interfaces/libpgtcl/Makefile Sun Oct 5 02:12:00 1997
@@ -39,6 +39,14 @@
endif
endif
+ifeq ($(PORTNAME), BSD44_derived)
+ CFLAGS += $(CFLAGS_SL)
+ shlib := libpgtcl.so.1.0
+ install-shlib-dep := install-shlib
+ LDFLAGS_SL = -x -Bshareable -Bforcearchive
+ LDFLAGS += -L $(SRCDIR)/interfaces/libpq -lpq
+endif
+
ifeq ($(PORTNAME), i386_solaris)
CFLAGS+= -fPIC
endif
@@ -56,10 +64,10 @@
endif
$(RANLIB) libpgtcl.a
-libpgtcl.so.1: $(OBJS)
- $(CC) $(LDFLAGS) -shared $(OBJS) -o libpgtcl.so.1
+libpgtcl.so.1.0: $(OBJS)
+ $(CC) $(LDFLAGS) -shared $(OBJS) -o libpgtcl.so.1.0
rm -f libpgtcl.so
- ln -s libpgtcl.so.1 libpgtcl.so
+ ln -s libpgtcl.so.1.0 libpgtcl.so
.PHONY: beforeinstall-headers install-headers
.PHONY: install install-libpgtcl
@@ -75,11 +83,11 @@
install-libpgtcl: libpgtcl.a
$(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.a $(DESTDIR)$(LIBDIR)/libpgtcl.a
-install-shlib: libpgtcl.so.1
- $(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.so.1 \
- $(DESTDIR)$(LIBDIR)/libpgtcl.so.1
+install-shlib: libpgtcl.so.1.0
+ $(INSTALL) $(INSTL_LIB_OPTS) libpgtcl.so.1.0 \
+ $(DESTDIR)$(LIBDIR)/libpgtcl.so.1.0
rm -f $(DESTDIR)$(LIBDIR)/libpgtcl.so
- ln -s libpgtcl.so.1 $(DESTDIR)$(LIBDIR)/libpgtcl.so
+ ln -s libpgtcl.so.1.0 $(DESTDIR)$(LIBDIR)/libpgtcl.so
.PHONY: clean
clean:

View File

@ -0,0 +1,11 @@
--- interfaces/libpq/Makefile.orig Sun Oct 5 02:00:11 1997
+++ interfaces/libpq/Makefile Sun Oct 5 02:00:31 1997
@@ -151,7 +151,7 @@
install-shlib: $(shlib)
$(INSTALL) $(INSTL_LIB_OPTS) $(shlib) $(DESTDIR)$(LIBDIR)/$(shlib)
rm -f $(DESTDIR)$(LIBDIR)/libpq.so
- ln -s libpq.so.1 $(DESTDIR)$(LIBDIR)/libpq.so
+ ln -s libpq.so.1.0 $(DESTDIR)$(LIBDIR)/libpq.so
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend

View File

@ -0,0 +1,11 @@
--- GNUmakefile.in.orig Wed Oct 8 22:30:13 1997
+++ GNUmakefile.in Wed Oct 8 22:31:14 1997
@@ -65,7 +65,7 @@
ifneq ($(wildcard man), )
$(MAKE) -C man install
endif
- more -e ../register.txt
+ cat ../register.txt
clean:
@if test $(PORTNAME) = UNDEFINED; then \

View File

@ -0,0 +1 @@
a robust, next generation, object-relational DBMS

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.
More information and documentation, visit: http://www.PostgreSQL.ORG/

View File

@ -0,0 +1,228 @@
etc/rc.pgsql
pgsql/.profile
pgsql/bin/cleardbdir
pgsql/bin/createdb
pgsql/bin/createuser
pgsql/bin/destroydb
pgsql/bin/destroyuser
pgsql/bin/initdb
pgsql/bin/pg_dump
pgsql/bin/pg_dumpall
pgsql/bin/pg_id
pgsql/bin/pg_passwd
pgsql/bin/pg_version
pgsql/bin/pgtclsh
pgsql/bin/pgtksh
pgsql/bin/postgres
pgsql/bin/postmaster
pgsql/bin/psql
pgsql/data/PG_VERSION
pgsql/data/base/template1/PG_VERSION
pgsql/data/base/template1/pg_aggregate
pgsql/data/base/template1/pg_am
pgsql/data/base/template1/pg_amop
pgsql/data/base/template1/pg_amproc
pgsql/data/base/template1/pg_attnameind
pgsql/data/base/template1/pg_attnumind
pgsql/data/base/template1/pg_attrdef
pgsql/data/base/template1/pg_attrdefind
pgsql/data/base/template1/pg_attrelidind
pgsql/data/base/template1/pg_attribute
pgsql/data/base/template1/pg_class
pgsql/data/base/template1/pg_classnameind
pgsql/data/base/template1/pg_classoidind
pgsql/data/base/template1/pg_index
pgsql/data/base/template1/pg_inheritproc
pgsql/data/base/template1/pg_inherits
pgsql/data/base/template1/pg_internal.init
pgsql/data/base/template1/pg_ipl
pgsql/data/base/template1/pg_language
pgsql/data/base/template1/pg_listener
pgsql/data/base/template1/pg_opclass
pgsql/data/base/template1/pg_operator
pgsql/data/base/template1/pg_parg
pgsql/data/base/template1/pg_proc
pgsql/data/base/template1/pg_procidind
pgsql/data/base/template1/pg_procnameind
pgsql/data/base/template1/pg_procsrcind
pgsql/data/base/template1/pg_relcheck
pgsql/data/base/template1/pg_relcheckind
pgsql/data/base/template1/pg_rewrite
pgsql/data/base/template1/pg_statistic
pgsql/data/base/template1/pg_trigger
pgsql/data/base/template1/pg_trigrelidind
pgsql/data/base/template1/pg_type
pgsql/data/base/template1/pg_typeidind
pgsql/data/base/template1/pg_typenameind
pgsql/data/base/template1/pg_version
pgsql/data/pg_database
pgsql/data/pg_defaults
pgsql/data/pg_demon
pgsql/data/pg_geqo.sample
pgsql/data/pg_group
pgsql/data/pg_hba.conf
pgsql/data/pg_hosts
pgsql/data/pg_log
pgsql/data/pg_magic
pgsql/data/pg_server
pgsql/data/pg_time
pgsql/data/pg_user
pgsql/data/pg_variable
pgsql/include/access/attnum.h
pgsql/include/c.h
pgsql/include/config.h
pgsql/include/fmgr.h
pgsql/include/lib/dllist.h
pgsql/include/libpgtcl.h
pgsql/include/libpq-fe.h
pgsql/include/libpq/libpq-fs.h
pgsql/include/libpq/pqcomm.h
pgsql/include/os.h
pgsql/include/postgres.h
pgsql/include/postgres_ext.h
pgsql/include/utils/elog.h
pgsql/include/utils/geo_decls.h
pgsql/include/utils/palloc.h
pgsql/lib/global1.bki.source
pgsql/lib/libpgtcl.a
pgsql/lib/libpgtcl.so
pgsql/lib/libpgtcl.so.1.0
pgsql/lib/libpq.a
pgsql/lib/libpq.so
pgsql/lib/libpq.so.1.0
pgsql/lib/local1_template1.bki.source
pgsql/lib/pg_geqo.sample
pgsql/lib/pg_hba.conf.sample
pgsql/man/man1/cleardbdir.1
pgsql/man/man1/createdb.1
pgsql/man/man1/createuser.1
pgsql/man/man1/destroydb.1
pgsql/man/man1/destroyuser.1
pgsql/man/man1/initdb.1
pgsql/man/man1/ipcclean.1
pgsql/man/man1/monitor.1
pgsql/man/man1/pg_dump.1
pgsql/man/man1/pg_dumpall.1
pgsql/man/man1/pg_passwd.1
pgsql/man/man1/pgintro.1
pgsql/man/man1/postgres.1
pgsql/man/man1/postmaster.1
pgsql/man/man1/psql.1
pgsql/man/man3/catalogs.3
pgsql/man/man3/large_objects.3
pgsql/man/man3/libpq.3
pgsql/man/man3/oracle_compat.3
pgsql/man/man3/pgbuiltin.3
pgsql/man/man5/bki.5
pgsql/man/man5/page.5
pgsql/man/man5/pg_hba.conf.5
pgsql/man/manl/abort.l
pgsql/man/manl/alter_table.l
pgsql/man/manl/begin.l
pgsql/man/manl/close.l
pgsql/man/manl/cluster.l
pgsql/man/manl/commit.l
pgsql/man/manl/copy.l
pgsql/man/manl/create_aggregate.l
pgsql/man/manl/create_database.l
pgsql/man/manl/create_function.l
pgsql/man/manl/create_index.l
pgsql/man/manl/create_operator.l
pgsql/man/manl/create_rule.l
pgsql/man/manl/create_sequence.l
pgsql/man/manl/create_table.l
pgsql/man/manl/create_trigger.l
pgsql/man/manl/create_type.l
pgsql/man/manl/create_version.l
pgsql/man/manl/create_view.l
pgsql/man/manl/declare.l
pgsql/man/manl/delete.l
pgsql/man/manl/drop.l
pgsql/man/manl/drop_aggregate.l
pgsql/man/manl/drop_database.l
pgsql/man/manl/drop_function.l
pgsql/man/manl/drop_index.l
pgsql/man/manl/drop_operator.l
pgsql/man/manl/drop_rule.l
pgsql/man/manl/drop_sequence.l
pgsql/man/manl/drop_table.l
pgsql/man/manl/drop_trigger.l
pgsql/man/manl/drop_type.l
pgsql/man/manl/drop_view.l
pgsql/man/manl/end.l
pgsql/man/manl/explain.l
pgsql/man/manl/fetch.l
pgsql/man/manl/grant.l
pgsql/man/manl/insert.l
pgsql/man/manl/listen.l
pgsql/man/manl/load.l
pgsql/man/manl/move.l
pgsql/man/manl/notify.l
pgsql/man/manl/purge.l
pgsql/man/manl/rename.l
pgsql/man/manl/reset.l
pgsql/man/manl/revoke.l
pgsql/man/manl/rollback.l
pgsql/man/manl/select.l
pgsql/man/manl/set.l
pgsql/man/manl/show.l
pgsql/man/manl/sql.l
pgsql/man/manl/update.l
pgsql/man/manl/vacuum.l
pgsql/post-install-notes
share/doc/pgsql/FAQ
share/doc/pgsql/FAQ-Irix
share/doc/pgsql/FAQ-Linux
share/doc/pgsql/README.GEQO
share/doc/pgsql/README.fsync
share/doc/pgsql/README.support
share/doc/pgsql/TODO
share/doc/pgsql/TODO.GEQO
share/doc/pgsql/bug.template
share/doc/pgsql/libpgtcl.doc
share/doc/pgsql/manual/admin.html
share/doc/pgsql/manual/advanced.html
share/doc/pgsql/manual/appenda.html
share/doc/pgsql/manual/architec.html
share/doc/pgsql/manual/copy.html
share/doc/pgsql/manual/extend.html
share/doc/pgsql/manual/figure01.gif
share/doc/pgsql/manual/figure02.gif
share/doc/pgsql/manual/figure03.gif
share/doc/pgsql/manual/intro.html
share/doc/pgsql/manual/libpq.html
share/doc/pgsql/manual/lobj.html
share/doc/pgsql/manual/pg95user.html
share/doc/pgsql/manual/query.html
share/doc/pgsql/manual/refs.html
share/doc/pgsql/manual/rules.html
share/doc/pgsql/manual/start.html
share/doc/pgsql/manual/xaggr.html
share/doc/pgsql/manual/xfunc.html
share/doc/pgsql/manual/xindex.html
share/doc/pgsql/manual/xoper.html
share/doc/pgsql/manual/xtypes.html
share/doc/pgsql/spi.txt
share/doc/pgsql/trigger.txt
share/doc/pgsql/userguide.ps
@dirrm share/doc/pgsql/manual
@dirrm share/doc/pgsql
@dirrm pgsql/bin
@dirrm pgsql/data/base/template1
@dirrm pgsql/data/base
@dirrm pgsql/data
@dirrm pgsql/include/access
@dirrm pgsql/include/include
@dirrm pgsql/include/lib
@dirrm pgsql/include/libpq
@dirrm pgsql/include/port/BSD44_derived
@dirrm pgsql/include/port
@dirrm pgsql/include/utils
@dirrm pgsql/include
@dirrm pgsql/lib
@dirrm pgsql/man/man1
@dirrm pgsql/man/man3
@dirrm pgsql/man/man5
@dirrm pgsql/man/manl
@dirrm pgsql/man
@dirrm pgsql

View File

@ -0,0 +1,51 @@
#!/usr/bin/perl
#
eval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
& eval 'exec /usr/bin/perl -S $0 $argv:q'
if 0;
if( $> ) {
print "\nYou must be root to run this step!\n\n";
exit 1;
}
if( getpwnam( "pgsql" ) ) {
( $null, $null, $pgUID ) = getpwnam( "pgsql" );
} else {
$pgUID = 70;
while( getpwuid( $pgUID ) ) {
$pgUID++;
}
}
if( getgrnam( "pgsql" ) ) {
( $null, $null, $pgGID ) = getgrnam( "pgsql" );
} else {
$pgGID = 70;
while( getgrgid( $pgGID ) ) {
$pgGID++;
}
&append_file( "/etc/group", "pgsql:*:$pgGID:" );
}
print "pgsql user using uid $pgUID\n";
print "pgsql user using gid $pgGID\n";
print( "/usr/bin/chpass -a \"pgsql:*:$pgUID\:$pgGID\:\:\:\:PostgreSQL pseudo-user:$ENV{'PREFIX'}/pgsql:/bin/sh\"" );
system( "/usr/bin/chpass -a \"pgsql:*\:$pgUID\:$pgGID\:\:\:\:PostgreSQL pseudo-user\:$ENV{'PREFIX'}/pgsql\:/bin/sh\"" );
sub append_file {
local($file,@list) = @_;
local($LOCK_EX) = 2;
local($LOCK_NB) = 4;
local($LOCK_UN) = 8;
open(F, ">> $file") || die "$file: $!\n";
while( ! flock( F, $LOCK_EX | $LOCK_NB ) ) {
exit 1;
}
print F join( "\n", @list) . "\n";
close F;
flock( F, $LOCK_UN );
}