diff options
| author | Sergey Matveychuk <sem@FreeBSD.org> | 2005-05-21 08:01:24 +0000 |
|---|---|---|
| committer | Sergey Matveychuk <sem@FreeBSD.org> | 2005-05-21 08:01:24 +0000 |
| commit | 051242452f205f081a5b9abeb8a58993edc1a8f0 (patch) | |
| tree | a24bde1b39c8a2c1ed16f1d13902d3e51f4e90e0 /databases/firebird20-server/files | |
| parent | add a 3rd header-include case - that makes it compile on my amd64 system (diff) | |
- Fix problem with firebird.conf. It was not installed.
- Fix problem with firebird.msg. It was installed only for -server,
but it's necessary for -client too (thanks to skv@ for pointing this out).
- Utilize PORTDOCS and SUBFILES, respect NOPORTDOCS.
- Utilize DOCSDIR and EXAMPLESDIR.
- Back to use do-build.
- Add $FreeBSD$ tag to pkg-plist* and pkg-install.
- Remove code that changes automatically /etc/services and /etc/inetd.conf and
change pkg-message to reflect this.
PR: ports/81214
Submitted by: maintainer
Diffstat (limited to 'databases/firebird20-server/files')
| -rw-r--r-- | databases/firebird20-server/files/aliases.conf.in | 2 | ||||
| -rw-r--r-- | databases/firebird20-server/files/patch-src::jrd::gds.cpp | 12 | ||||
| -rw-r--r-- | databases/firebird20-server/files/pkg-install.in | 111 | ||||
| -rw-r--r-- | databases/firebird20-server/files/pkg-message.in | 21 |
4 files changed, 86 insertions, 60 deletions
diff --git a/databases/firebird20-server/files/aliases.conf.in b/databases/firebird20-server/files/aliases.conf.in index 05a28980b909..a49d31d96fdf 100644 --- a/databases/firebird20-server/files/aliases.conf.in +++ b/databases/firebird20-server/files/aliases.conf.in @@ -4,5 +4,5 @@ # # Examples: # -# employee = %%PREFIX%%/examples/employee.fdb +# employee = %%EXAMPLESDIR%%/employee.fdb # diff --git a/databases/firebird20-server/files/patch-src::jrd::gds.cpp b/databases/firebird20-server/files/patch-src::jrd::gds.cpp new file mode 100644 index 000000000000..12c0cd025551 --- /dev/null +++ b/databases/firebird20-server/files/patch-src::jrd::gds.cpp @@ -0,0 +1,12 @@ +--- src/jrd/gds.cpp.orig Fri May 20 16:14:19 2005 ++++ src/jrd/gds.cpp Fri May 20 16:31:25 2005 +@@ -1736,8 +1736,7 @@ + gds__prefix(ib_prefix_msg, ""); + } + else { +- strcat(ib_prefix_msg_val, ib_prefix_msg); +- ib_prefix_msg = ib_prefix_msg_val; ++ strcpy(ib_prefix_msg, "%%DATADIR%%"); + } + } + strcat(string, ib_prefix_msg); diff --git a/databases/firebird20-server/files/pkg-install.in b/databases/firebird20-server/files/pkg-install.in index d442ff99ee3f..b2da81e8fb00 100644 --- a/databases/firebird20-server/files/pkg-install.in +++ b/databases/firebird20-server/files/pkg-install.in @@ -1,70 +1,71 @@ #!/bin/sh -PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:%%PREFIX%%/bin -PREFIX=%%PREFIX%% -DB_DIR=%%PREFIX%% +# $FreeBSD$ -USER=firebird -GROUP=${USER} -UID=3050 -GID=${UID} -HOME=${DB_DIR} -DESCR="Firebird Database Administrator" +PATH=/bin:/usr/bin:/usr/sbin case $2 in PRE-INSTALL) - if pw group show "${GROUP}" 2> /dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if pw groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi - fi - - if pw user show "${USER}" 2> /dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - if pw usermod ${USER} -d ${HOME}; then - echo "Changed home directory of \"${USER}\" to \"${HOME}\"" - else - echo "Changing home directory of \"${USER}\" to \"${HOME}\" failed..." - exit 1 - fi - else - if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d ${NOME} -s /sbin/nologin -c "${DESCR}" ; then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi - fi - ;; +if [ `id -u` -ne 0 ]; then + echo; echo "You must be root to run this step!"; echo; echo + exit 1 +fi -POST-INSTALL) - for f in isc_init1.`hostname` isc_lock1.`hostname` isc_event1.`hostname` firebird.log +nofbuid=0 +fbUID=`id -u firebird 2>/dev/null` +if [ $? -ne 0 ]; then + fbUID=90 + while [ ! -z `id -un $fbUID 2>/dev/null` ] do - touch ${PREFIX}/${f} - chown ${USER}:${GROUP} ${PREFIX}/$f - chmod 660 ${PREFIX}/${f} + fbUID=$(($fbUID+1)) done + nofbuid=1 +fi - # add the gds service and restart inetd - cat /etc/services | grep -v gds_db > /etc/services.new - cat >>/etc/services.new <<EOF -gds_db 3050/tcp #InterBase Database Remote Protocol -EOF - mv /etc/services.new /etc/services +fbGID=`pw groupshow firebird 2>/dev/null` +if [ $? -ne 0 ]; then + fbGID=90 + while [ ! -z `id -gn $fbGID 2>/dev/null` ] + do + fbGID=$(($fbGID+1)) + done + echo "firebird:*:$fbGID:" >> /etc/group +else + fbGID=`echo $fbGID | awk -F: '{print $3}'` +fi - cat /etc/inetd.conf | grep -v gds_db > /etc/inetd.conf.new - cat >>/etc/inetd.conf.new <<EOF -gds_db stream tcp nowait firebird ${PREFIX}/bin/fb_inet_server fb_inet_server -EOF - mv /etc/inetd.conf.new /etc/inetd.conf +echo "firebird user using uid $fbUID" +echo "firebird user using gid $fbGID" - if [ -f /var/run/inetd.pid ]; then - kill -HUP `cat /var/run/inetd.pid` +if which -s pw; then + if [ $nofbuid -ne 0 ]; then + pw useradd firebird -u $fbUID -g $fbGID -h - -s /bin/sh \ + -d $PKG_PREFIX/firebird -c "Firebird Database Administrator" fi +else + echo -n "unable to create user firebird - please create it manually," + echo " before reinstalling this package." + exit 1 +fi +;; + +POST-INSTALL) +cd $PKG_PREFIX/firebird + +# Lock files + +for i in isc_init1 isc_lock1 isc_event1 +do + FileName=$i.`hostname` + touch $FileName + chmod uga=rw $FileName + chown firebird:firebird $FileName +done + +touch firebird.log +chown firebird:firebird firebird.log + +;; + esac diff --git a/databases/firebird20-server/files/pkg-message.in b/databases/firebird20-server/files/pkg-message.in index 2cab9049eba5..02894da409f2 100644 --- a/databases/firebird20-server/files/pkg-message.in +++ b/databases/firebird20-server/files/pkg-message.in @@ -1,8 +1,20 @@ + --------------------------------------------------------- -Firebird is now installed. A symbolic link from -/usr/interbase -> %%PREFIX%%/firebird may be needed -for compatibility with existing programs that use -Firebird. +Firebird is now installed. + +To start the server add the following line to /etc/services: + +gds_db 3050/tcp #InterBase Database Remote Protocol + +And add the following line to /etc/inetd.conf + +gds_db stream tcp nowait firebird %%PREFIX%%/firebird/bin/fb_inet_server fb_inet_server + +And finally restart inetd. + +A symbolic link from /usr/interbase -> %%PREFIX%%/firebird +may be needed for compatibility with existing programs +that use Firebird. The symbolic link can be created with: @@ -20,3 +32,4 @@ before doing anything serious with Firebird. See %%PREFIX%%/firebird/RELNOTES for more. --------------------------------------------------------- + |
