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 | |
parent | 21d36fe64c9977c4f976cb7e054e976391b91b49 (diff) | |
download | ports-051242452f205f081a5b9abeb8a58993edc1a8f0.tar.gz ports-051242452f205f081a5b9abeb8a58993edc1a8f0.zip |
Notes
Diffstat (limited to 'databases')
21 files changed, 399 insertions, 375 deletions
diff --git a/databases/firebird-server/Makefile b/databases/firebird-server/Makefile index 61788ec7492f..6d800a8bdd19 100644 --- a/databases/firebird-server/Makefile +++ b/databases/firebird-server/Makefile @@ -7,6 +7,7 @@ PORTNAME?= firebird PORTVERSION= 1.5.2 +PORTREVISION= 1 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR=firebird @@ -54,6 +55,8 @@ BINMODE= 550 SHAREOWN= firebird SHAREGRP= firebird +SUB_FILES= pkg-install pkg-message aliases.conf + PKGMESSAGE= ${WRKDIR}/pkg-message PKGINSTALL= ${WRKDIR}/pkg-install @@ -67,6 +70,10 @@ ALL_TARGET= firebird_basic libfbembed embed_gfix embed_gbak embed_isql embed_gpr embed_util embed_gdef embed_qli libfbclient extlib INSTALLS_SHLIB= yes + +.if !defined(NOPORTDOCS) +PORTDOCS= * +.endif .endif .include <bsd.port.pre.mk> @@ -85,40 +92,25 @@ pre-everything:: .if !defined(BATCH) @sleep 10 .endif +.endif post-patch: +.if !defined(CLIENT_ONLY) @${REINPLACE_CMD} -e 's|^\(LINK_OPTS +=.*\)$$|\1 -L${LOCALBASE}/lib|' \ ${WRKSRC}/builds/posix/Makefile.in.inet_server +.endif + @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' \ + ${WRKSRC}/src/jrd/gds.cpp -post-build: - ${SED} 's|%%PREFIX%%|${PREFIX}|g' \ - < ${FILESDIR}/pkg-message.in \ - > ${PKGMESSAGE} - - ${SED} -e 's|%%PREFIX%%|${PREFIX}/firebird|g' \ - < ${FILESDIR}/pkg-install.in \ - > ${PKGINSTALL} - - ${SED} -e "s|%%PREFIX%%|${PREFIX}/firebird|g" \ - < ${FILESDIR}/aliases.conf.in \ - > ${WRKDIR}/aliases.conf - +.if !defined(CLIENT_ONLY) pre-install: - ${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL + @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL post-install: - ${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL - @${ECHO_MSG} + @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} - @${ECHO_MSG} .endif -patch-autotools: - @${DO_NADA} - -run-autotools: - @${DO_NADA} - do-configure: @(cd ${WRKSRC} && ${SETENV} CC=${CC} CXX=${CXX} MAKE=${GMAKE} \ ${AUTOTOOLS_VARS} ./autogen.sh ${AUTOGENARGS}) @@ -126,6 +118,12 @@ do-configure: post-configure: @${REINPLACE_CMD} -e 's|__attribute__ ((__unused__));||' \ ${WRKSRC}/src/dsql/parse.cpp + @${REINPLACE_CMD} -e 's|firebird\.conf|${PREFIX}/etc/firebird.conf|g; \ + s|root_dir + string(CONFIG_FILE)|string(CONFIG_FILE)|g' \ + ${WRKSRC}/src/jrd/os/posix/config_root.cpp + +do-build: + @(cd ${WRKSRC} && ${SETENV} CC=${CC} CXX=${CXX} ${GMAKE} ${ALL_TARGET}) do-install: .if !defined(CLIENT_ONLY) @@ -139,11 +137,9 @@ do-install: .endfor ${INSTALL_DATA} ${WRKDIR}/aliases.conf ${PREFIX}/firebird/aliases.conf.sample - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/firebird/firebird.conf.sample ${INSTALL_DATA} ${WRKSRC}/gen/firebird/security.fdb ${PREFIX}/firebird/security.fdb.sample ${CHMOD} 660 ${PREFIX}/firebird/security.fdb.sample - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/firebird.msg ${PREFIX}/firebird/firebird.msg ${INSTALL_DATA} ${WRKSRC}/gen/firebird/help/help.fdb ${PREFIX}/firebird/help .for f in ib_udf.so fbudf.so @@ -165,15 +161,16 @@ do-install: .else -.for dir in include share/doc/firebird \ - share/doc/firebird/sql.extensions share/examples/firebird - ${MKDIR} ${PREFIX}/${dir} -.endfor - .for f in fb_lock_print gbak gdef gds_drop gfix gpre gsec gstat isql qli ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/bin/${f} ${PREFIX}/bin .endfor + @${MKDIR} ${PREFIX}/etc +.if !exists(${PREFIX}/etc/firebird.conf) + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/etc +.endif + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/etc/firebird.conf.sample + ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/lib/libfbclient.so.${PORTVERSION} ${PREFIX}/lib ${LN} -fs libfbclient.so.${PORTVERSION} ${PREFIX}/lib/libfbclient.so.1 ${LN} -fs libfbclient.so.1 ${PREFIX}/lib/libfbclient.so @@ -187,15 +184,23 @@ do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/lib/libib_util.so ${PREFIX}/lib + @${MKDIR} ${PREFIX}/include ${INSTALL_DATA} ${WRKSRC}/gen/firebird/include/*.h ${PREFIX}/include - ${INSTALL_DATA} ${WRKSRC}/doc/WhatsNew ${PREFIX}/share/doc/firebird - ${INSTALL_DATA} ${WRKSRC}/doc/README.* ${PREFIX}/share/doc/firebird - ${INSTALL_DATA} ${WRKSRC}/doc/README.user ${PREFIX}/share/doc/firebird/README - ${INSTALL_DATA} ${WRKSRC}/doc/sql.extensions/README.* ${PREFIX}/share/doc/firebird/sql.extensions + @${MKDIR} ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/firebird.msg ${DATADIR} + +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR}/sql.extensions + ${INSTALL_DATA} ${WRKSRC}/doc/WhatsNew ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/README.* ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/README.user ${DOCSDIR}/README + ${INSTALL_DATA} ${WRKSRC}/doc/sql.extensions/README.* ${DOCSDIR}/sql.extensions +.endif # Install examples - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/examples/v5/* ${PREFIX}/share/examples/firebird + @${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/examples/v5/* ${EXAMPLESDIR} .endif .include <bsd.port.post.mk> diff --git a/databases/firebird-server/files/aliases.conf.in b/databases/firebird-server/files/aliases.conf.in index 05a28980b909..a49d31d96fdf 100644 --- a/databases/firebird-server/files/aliases.conf.in +++ b/databases/firebird-server/files/aliases.conf.in @@ -4,5 +4,5 @@ # # Examples: # -# employee = %%PREFIX%%/examples/employee.fdb +# employee = %%EXAMPLESDIR%%/employee.fdb # diff --git a/databases/firebird-server/files/patch-src::jrd::gds.cpp b/databases/firebird-server/files/patch-src::jrd::gds.cpp new file mode 100644 index 000000000000..12c0cd025551 --- /dev/null +++ b/databases/firebird-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/firebird-server/files/pkg-install.in b/databases/firebird-server/files/pkg-install.in index d442ff99ee3f..b2da81e8fb00 100644 --- a/databases/firebird-server/files/pkg-install.in +++ b/databases/firebird-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/firebird-server/files/pkg-message.in b/databases/firebird-server/files/pkg-message.in index 2cab9049eba5..02894da409f2 100644 --- a/databases/firebird-server/files/pkg-message.in +++ b/databases/firebird-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. --------------------------------------------------------- + diff --git a/databases/firebird-server/pkg-plist b/databases/firebird-server/pkg-plist index 43e32f04ced0..e8024dcf4eae 100644 --- a/databases/firebird-server/pkg-plist +++ b/databases/firebird-server/pkg-plist @@ -1,3 +1,4 @@ +@comment $FreeBSD$ firebird/RELNOTES firebird/UDF/fbudf.so firebird/UDF/fbudf.sql @@ -8,11 +9,7 @@ firebird/aliases.conf.sample @exec [ -f %B/aliases.conf ] || cp %B/%f %B/aliases.conf firebird/bin/fb_inet_server firebird/bin/fb_lock_mgr -@unexec if cmp -s %D/firebird/firebird.conf %D/firebird/firebird.conf.sample; then rm -f %D/firebird/firebird.conf; fi -firebird/firebird.conf.sample -@exec [ -f %B/firebird.conf ] || cp %B/%f %B/firebird.conf @unexec [ -s %D/firebird/firebird.log ] || rm -f %D/firebird/firebird.log -firebird/firebird.msg firebird/help/help.fdb firebird/intl/fbintl @unexec rm -f %D/firebird/isc_event1.`hostname` diff --git a/databases/firebird-server/pkg-plist.client b/databases/firebird-server/pkg-plist.client index 3f302be5fd42..03fb94025663 100644 --- a/databases/firebird-server/pkg-plist.client +++ b/databases/firebird-server/pkg-plist.client @@ -1,3 +1,4 @@ +@comment $FreeBSD$ bin/fb_lock_print bin/gbak bin/gdef @@ -23,30 +24,11 @@ lib/libfbembed.so.%%FIREBIRD_VERSION%% lib/libgds.so lib/libgds.so.1 lib/libib_util.so -%%DOCSDIR%%/README.NTSecurity -%%DOCSDIR%%/README.Win32LibraryInstallation.txt -%%DOCSDIR%%/README.build.mingw.html -%%DOCSDIR%%/README.build.msvc.html -%%DOCSDIR%%/README.install.Solaris_on_Intel -%%DOCSDIR%%/README.instsvc -%%DOCSDIR%%/README.makefiles -%%DOCSDIR%%/README.user -%%DOCSDIR%%/README.user.embedded -%%DOCSDIR%%/README.user.troubleshooting -%%DOCSDIR%%/README -%%DOCSDIR%%/WhatsNew -%%DOCSDIR%%/sql.extensions/README.aggregate_tracking -%%DOCSDIR%%/sql.extensions/README.case -%%DOCSDIR%%/sql.extensions/README.coalesce -%%DOCSDIR%%/sql.extensions/README.context_variables -%%DOCSDIR%%/sql.extensions/README.data_types -%%DOCSDIR%%/sql.extensions/README.exception_handling -%%DOCSDIR%%/sql.extensions/README.execute_statement -%%DOCSDIR%%/sql.extensions/README.explicit_locks -%%DOCSDIR%%/sql.extensions/README.nullif -%%DOCSDIR%%/sql.extensions/README.order_by_expressions_nulls -%%DOCSDIR%%/sql.extensions/README.savepoints -%%DOCSDIR%%/sql.extensions/README.universal_triggers +@unexec if cmp -s %D/etc/firebird.conf %D/etc/firebird.conf.sample; then rm -f %D/etc/firebird.conf; fi +etc/firebird.conf.sample +@exec [ -f %B/firebird.conf ] || cp %B/%f %B/firebird.conf +%%DATADIR%%/firebird.msg +@dirrm %%DATADIR%% %%EXAMPLESDIR%%/align.h %%EXAMPLESDIR%%/api1.c %%EXAMPLESDIR%%/api10.c @@ -94,6 +76,4 @@ lib/libib_util.so %%EXAMPLESDIR%%/stat9.e %%EXAMPLESDIR%%/udf.sql %%EXAMPLESDIR%%/udflib.c -@dirrm %%DOCSDIR%%/sql.extensions -@dirrm %%DOCSDIR%% @dirrm %%EXAMPLESDIR%% diff --git a/databases/firebird2-server/Makefile b/databases/firebird2-server/Makefile index 61788ec7492f..6d800a8bdd19 100644 --- a/databases/firebird2-server/Makefile +++ b/databases/firebird2-server/Makefile @@ -7,6 +7,7 @@ PORTNAME?= firebird PORTVERSION= 1.5.2 +PORTREVISION= 1 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR=firebird @@ -54,6 +55,8 @@ BINMODE= 550 SHAREOWN= firebird SHAREGRP= firebird +SUB_FILES= pkg-install pkg-message aliases.conf + PKGMESSAGE= ${WRKDIR}/pkg-message PKGINSTALL= ${WRKDIR}/pkg-install @@ -67,6 +70,10 @@ ALL_TARGET= firebird_basic libfbembed embed_gfix embed_gbak embed_isql embed_gpr embed_util embed_gdef embed_qli libfbclient extlib INSTALLS_SHLIB= yes + +.if !defined(NOPORTDOCS) +PORTDOCS= * +.endif .endif .include <bsd.port.pre.mk> @@ -85,40 +92,25 @@ pre-everything:: .if !defined(BATCH) @sleep 10 .endif +.endif post-patch: +.if !defined(CLIENT_ONLY) @${REINPLACE_CMD} -e 's|^\(LINK_OPTS +=.*\)$$|\1 -L${LOCALBASE}/lib|' \ ${WRKSRC}/builds/posix/Makefile.in.inet_server +.endif + @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' \ + ${WRKSRC}/src/jrd/gds.cpp -post-build: - ${SED} 's|%%PREFIX%%|${PREFIX}|g' \ - < ${FILESDIR}/pkg-message.in \ - > ${PKGMESSAGE} - - ${SED} -e 's|%%PREFIX%%|${PREFIX}/firebird|g' \ - < ${FILESDIR}/pkg-install.in \ - > ${PKGINSTALL} - - ${SED} -e "s|%%PREFIX%%|${PREFIX}/firebird|g" \ - < ${FILESDIR}/aliases.conf.in \ - > ${WRKDIR}/aliases.conf - +.if !defined(CLIENT_ONLY) pre-install: - ${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL + @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL post-install: - ${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL - @${ECHO_MSG} + @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} - @${ECHO_MSG} .endif -patch-autotools: - @${DO_NADA} - -run-autotools: - @${DO_NADA} - do-configure: @(cd ${WRKSRC} && ${SETENV} CC=${CC} CXX=${CXX} MAKE=${GMAKE} \ ${AUTOTOOLS_VARS} ./autogen.sh ${AUTOGENARGS}) @@ -126,6 +118,12 @@ do-configure: post-configure: @${REINPLACE_CMD} -e 's|__attribute__ ((__unused__));||' \ ${WRKSRC}/src/dsql/parse.cpp + @${REINPLACE_CMD} -e 's|firebird\.conf|${PREFIX}/etc/firebird.conf|g; \ + s|root_dir + string(CONFIG_FILE)|string(CONFIG_FILE)|g' \ + ${WRKSRC}/src/jrd/os/posix/config_root.cpp + +do-build: + @(cd ${WRKSRC} && ${SETENV} CC=${CC} CXX=${CXX} ${GMAKE} ${ALL_TARGET}) do-install: .if !defined(CLIENT_ONLY) @@ -139,11 +137,9 @@ do-install: .endfor ${INSTALL_DATA} ${WRKDIR}/aliases.conf ${PREFIX}/firebird/aliases.conf.sample - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/firebird/firebird.conf.sample ${INSTALL_DATA} ${WRKSRC}/gen/firebird/security.fdb ${PREFIX}/firebird/security.fdb.sample ${CHMOD} 660 ${PREFIX}/firebird/security.fdb.sample - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/firebird.msg ${PREFIX}/firebird/firebird.msg ${INSTALL_DATA} ${WRKSRC}/gen/firebird/help/help.fdb ${PREFIX}/firebird/help .for f in ib_udf.so fbudf.so @@ -165,15 +161,16 @@ do-install: .else -.for dir in include share/doc/firebird \ - share/doc/firebird/sql.extensions share/examples/firebird - ${MKDIR} ${PREFIX}/${dir} -.endfor - .for f in fb_lock_print gbak gdef gds_drop gfix gpre gsec gstat isql qli ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/bin/${f} ${PREFIX}/bin .endfor + @${MKDIR} ${PREFIX}/etc +.if !exists(${PREFIX}/etc/firebird.conf) + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/etc +.endif + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/etc/firebird.conf.sample + ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/lib/libfbclient.so.${PORTVERSION} ${PREFIX}/lib ${LN} -fs libfbclient.so.${PORTVERSION} ${PREFIX}/lib/libfbclient.so.1 ${LN} -fs libfbclient.so.1 ${PREFIX}/lib/libfbclient.so @@ -187,15 +184,23 @@ do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/lib/libib_util.so ${PREFIX}/lib + @${MKDIR} ${PREFIX}/include ${INSTALL_DATA} ${WRKSRC}/gen/firebird/include/*.h ${PREFIX}/include - ${INSTALL_DATA} ${WRKSRC}/doc/WhatsNew ${PREFIX}/share/doc/firebird - ${INSTALL_DATA} ${WRKSRC}/doc/README.* ${PREFIX}/share/doc/firebird - ${INSTALL_DATA} ${WRKSRC}/doc/README.user ${PREFIX}/share/doc/firebird/README - ${INSTALL_DATA} ${WRKSRC}/doc/sql.extensions/README.* ${PREFIX}/share/doc/firebird/sql.extensions + @${MKDIR} ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/firebird.msg ${DATADIR} + +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR}/sql.extensions + ${INSTALL_DATA} ${WRKSRC}/doc/WhatsNew ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/README.* ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/README.user ${DOCSDIR}/README + ${INSTALL_DATA} ${WRKSRC}/doc/sql.extensions/README.* ${DOCSDIR}/sql.extensions +.endif # Install examples - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/examples/v5/* ${PREFIX}/share/examples/firebird + @${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/examples/v5/* ${EXAMPLESDIR} .endif .include <bsd.port.post.mk> diff --git a/databases/firebird2-server/files/aliases.conf.in b/databases/firebird2-server/files/aliases.conf.in index 05a28980b909..a49d31d96fdf 100644 --- a/databases/firebird2-server/files/aliases.conf.in +++ b/databases/firebird2-server/files/aliases.conf.in @@ -4,5 +4,5 @@ # # Examples: # -# employee = %%PREFIX%%/examples/employee.fdb +# employee = %%EXAMPLESDIR%%/employee.fdb # diff --git a/databases/firebird2-server/files/patch-src::jrd::gds.cpp b/databases/firebird2-server/files/patch-src::jrd::gds.cpp new file mode 100644 index 000000000000..12c0cd025551 --- /dev/null +++ b/databases/firebird2-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/firebird2-server/files/pkg-install.in b/databases/firebird2-server/files/pkg-install.in index d442ff99ee3f..b2da81e8fb00 100644 --- a/databases/firebird2-server/files/pkg-install.in +++ b/databases/firebird2-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/firebird2-server/files/pkg-message.in b/databases/firebird2-server/files/pkg-message.in index 2cab9049eba5..02894da409f2 100644 --- a/databases/firebird2-server/files/pkg-message.in +++ b/databases/firebird2-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. --------------------------------------------------------- + diff --git a/databases/firebird2-server/pkg-plist b/databases/firebird2-server/pkg-plist index 43e32f04ced0..e8024dcf4eae 100644 --- a/databases/firebird2-server/pkg-plist +++ b/databases/firebird2-server/pkg-plist @@ -1,3 +1,4 @@ +@comment $FreeBSD$ firebird/RELNOTES firebird/UDF/fbudf.so firebird/UDF/fbudf.sql @@ -8,11 +9,7 @@ firebird/aliases.conf.sample @exec [ -f %B/aliases.conf ] || cp %B/%f %B/aliases.conf firebird/bin/fb_inet_server firebird/bin/fb_lock_mgr -@unexec if cmp -s %D/firebird/firebird.conf %D/firebird/firebird.conf.sample; then rm -f %D/firebird/firebird.conf; fi -firebird/firebird.conf.sample -@exec [ -f %B/firebird.conf ] || cp %B/%f %B/firebird.conf @unexec [ -s %D/firebird/firebird.log ] || rm -f %D/firebird/firebird.log -firebird/firebird.msg firebird/help/help.fdb firebird/intl/fbintl @unexec rm -f %D/firebird/isc_event1.`hostname` diff --git a/databases/firebird2-server/pkg-plist.client b/databases/firebird2-server/pkg-plist.client index 3f302be5fd42..03fb94025663 100644 --- a/databases/firebird2-server/pkg-plist.client +++ b/databases/firebird2-server/pkg-plist.client @@ -1,3 +1,4 @@ +@comment $FreeBSD$ bin/fb_lock_print bin/gbak bin/gdef @@ -23,30 +24,11 @@ lib/libfbembed.so.%%FIREBIRD_VERSION%% lib/libgds.so lib/libgds.so.1 lib/libib_util.so -%%DOCSDIR%%/README.NTSecurity -%%DOCSDIR%%/README.Win32LibraryInstallation.txt -%%DOCSDIR%%/README.build.mingw.html -%%DOCSDIR%%/README.build.msvc.html -%%DOCSDIR%%/README.install.Solaris_on_Intel -%%DOCSDIR%%/README.instsvc -%%DOCSDIR%%/README.makefiles -%%DOCSDIR%%/README.user -%%DOCSDIR%%/README.user.embedded -%%DOCSDIR%%/README.user.troubleshooting -%%DOCSDIR%%/README -%%DOCSDIR%%/WhatsNew -%%DOCSDIR%%/sql.extensions/README.aggregate_tracking -%%DOCSDIR%%/sql.extensions/README.case -%%DOCSDIR%%/sql.extensions/README.coalesce -%%DOCSDIR%%/sql.extensions/README.context_variables -%%DOCSDIR%%/sql.extensions/README.data_types -%%DOCSDIR%%/sql.extensions/README.exception_handling -%%DOCSDIR%%/sql.extensions/README.execute_statement -%%DOCSDIR%%/sql.extensions/README.explicit_locks -%%DOCSDIR%%/sql.extensions/README.nullif -%%DOCSDIR%%/sql.extensions/README.order_by_expressions_nulls -%%DOCSDIR%%/sql.extensions/README.savepoints -%%DOCSDIR%%/sql.extensions/README.universal_triggers +@unexec if cmp -s %D/etc/firebird.conf %D/etc/firebird.conf.sample; then rm -f %D/etc/firebird.conf; fi +etc/firebird.conf.sample +@exec [ -f %B/firebird.conf ] || cp %B/%f %B/firebird.conf +%%DATADIR%%/firebird.msg +@dirrm %%DATADIR%% %%EXAMPLESDIR%%/align.h %%EXAMPLESDIR%%/api1.c %%EXAMPLESDIR%%/api10.c @@ -94,6 +76,4 @@ lib/libib_util.so %%EXAMPLESDIR%%/stat9.e %%EXAMPLESDIR%%/udf.sql %%EXAMPLESDIR%%/udflib.c -@dirrm %%DOCSDIR%%/sql.extensions -@dirrm %%DOCSDIR%% @dirrm %%EXAMPLESDIR%% diff --git a/databases/firebird20-server/Makefile b/databases/firebird20-server/Makefile index 61788ec7492f..6d800a8bdd19 100644 --- a/databases/firebird20-server/Makefile +++ b/databases/firebird20-server/Makefile @@ -7,6 +7,7 @@ PORTNAME?= firebird PORTVERSION= 1.5.2 +PORTREVISION= 1 CATEGORIES?= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR=firebird @@ -54,6 +55,8 @@ BINMODE= 550 SHAREOWN= firebird SHAREGRP= firebird +SUB_FILES= pkg-install pkg-message aliases.conf + PKGMESSAGE= ${WRKDIR}/pkg-message PKGINSTALL= ${WRKDIR}/pkg-install @@ -67,6 +70,10 @@ ALL_TARGET= firebird_basic libfbembed embed_gfix embed_gbak embed_isql embed_gpr embed_util embed_gdef embed_qli libfbclient extlib INSTALLS_SHLIB= yes + +.if !defined(NOPORTDOCS) +PORTDOCS= * +.endif .endif .include <bsd.port.pre.mk> @@ -85,40 +92,25 @@ pre-everything:: .if !defined(BATCH) @sleep 10 .endif +.endif post-patch: +.if !defined(CLIENT_ONLY) @${REINPLACE_CMD} -e 's|^\(LINK_OPTS +=.*\)$$|\1 -L${LOCALBASE}/lib|' \ ${WRKSRC}/builds/posix/Makefile.in.inet_server +.endif + @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' \ + ${WRKSRC}/src/jrd/gds.cpp -post-build: - ${SED} 's|%%PREFIX%%|${PREFIX}|g' \ - < ${FILESDIR}/pkg-message.in \ - > ${PKGMESSAGE} - - ${SED} -e 's|%%PREFIX%%|${PREFIX}/firebird|g' \ - < ${FILESDIR}/pkg-install.in \ - > ${PKGINSTALL} - - ${SED} -e "s|%%PREFIX%%|${PREFIX}/firebird|g" \ - < ${FILESDIR}/aliases.conf.in \ - > ${WRKDIR}/aliases.conf - +.if !defined(CLIENT_ONLY) pre-install: - ${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL + @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL post-install: - ${SETENV} PKG_PREFIX="${PREFIX}" PKG_DESTDIR="${DESTDIR}" ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL - @${ECHO_MSG} + @${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} - @${ECHO_MSG} .endif -patch-autotools: - @${DO_NADA} - -run-autotools: - @${DO_NADA} - do-configure: @(cd ${WRKSRC} && ${SETENV} CC=${CC} CXX=${CXX} MAKE=${GMAKE} \ ${AUTOTOOLS_VARS} ./autogen.sh ${AUTOGENARGS}) @@ -126,6 +118,12 @@ do-configure: post-configure: @${REINPLACE_CMD} -e 's|__attribute__ ((__unused__));||' \ ${WRKSRC}/src/dsql/parse.cpp + @${REINPLACE_CMD} -e 's|firebird\.conf|${PREFIX}/etc/firebird.conf|g; \ + s|root_dir + string(CONFIG_FILE)|string(CONFIG_FILE)|g' \ + ${WRKSRC}/src/jrd/os/posix/config_root.cpp + +do-build: + @(cd ${WRKSRC} && ${SETENV} CC=${CC} CXX=${CXX} ${GMAKE} ${ALL_TARGET}) do-install: .if !defined(CLIENT_ONLY) @@ -139,11 +137,9 @@ do-install: .endfor ${INSTALL_DATA} ${WRKDIR}/aliases.conf ${PREFIX}/firebird/aliases.conf.sample - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/firebird/firebird.conf.sample ${INSTALL_DATA} ${WRKSRC}/gen/firebird/security.fdb ${PREFIX}/firebird/security.fdb.sample ${CHMOD} 660 ${PREFIX}/firebird/security.fdb.sample - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/firebird.msg ${PREFIX}/firebird/firebird.msg ${INSTALL_DATA} ${WRKSRC}/gen/firebird/help/help.fdb ${PREFIX}/firebird/help .for f in ib_udf.so fbudf.so @@ -165,15 +161,16 @@ do-install: .else -.for dir in include share/doc/firebird \ - share/doc/firebird/sql.extensions share/examples/firebird - ${MKDIR} ${PREFIX}/${dir} -.endfor - .for f in fb_lock_print gbak gdef gds_drop gfix gpre gsec gstat isql qli ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/bin/${f} ${PREFIX}/bin .endfor + @${MKDIR} ${PREFIX}/etc +.if !exists(${PREFIX}/etc/firebird.conf) + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/etc +.endif + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/misc/firebird.conf ${PREFIX}/etc/firebird.conf.sample + ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/lib/libfbclient.so.${PORTVERSION} ${PREFIX}/lib ${LN} -fs libfbclient.so.${PORTVERSION} ${PREFIX}/lib/libfbclient.so.1 ${LN} -fs libfbclient.so.1 ${PREFIX}/lib/libfbclient.so @@ -187,15 +184,23 @@ do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gen/firebird/lib/libib_util.so ${PREFIX}/lib + @${MKDIR} ${PREFIX}/include ${INSTALL_DATA} ${WRKSRC}/gen/firebird/include/*.h ${PREFIX}/include - ${INSTALL_DATA} ${WRKSRC}/doc/WhatsNew ${PREFIX}/share/doc/firebird - ${INSTALL_DATA} ${WRKSRC}/doc/README.* ${PREFIX}/share/doc/firebird - ${INSTALL_DATA} ${WRKSRC}/doc/README.user ${PREFIX}/share/doc/firebird/README - ${INSTALL_DATA} ${WRKSRC}/doc/sql.extensions/README.* ${PREFIX}/share/doc/firebird/sql.extensions + @${MKDIR} ${DATADIR} + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/firebird.msg ${DATADIR} + +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR}/sql.extensions + ${INSTALL_DATA} ${WRKSRC}/doc/WhatsNew ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/README.* ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/README.user ${DOCSDIR}/README + ${INSTALL_DATA} ${WRKSRC}/doc/sql.extensions/README.* ${DOCSDIR}/sql.extensions +.endif # Install examples - ${INSTALL_DATA} ${WRKSRC}/gen/firebird/examples/v5/* ${PREFIX}/share/examples/firebird + @${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/gen/firebird/examples/v5/* ${EXAMPLESDIR} .endif .include <bsd.port.post.mk> 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. --------------------------------------------------------- + diff --git a/databases/firebird20-server/pkg-plist b/databases/firebird20-server/pkg-plist index 43e32f04ced0..e8024dcf4eae 100644 --- a/databases/firebird20-server/pkg-plist +++ b/databases/firebird20-server/pkg-plist @@ -1,3 +1,4 @@ +@comment $FreeBSD$ firebird/RELNOTES firebird/UDF/fbudf.so firebird/UDF/fbudf.sql @@ -8,11 +9,7 @@ firebird/aliases.conf.sample @exec [ -f %B/aliases.conf ] || cp %B/%f %B/aliases.conf firebird/bin/fb_inet_server firebird/bin/fb_lock_mgr -@unexec if cmp -s %D/firebird/firebird.conf %D/firebird/firebird.conf.sample; then rm -f %D/firebird/firebird.conf; fi -firebird/firebird.conf.sample -@exec [ -f %B/firebird.conf ] || cp %B/%f %B/firebird.conf @unexec [ -s %D/firebird/firebird.log ] || rm -f %D/firebird/firebird.log -firebird/firebird.msg firebird/help/help.fdb firebird/intl/fbintl @unexec rm -f %D/firebird/isc_event1.`hostname` diff --git a/databases/firebird20-server/pkg-plist.client b/databases/firebird20-server/pkg-plist.client index 3f302be5fd42..03fb94025663 100644 --- a/databases/firebird20-server/pkg-plist.client +++ b/databases/firebird20-server/pkg-plist.client @@ -1,3 +1,4 @@ +@comment $FreeBSD$ bin/fb_lock_print bin/gbak bin/gdef @@ -23,30 +24,11 @@ lib/libfbembed.so.%%FIREBIRD_VERSION%% lib/libgds.so lib/libgds.so.1 lib/libib_util.so -%%DOCSDIR%%/README.NTSecurity -%%DOCSDIR%%/README.Win32LibraryInstallation.txt -%%DOCSDIR%%/README.build.mingw.html -%%DOCSDIR%%/README.build.msvc.html -%%DOCSDIR%%/README.install.Solaris_on_Intel -%%DOCSDIR%%/README.instsvc -%%DOCSDIR%%/README.makefiles -%%DOCSDIR%%/README.user -%%DOCSDIR%%/README.user.embedded -%%DOCSDIR%%/README.user.troubleshooting -%%DOCSDIR%%/README -%%DOCSDIR%%/WhatsNew -%%DOCSDIR%%/sql.extensions/README.aggregate_tracking -%%DOCSDIR%%/sql.extensions/README.case -%%DOCSDIR%%/sql.extensions/README.coalesce -%%DOCSDIR%%/sql.extensions/README.context_variables -%%DOCSDIR%%/sql.extensions/README.data_types -%%DOCSDIR%%/sql.extensions/README.exception_handling -%%DOCSDIR%%/sql.extensions/README.execute_statement -%%DOCSDIR%%/sql.extensions/README.explicit_locks -%%DOCSDIR%%/sql.extensions/README.nullif -%%DOCSDIR%%/sql.extensions/README.order_by_expressions_nulls -%%DOCSDIR%%/sql.extensions/README.savepoints -%%DOCSDIR%%/sql.extensions/README.universal_triggers +@unexec if cmp -s %D/etc/firebird.conf %D/etc/firebird.conf.sample; then rm -f %D/etc/firebird.conf; fi +etc/firebird.conf.sample +@exec [ -f %B/firebird.conf ] || cp %B/%f %B/firebird.conf +%%DATADIR%%/firebird.msg +@dirrm %%DATADIR%% %%EXAMPLESDIR%%/align.h %%EXAMPLESDIR%%/api1.c %%EXAMPLESDIR%%/api10.c @@ -94,6 +76,4 @@ lib/libib_util.so %%EXAMPLESDIR%%/stat9.e %%EXAMPLESDIR%%/udf.sql %%EXAMPLESDIR%%/udflib.c -@dirrm %%DOCSDIR%%/sql.extensions -@dirrm %%DOCSDIR%% @dirrm %%EXAMPLESDIR%% |