Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jan 2001 16:44:04 -0500 (EST)
From:      "Geoffrey C. Speicher" <geoff@baltic.sea-incorporated.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/24313: New port: firebird (InterBase spin-off)
Message-ID:  <200101132144.f0DLi4L10912@baltic.sea-incorporated.com>

next in thread | raw e-mail | index | archive | help

>Number:         24313
>Category:       ports
>Synopsis:       New port: firebird (InterBase spin-off)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 13 13:50:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Geoffrey C. Speicher
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
Software Engineering Associates, Inc.
>Environment:

	

>Description:

	The open-source InterBase(tm) 6.0 spin-off (Classic version)

>How-To-Repeat:

	

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	firebird
#	firebird/Makefile
#	firebird/pkg-comment
#	firebird/pkg-descr
#	firebird/pkg-plist
#	firebird/files
#	firebird/files/patch-aa
#	firebird/files/patch-ab
#	firebird/files/patch-ac
#	firebird/files/RELNOTES
#	firebird/distinfo
#	firebird/scripts
#	firebird/scripts/pre-build
#	firebird/scripts/pre-install
#	firebird/scripts/rmservice
#	firebird/scripts/addservice
#	firebird/scripts/post-install
#	firebird/scripts/createuser
#	firebird/pkg-message
#	firebird/pkg-install
#
echo c - firebird
mkdir -p firebird > /dev/null 2>&1
echo x - firebird/Makefile
sed 's/^X//' >firebird/Makefile << 'END-of-firebird/Makefile'
X# New ports collection makefile for:	Firebird
X# Date created:		20 December 2000
X# Whom:			Geoffrey C. Speicher <geoff@sea-incorporated.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	firebird
XPORTVERSION=	0.9
XPORTREVISION=	4
XCATEGORIES=	databases
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=firebird
XDISTFILES=	firebird-boot-kit.tar.gz \
X		interbase0.9-4-v5examples.tar.gz \
X		interbase0.9-4src.tar.gz
X
XMAINTAINER=	geoff@sea-incorporated.com
X
XWRKSRC=		${WRKDIR}/interbase
XINSTALLS_SHLIB=	yes
XLDCONFIG_DIRS=	%%PREFIX%%/firebird/lib
X
XONLY_FOR_ARCHS=	i386
X
Xdo-extract:
X	@${MKDIR} ${WRKDIR}
X	@(								\
X	cd ${WRKDIR}; tar zxf ${DISTDIR}/interbase0.9-4src.tar.gz;	\
X	cd interbase; tar zxf ${DISTDIR}/firebird-boot-kit.tar.gz;	\
X	${CP} msgs/msg.gbak misc/msg.gbak				\
X	)
X
Xdo-configure:
X	@(								\
X	cd ${WRKDIR}/interbase;						\
X	INTERBASE=${WRKDIR}/interbase/interbase; export INTERBASE;	\
X	REFDBPATH=${WRKDIR}/refDatabases; export REFDBPATH;		\
X	${SH} buildBootDatabases;					\
X	${SH} setup_dirs.boot FREEBSD PROD ${WRKDIR}/refDatabases boot;	\
X	)
X
Xdo-build:
X	@(								\
X	cd ${WRKDIR}/interbase;						\
X	INTERBASE=${WRKDIR}/interbase/interbase; export INTERBASE;	\
X	REFDBPATH=${WRKDIR}/refDatabases; export REFDBPATH;		\
X	${SH} boot.freebsd;						\
X	)
X
Xdo-install:
X	@(								\
X	cd ${WRKDIR}/interbase;						\
X	${CP} -Rp interbase ${PREFIX}/firebird;				\
X	${RM} ${PREFIX}/firebird/install;				\
X	${RM} ${PREFIX}/firebird/lib/libgds.so.1.0;			\
X	${LN} -fs gds.so ${PREFIX}/firebird/lib/libgds.so.1;		\
X	cd ${PREFIX}/firebird/examples;					\
X	tar zxf ${DISTDIR}/interbase0.9-4-v5examples.tar.gz;		\
X	${CP} ${FILESDIR}/RELNOTES ${PREFIX}/firebird/			\
X	)
X
X.include <bsd.port.mk>
END-of-firebird/Makefile
echo x - firebird/pkg-comment
sed 's/^X//' >firebird/pkg-comment << 'END-of-firebird/pkg-comment'
XThe open-source InterBase(tm) 6.0 spin-off (Classic version)
END-of-firebird/pkg-comment
echo x - firebird/pkg-descr
sed 's/^X//' >firebird/pkg-descr << 'END-of-firebird/pkg-descr'
XThe open-source InterBase(tm) 6.0 spin-off (Classic server version)
X
XInterBase is a world-class DBMS with a history too rich to detail
Xhere.  Once selling for several thousands of dollars per license,
Xsome very big players use it worldwide.  Inprise has open-sourced
XInterBase 6.0, and a lively bunch of folks has charged themselves
Xwith seeing that it lives on through the Firebird project.
X
XNote that as of Firebird 0.9_4, the locksmith back door has
Xbeen closed.
X
XFor more information on Firebird and InterBase, see:
X
Xhttp://sourceforge.net/projects/firebird/
Xhttp://www.ibphoenix.com/
Xhttp://www.interbase2000.org/
Xhttp://www.interbase.com/
X
XFor more information on the locksmith back door, see:
X
Xhttps://www.kb.cert.org/vuls/id/247371
END-of-firebird/pkg-descr
echo x - firebird/pkg-plist
sed 's/^X//' >firebird/pkg-plist << 'END-of-firebird/pkg-plist'
Xfirebird/intl/gdsintl
Xfirebird/examples/v5/ib_udf.sql
Xfirebird/examples/v5/README
Xfirebird/examples/v5/align.h
Xfirebird/examples/v5/api1.c
Xfirebird/examples/v5/api10.c
Xfirebird/examples/v5/api11.c
Xfirebird/examples/v5/api12.c
Xfirebird/examples/v5/api13.c
Xfirebird/examples/v5/api14.e
Xfirebird/examples/v5/api15.c
Xfirebird/examples/v5/api16.c
Xfirebird/examples/v5/api16t.c
Xfirebird/examples/v5/api2.c
Xfirebird/examples/v5/api3.c
Xfirebird/examples/v5/api4.c
Xfirebird/examples/v5/api5.c
Xfirebird/examples/v5/api6.c
Xfirebird/examples/v5/api7.c
Xfirebird/examples/v5/api8.c
Xfirebird/examples/v5/api9.c
Xfirebird/examples/v5/api9f.c
Xfirebird/examples/v5/apifull.c
Xfirebird/examples/v5/employe2.sql
Xfirebird/examples/v5/dyn1.e
Xfirebird/examples/v5/dyn2.e
Xfirebird/examples/v5/dyn3.e
Xfirebird/examples/v5/dyn4.e
Xfirebird/examples/v5/dyn5.e
Xfirebird/examples/v5/dynfull.e
Xfirebird/examples/v5/employee.gbk
Xfirebird/examples/v5/employee.gdb
Xfirebird/examples/v5/example.h
Xfirebird/examples/v5/api9f.sql
Xfirebird/examples/v5/intlemp.gbk
Xfirebird/examples/v5/intlemp.gdb
Xfirebird/examples/v5/stat1.e
Xfirebird/examples/v5/stat10.e
Xfirebird/examples/v5/stat11.e
Xfirebird/examples/v5/stat12.e
Xfirebird/examples/v5/stat12t.e
Xfirebird/examples/v5/stat2.e
Xfirebird/examples/v5/stat3.e
Xfirebird/examples/v5/stat4.e
Xfirebird/examples/v5/stat5.e
Xfirebird/examples/v5/stat6.e
Xfirebird/examples/v5/stat7.e
Xfirebird/examples/v5/stat8.e
Xfirebird/examples/v5/stat9.e
Xfirebird/examples/v5/udf.sql
Xfirebird/examples/v5/udflib.c
Xfirebird/examples/v5/makefile
Xfirebird/include/perf.h
Xfirebird/include/ib_util.h
Xfirebird/include/gds.hxx
Xfirebird/include/gds.h
Xfirebird/include/ibase.h
Xfirebird/include/iberror.h
Xfirebird/include/gds.f
Xfirebird/UDF/ib_udf
Xfirebird/lib/ib_util.so
Xfirebird/lib/gds.a
Xfirebird/lib/gds.so
Xfirebird/lib/libgds.so
Xfirebird/lib/libgds.so.1
Xfirebird/lib/libgds_pyxis.a
Xfirebird/lib/libgds.a
Xfirebird/lib/gds_pyxis.a
Xfirebird/help/help.gbak
Xfirebird/help/help.gdb
Xfirebird/bin/isc4.gbak
Xfirebird/bin/gpre
Xfirebird/bin/gds_pipe
Xfirebird/bin/gds_drop
Xfirebird/bin/gds_lock_mgr
Xfirebird/bin/gfix
Xfirebird/bin/gdef
Xfirebird/bin/isql
Xfirebird/bin/gds_lock_print
Xfirebird/bin/qli
Xfirebird/bin/gds_inet_server
Xfirebird/bin/gsplit
Xfirebird/bin/gstat
Xfirebird/bin/gds_relay
Xfirebird/bin/gsec
Xfirebird/bin/gbak
Xfirebird/services.isc
Xfirebird/isc_config
Xfirebird/isc4.gdb
Xfirebird/interbase.msg
Xfirebird/interbase.log
Xfirebird/inetd.conf.isc
Xfirebird/RELNOTES
X@dirrm firebird
X@dirrm firebird/intl
X@dirrm firebird/examples/v3
X@dirrm firebird/examples/v4
X@dirrm firebird/examples/v5
X@dirrm firebird/examples
X@dirrm firebird/include
X@dirrm firebird/UDF
X@dirrm firebird/lib
X@dirrm firebird/help
X@dirrm firebird/bin
END-of-firebird/pkg-plist
echo c - firebird/files
mkdir -p firebird/files > /dev/null 2>&1
echo x - firebird/files/patch-aa
sed 's/^X//' >firebird/files/patch-aa << 'END-of-firebird/files/patch-aa'
X--- buildBootDatabases.orig	Tue Oct 10 23:00:39 2000
X+++ buildBootDatabases	Tue Oct 10 23:00:46 2000
X@@ -49,7 +49,7 @@
X     DefaultAns=$2
X     echo -n "${1}"
X     Answer="$DefaultAns"
X-    read Answer
X+#    read Answer
X }
X 
X #--------------------------------------------------------------------
END-of-firebird/files/patch-aa
echo x - firebird/files/patch-ab
sed 's/^X//' >firebird/files/patch-ab << 'END-of-firebird/files/patch-ab'
X--- setup_dirs.boot.orig	Tue Oct 10 23:00:07 2000
X+++ setup_dirs.boot	Tue Oct 10 23:00:22 2000
X@@ -49,7 +49,7 @@
X    DefaultAns=$2
X    echo -n "${1}"
X    Answer="$DefaultAns"
X-   read Answer 
X+#   read Answer 
X }
X 
X 
END-of-firebird/files/patch-ab
echo x - firebird/files/patch-ac
sed 's/^X//' >firebird/files/patch-ac << 'END-of-firebird/files/patch-ac'
X--- builds/original/prefix.freebsd	2000/10/08 15:36:25	1.2
X+++ builds/original/prefix.freebsd	2001/01/11 19:17:58
X@@ -28,7 +28,7 @@
X 
X 
X PROD_DEBUG_OBJECTS=	nodebug.o
X-PROD_SHRLIB_DIR=	
X+PROD_SHRLIB_DIR=	-Lsource/jrd
X PROD_VERSION_FLAG=	-DPROD_BUILD
X PROD_CFLAGS=            -O -m486 -fpic -DFLINTSTONE
X 
X@@ -48,7 +48,7 @@
X UDF_LINK_CMD=		gcc
X UDF_CFLAGS=         	-fPIC -mieee-fp
X UDF_LFLAGS=         	-shared
X-UDF_SHRLIBS=        	-L/usr/local/lib -lgds -lm -lc -mieee-fp -ldescrypt
X+UDF_SHRLIBS=        	$(SHRLIB_DIR) -lgds -lm -lc -mieee-fp -ldescrypt
X 
X #NOTE: PIC_J_CFLAGS is special CFLAGS used to build PIPD_IS_SHRLIB modules
X #      to workaround the Solaris threading problems with signals
X@@ -69,16 +69,14 @@
X FUNCTIONS=		functions.bin
X FUNCSHR=		source/interbase/lib/gdsf.so
X GDS_LINK=		$(GDSSHR_LINK)
X-#GDS_PYXIS=
X GDS_PYXIS=		gds_pyxis.a
X GDSLIB_BACKEND=		source/interbase/lib/gds_b.a
X GDSLIB_LINK=		-Lsource/jrd -lgds_b -lc -ldescrypt
X 
X GDSSHR=			source/interbase/lib/gds.so
X LINUX_GDSSHR=		$(GDSSHR)
X-GDSSHR_LINK=		$(SHRLIB_DIR) -L/usr/local/lib -lgds -lgds_pyxis -ldescrypt
X-PIPE_GDSSHR_LINK=	$(SHRLIB_DIR) -L/usr/local/lib -lgds -lgds_pyxis
X-#PIPE_GDSSHR_LINK=	$(SHRLIB_DIR) -lgds -lgds_pyxis
X+GDSSHR_LINK=		$(SHRLIB_DIR) -lgds -lgds_pyxis -ldescrypt
X+PIPE_GDSSHR_LINK=	$(SHRLIB_DIR) -lgds -lgds_pyxis
X HLPDIR=			source/qli/
X HOSTNAME=		`hostname | cut -d'.' -f1`
X INCLUDES=		include_so include_so_ada	
X@@ -106,11 +104,6 @@
X MUISQL_LINK_OPTS=	$(MUISQL_MU_LIB) $(PIPE_GDSSHR_LINK) -lm 
X PIC_FLAGS=		$(CFLAGS) -fPIC
X PIPE=			gds.a gds_pipe
X-#PYXIS=
X-#PYXIS_MISC_OBJS=
X-#PYXIS_P_MISC_OBJS=
X-#PYXIS_OBJECTS=
X-#PYXIS_MISC_OBJECTS=
X PYXIS=			pyxis
X PYXIS_MISC_OBJS=	$(PYXIS_MISC)
X PYXIS_P_MISC_OBJS=	$(PYXIS_P_MISC)
X@@ -167,5 +160,8 @@
X SHRLIB_EXT=		.so
X 
X V3PRINTER=		source/lock/printv3.o
X+
X+# Forces library build for FreeBSD
X+PYXIS_LIBRARY= libpyxis.a
END-of-firebird/files/patch-ac
echo x - firebird/files/RELNOTES
sed 's/^X//' >firebird/files/RELNOTES << 'END-of-firebird/files/RELNOTES'
XFirebird 0.9_4 FreeBSD Release Notes                       13-Jan-2001
X------------------------------------
XFB-T0.9.4.34 Firebird Test1
X
XWelcome to the FreeBSD Firebird port!  Users should note that there
Xwas a package called `firebird-1.0.tgz' released in mid-August
X2000.  Unfortunately, that package was released before Firebird
Xversion numbering conventions were established, so although the
Xversion number would suggest that it is newer than the current
Xrelease, it is certainly not.  Users of the August 1.0 package
Xshould upgrade to 0.9_4 or later, which has fixed many bugs and
Xsecurity problems, including the recently-discovered back door.
X
X    Firebird originally required a running copy of Firebird (or
XInterBase) in order to build itself.  This port uses a boot kit to
Xovercome that, so that it does not require itself to build.
XUnfortunately, the side effect of this is that if you have a lock
Xmanager running from an already-installed version of Firebird or
XInterBase, this port will not build.
X
X    Firebird is installed SUID with owner and group `firebird'.
XThis does affect where you can and cannot create databases when
Xconnecting remotely, as well as which existing databases you can
Xaccess.  If you want a database to be available remotely, be sure
Xit's readable and writeable to group firebird.
X
X    There may be times when you manage to get your system into a
Xstate where using any of the Firebird utilites (isql, gbak, gsec,
Xetc.) gives you the message "semget failed".  One surefire way to
Xdo this is to build and install the port.  :)  If this happens,
Xmake sure that the lock manager is not running and its semaphores
Xhave been removed.  The former can be accomplished with 'ps ax
X|grep gds' and 'kill'; the latter with 'ipcs -s' and 'ipcrm -s'.
X
X    For example, after building and installing the port, you will
Xprobably go through something like this:
X
X# isql /usr/interbase/isc4.gdb
XStatement failed, SQLCODE = -902
X
Xoperating system directive semget failed
X-No such file or directory
X
X# ipcs -s
XSemaphores:
XT     ID     KEY        MODE       OWNER    GROUP
Xs 1310720  252034728 --rw-rw-rw-     root    wheel
X
X# ipcrm -s 1310720
X
Xand you should be in business.
X
X    Once this is done, you should be able to connect normally to
Xdatabases.  Your first connection will restart the lock manager.
X
X    There may be times, however, when you still get "semget failed"
Xeven though the lock manager is not running and the semaphores have
Xbeen cleaned up.  There seems to be a conflict with this release
Xand the PostgreSQL 7 release as installed from the ports collection.
XIf you're having trouble with Firebird and you're running PostgreSQL,
Xtry stopping PostgreSQL:
X
X	/usr/local/etc/rc.d/pgsql.sh stop
X
Xand see if that helps.
X
X    Complete documentation for InterBase(tm) is available (free of
Xcharge) from http://www.interbase.com/ in PDF format.  While
XInterBase and Firebird are two distinct entities, all InterBase
Xdocumentation is pertinent to Firebird.  More information on Firebird
Xand InterBase can be found at the following:
X
X	http://sourceforge.net/projects/firebird/
X	http://www.ibphoenix.com/
X	http://www.interbase2000.org/
X
XGeoff Speicher
X<geoff@sea-incorporated.com>
END-of-firebird/files/RELNOTES
echo x - firebird/distinfo
sed 's/^X//' >firebird/distinfo << 'END-of-firebird/distinfo'
XMD5 (firebird-boot-kit.tar.gz) = 2e18d75539bc4c3d40a1a71509309f64
XMD5 (interbase0.9-4-v5examples.tar.gz) = 17cba82bbf5066d515f2dee97bf8327a
XMD5 (interbase0.9-4src.tar.gz) = d098277ed160e2b6a49d91e1fdb3a652
END-of-firebird/distinfo
echo c - firebird/scripts
mkdir -p firebird/scripts > /dev/null 2>&1
echo x - firebird/scripts/pre-build
sed 's/^X//' >firebird/scripts/pre-build << 'END-of-firebird/scripts/pre-build'
X#!/bin/sh
X
XGDS_LOCK_MGR=`ps ax |grep gds_lock_mgr |grep -v grep`;
X
Xif [ "$GDS_LOCK_MGR" != "" ]; then
X	echo "It appears you have a gds_lock_manager already running.";
X	echo;
X	echo "You must cease all InterBase operations to build this port.";
X	echo "Make sure nobody is connected to any databases, then use";
X	echo "'gds_drop -a' and manually verify (with ipcs) that the";
X	echo "semaphores were removed.";
X	exit 1;
Xfi
Xexit 0
X
END-of-firebird/scripts/pre-build
echo x - firebird/scripts/pre-install
sed 's/^X//' >firebird/scripts/pre-install << 'END-of-firebird/scripts/pre-install'
X#!/bin/sh
X
Xif [ -d $PREFIX/firebird ]; then
X	if [ -d $PREFIX/firebird.old ]; then
X		rm -rf $PREFIX/firebird.old
X	fi
X	mv $PREFIX/firebird $PREFIX/firebird.old
Xfi
X
Xif [ -L /usr/interbase ]; then
X	rm -f /usr/interbase
Xfi
X
Xif [ -d /usr/interbase ]; then
X	mv /usr/interbase /usr/interbase.old
Xfi
X
Xln -fs $PREFIX/firebird /usr/interbase
X
Xperl $SCRIPTDIR/createuser
END-of-firebird/scripts/pre-install
echo x - firebird/scripts/rmservice
sed 's/^X//' >firebird/scripts/rmservice << 'END-of-firebird/scripts/rmservice'
X#!/bin/sh
X
Xcp /etc/services /etc/services.old
Xcp /etc/inetd.conf /etc/inetd.conf.old
Xcat /etc/services |grep -v gds_db >/etc/services.new
Xcat /etc/inetd.conf |grep -v gds_db >/etc/inetd.conf.new
Xmv /etc/services.new /etc/services
Xmv /etc/inetd.conf.new /etc/inetd.conf
END-of-firebird/scripts/rmservice
echo x - firebird/scripts/addservice
sed 's/^X//' >firebird/scripts/addservice << 'END-of-firebird/scripts/addservice'
X#!/bin/sh
X
Xcat >>/etc/services <<EOF
Xgds_db		 3050/tcp  #InterBase Database Remote Protocol
XEOF
Xcat >>/etc/inetd.conf <<EOF
Xgds_db	stream	tcp	nowait	firebird	/usr/interbase/bin/gds_inet_server  gds_inet_server
XEOF
Xkill -HUP `cat /var/run/inetd.pid`
END-of-firebird/scripts/addservice
echo x - firebird/scripts/post-install
sed 's/^X//' >firebird/scripts/post-install << 'END-of-firebird/scripts/post-install'
X#!/bin/sh
X
Xchown -R firebird:firebird $PREFIX/firebird
X
X# Turn everybody to read only.
Xchmod -R o=r $PREFIX/firebird
X
X# Now fix up the mess.
X
X# fix up directories 
Xfor i in `find $PREFIX/firebird -print`
X  do
X    FileName=$i
X    if [ -d $FileName ]
X       then
X         chmod o=rx $FileName
X     fi
X  done
X
X
X
Xcd $PREFIX/firebird/bin
X
X# all users can run everything.
Xchmod o=rx * 
X
X# SUID is needed for running server programs.
X
Xfor i in gds_lock_mgr gds_drop gds_inet_server
X  do
X    chmod ug+s $i
X  done
X
X
X# Lock files
X
Xcd $PREFIX/firebird
X
Xfor i in isc_init1 isc_lock1 isc_event1 
X  do
X    FileName=$i.`hostname`
X    touch $FileName
X    chmod uga=rw $FileName
X    chown firebird:firebird $FileName
X  done
X
X
Xtouch interbase.log
Xchmod ugo=rw interbase.log
X
X# make databases writable by all
Xchmod ugo=rw examples/v5/*.gdb
Xchmod ugo=rw help/*.gdb
Xchmod ugo=rw isc4.gdb
X
X# remove any existing gds service
Xsh $SCRIPTDIR/rmservice
X
X# add the gds service and restart inetd
Xsh $SCRIPTDIR/addservice
Xkill -HUP `cat /var/run/inetd.pid`
X
Xsed "s|%%PREFIX%%|$PREFIX|" $SCRIPTDIR/../pkg-message
X
Xcat <<EOF
X
X==========================================================
X!! NOTE !!
X
XAs there are some oddities to the Firebird build process,
Xit is likely you WILL NOT BE ABLE TO USE IT until you
Xremove the semaphore created during the build process.
XPlease read $PREFIX/firebird/RELNOTES for more information.
X==========================================================
X
XEOF
END-of-firebird/scripts/post-install
echo x - firebird/scripts/createuser
sed 's/^X//' >firebird/scripts/createuser << 'END-of-firebird/scripts/createuser'
X#!/usr/bin/perl
X#
X
Xeval '(exit $?0)' && eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
X& eval 'exec /usr/bin/perl -S $0 $argv:q'
Xif 0;
X
Xif( $> ) {
X	print "\nYou must be root to run this step!\n\n";
X	exit 1;
X} 
X
Xif( getpwnam( "firebird" ) ) {
X	( $null, $null, $fbUID ) = getpwnam( "firebird" );
X} else {
X	$fbUID = 90;
X	while( getpwuid( $fbUID ) ) {
X		$fbUID++;
X	}
X}
X
Xif( getgrnam( "firebird" ) ) {
X	( $null, $null, $fbGID ) = getgrnam( "firebird" );
X} else {
X	$fbGID = 90;
X	while( getgrgid( $fbGID ) ) {
X		$fbGID++;
X	}
X	&append_file( "/etc/group", "firebird:*:$fbGID:" );
X}
X
Xprint "firebird user using uid $fbUID\n";
Xprint "firebird user using gid $fbGID\n";
X
Xsystem( "/usr/bin/chpass -a \"firebird:*:$fbUID:$fbGID\:\:0:0:Firebird pseudo-user:$ENV{'PREFIX'}/firebird:/bin/sh\"" );
X
Xsub append_file {
X	local($file,@list) = @_;
X	local($LOCK_EX) = 2;
X	local($LOCK_NB) = 4;
X	local($LOCK_UN) = 8;
X
X	open(F, ">> $file") || die "$file: $!\n";
X	while( ! flock( F, $LOCK_EX | $LOCK_NB ) ) {
X		exit 1;
X	}
X	print F join( "\n", @list) . "\n";
X	close F;
X	flock( F, $LOCK_UN );
X}
END-of-firebird/scripts/createuser
echo x - firebird/pkg-message
sed 's/^X//' >firebird/pkg-message << 'END-of-firebird/pkg-message'
X
X---------------------------------------------------------
XFirebird is now installed.  There is a symbolic link from
X/usr/interbase -> %%PREFIX%%/firebird.  Firebird needs this
Xlink for proper operation.
X
XIt is STRONGLY recommended that you change the SYSDBA
Xpassword with:
X
X$ cd /usr/interbase
X$ gsec -user SYSDBA -pass masterkey
XGSEC> modify SYSDBA -pw newpassword
XGSEC> quit
X
Xbefore doing anything serious with Firebird.
X
XSee %%PREFIX%%/firebird/RELNOTES for more.
X---------------------------------------------------------
X
END-of-firebird/pkg-message
echo x - firebird/pkg-install
sed 's/^X//' >firebird/pkg-install << 'END-of-firebird/pkg-install'
X#!/bin/sh
X
X# Created in haste by smashing together various
X# files from the port scripts.
X
Xif [ "$2" = "PRE-INSTALL" ]; then
Xif [ -d $PKG_PREFIX/firebird ]; then
X	if [ -d $PKG_PREFIX/firebird.old ]; then
X		rm -rf $PKG_PREFIX/firebird.old
X	fi
X	mv $PKG_PREFIX/firebird $PKG_PREFIX/firebird.old
Xfi
X
Xif [ -L /usr/interbase ]; then
X	rm -f /usr/interbase
Xfi
X
Xif [ -d /usr/interbase ]; then
X	mv /usr/interbase /usr/interbase.old
Xfi
X
Xln -fs $PKG_PREFIX/firebird /usr/interbase
X
Xperl <<EOF
Xeval '(exit \$?0)' && eval 'exec /usr/bin/perl -S \$0 \${1+"\$@"}'
X& eval 'exec /usr/bin/perl -S \$0 \$argv:q'
Xif 0;
X
Xif( \$> ) {
X	print "\nYou must be root to run this step!\n\n";
X	exit 1;
X} 
X
Xif( getpwnam( "firebird" ) ) {
X	( \$null, \$null, \$fbUID ) = getpwnam( "firebird" );
X} else {
X	\$fbUID = 90;
X	while( getpwuid( \$fbUID ) ) {
X		\$fbUID++;
X	}
X}
X
Xif( getgrnam( "firebird" ) ) {
X	( \$null, \$null, \$fbGID ) = getgrnam( "firebird" );
X} else {
X	\$fbGID = 90;
X	while( getgrgid( \$fbGID ) ) {
X		\$fbGID++;
X	}
X	&append_file( "/etc/group", "firebird:*:\$fbGID:" );
X}
X
Xprint "firebird user using uid \$fbUID\n";
Xprint "firebird user using gid \$fbGID\n";
X
Xsystem( "/usr/bin/chpass -a \"firebird:*:\$fbUID:\$fbGID\:\:0:0:Firebird pseudo-user:\$ENV{'PKG_PREFIX'}/firebird:/bin/sh\"" );
X
Xsub append_file {
X	local(\$file,@list) = @_;
X	local(\$LOCK_EX) = 2;
X	local(\$LOCK_NB) = 4;
X	local(\$LOCK_UN) = 8;
X
X	open(F, ">> \$file") || die "\$file: \$!\n";
X	while( ! flock( F, \$LOCK_EX | \$LOCK_NB ) ) {
X		exit 1;
X	}
X	print F join( "\n", @list) . "\n";
X	close F;
X	flock( F, \$LOCK_UN );
X}
XEOF
Xelif [ "$2" = "POST-INSTALL" ]; then
Xchown -R firebird:firebird $PKG_PREFIX/firebird
X
X# Turn everybody to read only.
Xchmod -R o=r $PKG_PREFIX/firebird
X
X# Now fix up the mess.
X
X# fix up directories 
Xfor i in `find $PKG_PREFIX/firebird -print`
X  do
X    FileName=$i
X    if [ -d $FileName ]
X       then
X         chmod o=rx $FileName
X     fi
X  done
X
X
X
Xcd $PKG_PREFIX/firebird/bin
X
X# all users can run everything.
Xchmod o=rx * 
X
X# SUID is needed for running server programs.
X
Xfor i in gds_lock_mgr gds_drop gds_inet_server
X  do
X    chmod ug+s $i
X  done
X
X
X# Lock files
X
Xcd $PKG_PREFIX/firebird
X
Xfor i in isc_init1 isc_lock1 isc_event1 
X  do
X    FileName=$i.`hostname`
X    touch $FileName
X    chmod uga=rw $FileName
X    chown firebird:firebird $FileName
X  done
X
X
Xtouch interbase.log
Xchmod ugo=rw interbase.log
X
X# make databases writable by all
Xchmod ugo=rw examples/v5/*.gdb
Xchmod ugo=rw help/*.gdb
Xchmod ugo=rw isc4.gdb
X
X# remove any existing gds service
Xcp /etc/services /etc/services.old
Xcp /etc/inetd.conf /etc/inetd.conf.old
Xcat /etc/services |grep -v gds_db >/etc/services.new
Xcat /etc/inetd.conf |grep -v gds_db >/etc/inetd.conf.new
Xmv /etc/services.new /etc/services
Xmv /etc/inetd.conf.new /etc/inetd.conf
X
X# add the gds service and restart inetd
Xcat >>/etc/services <<EOF
Xgds_db		 3050/tcp  #InterBase Database Remote Protocol
XEOF
Xcat >>/etc/inetd.conf <<EOF
Xgds_db	stream	tcp	nowait	firebird	/usr/interbase/bin/gds_inet_server  gds_inet_server
XEOF
Xkill -HUP `cat /var/run/inetd.pid`
Xkill -HUP `cat /var/run/inetd.pid`
X
Xfi
END-of-firebird/pkg-install
exit


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101132144.f0DLi4L10912>