From 2e8060f08143cc512311fc30b7f2d7d3b964e6f4 Mon Sep 17 00:00:00 2001 From: Adriano dos Santos Fernandes Date: Thu, 28 Nov 2019 12:54:50 -0300 Subject: [PATCH] Frontport changes for MacOS build. --- .github/workflows/main.yml | 26 +-- .travis.yml | 88 ++++++-- .../arch-specific/darwin/Distribution.xml | 19 ++ .../install/arch-specific/darwin/Makefile.in | 129 +++-------- .../install/arch-specific/darwin/Readme.txt | 11 +- .../install/arch-specific/darwin/Welcome.txt | 4 +- .../arch-specific/darwin/changeServerMode | 134 +++++++++++ .../install/arch-specific/darwin/embed.darwin | 109 +++++---- .../arch-specific/darwin/install-script | 84 ++++--- .../darwin/launchd.org.firebird.gds.plist | 27 +-- .../darwin/launchdcs.org.firebird.gds.plist | 35 +++ .../arch-specific/darwin/preupgrade-script | 16 +- builds/posix/Makefile.in | 69 +++--- builds/posix/darwin.defaults | 15 +- builds/posix/make.defaults | 48 +++- builds/posix/postfix.darwin | 209 +++++------------- builds/posix/prefix.darwin_x86_64 | 6 +- extern/cloop/Makefile | 2 + extern/libtommath/makefile.shared | 24 +- src/common/unicode_util.cpp | 8 +- 20 files changed, 586 insertions(+), 477 deletions(-) create mode 100644 builds/install/arch-specific/darwin/Distribution.xml create mode 100755 builds/install/arch-specific/darwin/changeServerMode create mode 100644 builds/install/arch-specific/darwin/launchdcs.org.firebird.gds.plist diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 329fa6bd0a..3d7d1490fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,11 +11,11 @@ jobs: matrix: # Build is segfaulting in Ubuntu. #os: [macOS-latest, windows-2016, ubuntu-16.04] - os: [windows-2016] + os: [macOS-latest, windows-2016] platform: [x64, x86] - #exclude: - # - os: macOS-latest - # platform: x86 + exclude: + - os: macOS-latest + platform: x86 # - os: ubuntu-16.04 # platform: x86 @@ -47,9 +47,9 @@ jobs: mkdir extern/icu-macos pushd extern/icu-macos - wget https://github.com/unicode-org/icu/releases/download/release-59-2/icu4c-59_2-src.tgz - wget https://github.com/unicode-org/icu/commit/24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch - tar xzvf icu4c-59_2-src.tgz + curl -OL https://github.com/unicode-org/icu/releases/download/release-63-2/icu4c-63_2-src.tgz + curl -OL https://github.com/unicode-org/icu/commit/24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch + tar xzf icu4c-63_2-src.tgz ICU_INSTALL_PATH=`pwd`/install cd icu/source patch -p3 < ../../24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch @@ -59,14 +59,14 @@ jobs: install_name_tool -id @rpath/lib/libicuuc.dylib $ICU_INSTALL_PATH/lib/libicuuc.dylib install_name_tool -id @rpath/lib/libicui18n.dylib $ICU_INSTALL_PATH/lib/libicui18n.dylib install_name_tool -id @rpath/lib/libicudata.dylib $ICU_INSTALL_PATH/lib/libicudata.dylib - install_name_tool -change libicudata.59.dylib @loader_path/libicudata.59.dylib $ICU_INSTALL_PATH/lib/libicuuc.59.dylib - install_name_tool -change libicudata.59.dylib @loader_path/libicudata.59.dylib $ICU_INSTALL_PATH/lib/libicui18n.59.dylib - install_name_tool -change libicuuc.59.dylib @loader_path/libicuuc.59.dylib $ICU_INSTALL_PATH/lib/libicui18n.59.dylib + install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicuuc.63.dylib + install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib + install_name_tool -change libicuuc.63.dylib @loader_path/libicuuc.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib popd mkdir -p gen/Release/firebird/lib mkdir -p gen/Debug/firebird/lib - cp $ICU_INSTALL_PATH/lib/*.dylib gen/Release/firebird/lib/ - cp $ICU_INSTALL_PATH/lib/*.dylib gen/Debug/firebird/lib/ + cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Release/firebird/lib/ + cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Debug/firebird/lib/ - name: Build (MacOS) if: matrix.os == 'macOS-latest' @@ -79,7 +79,7 @@ jobs: export C_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$C_INCLUDE_PATH" export CPLUS_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$CPLUS_INCLUDE_PATH" - LIBRARY_PATH="$ICU_INSTALL_PATH/lib:$LIBRARY_PATH" ./autogen.sh --with-builtin-tommath + LIBRARY_PATH="$ICU_INSTALL_PATH/lib:$LIBRARY_PATH" ./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt make -j4 (cd gen; make -B -f make.platform.postfix ICU_LOC="$ICU_INSTALL_PATH/lib/") diff --git a/.travis.yml b/.travis.yml index d5b8f0a348..43e99f47d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,11 @@ +matrix: + include: + - os: osx + osx_image: xcode9.2 # macOS 10.12 Sierra + - os: osx + osx_image: xcode11.2 # macOS 10.14 Mojave + - os: linux + language: cpp notifications: @@ -6,25 +14,65 @@ notifications: sudo: required dist: xenial -branches: - except: - - B2_5_Release - - B2_1_Release - - B2_0_Release - - B1_5_Release - -addons: - apt: - packages: - - libtool-bin - - libtommath0 - - libtommath-dev - - libicu-dev - - zlib1g-dev +install: + - | + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + sudo apt-get update + sudo apt-get install -y libtool-bin libtommath0 libtommath-dev libicu-dev zlib1g-dev + fi script: - - ./autogen.sh --enable-binreloc --with-builtin-tomcrypt --prefix=/opt/firebird - - make -j4 - - make dist - - tar xzvf gen/Firebird-[0-9]*.tar.gz - - (cd Firebird-[0-9]*; sudo ./install.sh -silent) + - | + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + ./autogen.sh --enable-binreloc --with-builtin-tomcrypt --prefix=/opt/firebird + make -j4 + make dist + tar xzvf gen/Firebird-[0-9]*.tar.gz + (cd Firebird-[0-9]*; sudo ./install.sh -silent) + fi + + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + export LIBTOOLIZE=glibtoolize + export LIBTOOL=glibtool + + mkdir extern/icu-macos + pushd extern/icu-macos + curl -OL https://github.com/unicode-org/icu/releases/download/release-63-2/icu4c-63_2-src.tgz + curl -OL https://github.com/unicode-org/icu/commit/24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch + tar xzf icu4c-63_2-src.tgz + ICU_INSTALL_PATH=`pwd`/install + cd icu/source + patch -p3 < ../../24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch + ./runConfigureICU MacOSX --prefix=$ICU_INSTALL_PATH + make -j4 + make install + install_name_tool -id @rpath/lib/libicuuc.dylib $ICU_INSTALL_PATH/lib/libicuuc.dylib + install_name_tool -id @rpath/lib/libicui18n.dylib $ICU_INSTALL_PATH/lib/libicui18n.dylib + install_name_tool -id @rpath/lib/libicudata.dylib $ICU_INSTALL_PATH/lib/libicudata.dylib + install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicuuc.63.dylib + install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib + install_name_tool -change libicuuc.63.dylib @loader_path/libicuuc.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib + popd + mkdir -p gen/Release/firebird/lib + mkdir -p gen/Debug/firebird/lib + cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Release/firebird/lib/ + cp $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Debug/firebird/lib/ + + export C_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$C_INCLUDE_PATH" + export CPLUS_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$CPLUS_INCLUDE_PATH" + + LIBRARY_PATH="$ICU_INSTALL_PATH/lib:$LIBRARY_PATH" ./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt + make -j4 + + (cd gen; make -B -f make.platform.postfix ICU_LOC="$ICU_INSTALL_PATH/lib/") + (cd gen; make -B -f Makefile.install) + + # Rename directory to make sure the build is relocatable. + mv gen gen2 + sudo installer -pkg gen2/Release/*.pkg -verbose -target / + + export FIREBIRD_LOCK=`pwd`/temp + echo "create database 't.fdb'; select '1' from rdb\$database; select _win1252 '2' from rdb\$database; select _utf8 '3' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql + + echo "create database 'localhost:/tmp/t.fdb' user sysdba password 'masterkey'; select '11' from rdb\$database; select _win1252 '22' from rdb\$database; select _utf8 '33' collate unicode from rdb\$database;" | /Library/Frameworks/Firebird.framework/Resources/bin/isql + fi diff --git a/builds/install/arch-specific/darwin/Distribution.xml b/builds/install/arch-specific/darwin/Distribution.xml new file mode 100644 index 0000000000..e5471e3686 --- /dev/null +++ b/builds/install/arch-specific/darwin/Distribution.xml @@ -0,0 +1,19 @@ + + + Firebird Database Server + + + + + + + + + + + + + + + Firebird.pkg + diff --git a/builds/install/arch-specific/darwin/Makefile.in b/builds/install/arch-specific/darwin/Makefile.in index 342d4da5a7..41cd0c2eda 100644 --- a/builds/install/arch-specific/darwin/Makefile.in +++ b/builds/install/arch-specific/darwin/Makefile.in @@ -1,3 +1,5 @@ +TARGET ?= Release + # EKU: taken from Makefile.in.firebird ROOT=.. @@ -18,10 +20,10 @@ FB_REV_NO:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/revno FB_BUILD_NO:=$(shell cpp -DDARWIN -I. ../builds/install/arch-specific/darwin/buildno.c | tail -2 | sed -e 's/" "//g' -e 's/"//g') FB_PLATFORM:=$(CpuType) -package packages dist: package_@FIREBIRD_ARCH_TYPE@ +package: package_firebird -package_classic package_embedded: INST_NM=FirebirdCS-$(FB_MAJOR_VERS).$(FB_MINOR_VERS).$(FB_REV_NO)-$(FB_BUILD_NO)-$(FB_PLATFORM) -package_classic package_embedded: +package_firebird: INST_NM=Firebird-$(FB_MAJOR_VERS).$(FB_MINOR_VERS).$(FB_REV_NO)-$(FB_BUILD_NO)-$(FB_PLATFORM) +package_firebird: sed -e 's/_FB_BUILD_SUFFIX_/$(FB_VER_SUFFIX)/g' \ -e 's/_SMFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_SM)/g' \ -e 's/_MFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_M)/g' \ @@ -29,7 +31,7 @@ package_classic package_embedded: -e 's/_MINOR_VERS_/$(FB_MINOR_VERS)/g' \ -e 's/_REV_NO_/$(FB_REV_NO)/g' \ ../builds/install/arch-specific/darwin/Info.plist \ - > $(ROOT)/gen/firebird/frameworks/FirebirdCS.framework/Resources/Info.plist + > $(ROOT)/gen/$(TARGET)/frameworks/Firebird4.framework/Resources/Info.plist sed -e 's/_FB_BUILD_SUFFIX_/$(FB_VER_SUFFIX)/g' \ -e 's/_SMFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_SM)/g' \ -e 's/_MFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_M)/g' \ @@ -37,99 +39,40 @@ package_classic package_embedded: -e 's/_MINOR_VERS_/$(FB_MINOR_VERS)/g' \ -e 's/_REV_NO_/$(FB_REV_NO)/g' \ ../builds/install/arch-specific/darwin/Description.plist \ - > $(ROOT)/gen/firebird/frameworks/FirebirdCS.framework/Resources/Description.plist - - rm -fr $(ROOT)/gen/firebird/scripts - mkdir $(ROOT)/gen/firebird/scripts - cp ../builds/install/arch-specific/darwin/install-script \ - $(ROOT)/gen/firebird/scripts/postinstall - cp ../builds/install/arch-specific/darwin/preupgrade-script \ - $(ROOT)/gen/firebird/scripts/preinstall - chmod u+x $(ROOT)/gen/firebird/scripts/postinstall - chmod u+x $(ROOT)/gen/firebird/scripts/preinstall - - rm -fr $(ROOT)/gen/firebird/resources - mkdir $(ROOT)/gen/firebird/resources - cp ../builds/install/arch-specific/darwin/Welcome.txt \ - $(ROOT)/gen/firebird/resources/Welcome.txt - cp ../builds/install/arch-specific/darwin/License.txt \ - $(ROOT)/gen/firebird/resources/License.txt - cp ../builds/install/arch-specific/darwin/DistributionCS.xml \ - $(ROOT)/gen/firebird/DistributionCS.xml + > $(ROOT)/gen/$(TARGET)/frameworks/Firebird4.framework/Resources/Description.plist - rm -fr firebird/packages - mkdir firebird/packages - pkgbuild --root $(ROOT)/gen/firebird/frameworks/FirebirdCS.framework \ + rm -fr $(ROOT)/gen/$(TARGET)/scripts + mkdir $(ROOT)/gen/$(TARGET)/scripts + cp ../builds/install/arch-specific/darwin/install-script \ + $(ROOT)/gen/$(TARGET)/scripts/postinstall + cp ../builds/install/arch-specific/darwin/preupgrade-script \ + $(ROOT)/gen/$(TARGET)/scripts/preinstall + chmod u+x $(ROOT)/gen/$(TARGET)/scripts/postinstall + chmod u+x $(ROOT)/gen/$(TARGET)/scripts/preinstall + + rm -fr $(ROOT)/gen/$(TARGET)/resources + mkdir $(ROOT)/gen/$(TARGET)/resources + cp ../builds/install/arch-specific/darwin/Welcome.txt \ + $(ROOT)/gen/$(TARGET)/resources/Welcome.txt + cp ../builds/install/arch-specific/darwin/Readme.txt \ + $(ROOT)/gen/$(TARGET)/resources/Readme.txt + cp ../builds/install/arch-specific/darwin/License.txt \ + $(ROOT)/gen/$(TARGET)/resources/License.txt + cp ../builds/install/arch-specific/darwin/Distribution.xml \ + $(ROOT)/gen/$(TARGET)/Distribution.xml + + rm -fr $(TARGET)/packages + mkdir $(TARGET)/packages + pkgbuild --root $(ROOT)/gen/$(TARGET)/frameworks/Firebird4.framework \ --identifier com.firebirdsql.Firebird \ --install-location /Library/Frameworks/Firebird.framework \ - --scripts $(ROOT)/gen/firebird/scripts \ - firebird/packages/FirebirdCS.pkg + --scripts $(ROOT)/gen/$(TARGET)/scripts \ + $(TARGET)/packages/Firebird.pkg - productbuild --distribution firebird/DistributionCS.xml \ - --resources firebird/resources \ - --package-path firebird/packages \ - firebird/$(INST_NM).pkg + productbuild --distribution $(TARGET)/Distribution.xml \ + --resources $(TARGET)/resources \ + --package-path $(TARGET)/packages \ + $(TARGET)/$(INST_NM).pkg -package_super package_server: INST_NM=FirebirdSS-$(FB_MAJOR_VERS).$(FB_MINOR_VERS).$(FB_REV_NO)-$(FB_BUILD_NO)-$(FB_PLATFORM) -package_super package_server: - sed -e 's/_FB_BUILD_SUFFIX_/$(FB_VER_SUFFIX)/g' \ - -e 's/_SMFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_SM)/g' \ - -e 's/_MFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_M)/g' \ - -e 's/_MAJOR_VERS_/$(FB_MAJOR_VERS)/g' \ - -e 's/_MINOR_VERS_/$(FB_MINOR_VERS)/g' \ - -e 's/_REV_NO_/$(FB_REV_NO)/g' \ - ../builds/install/arch-specific/darwin/Info.plist \ - > $(ROOT)/gen/firebird/frameworks/FirebirdSS.framework/Resources/Info.plist - sed -e 's/_FB_BUILD_SUFFIX_/$(FB_VER_SUFFIX)/g' \ - -e 's/_SMFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_SM)/g' \ - -e 's/_MFB_BUILD_SUFFIX_/$(FB_VER_SUFFIX_M)/g' \ - -e 's/_MAJOR_VERS_/$(FB_MAJOR_VERS)/g' \ - -e 's/_MINOR_VERS_/$(FB_MINOR_VERS)/g' \ - -e 's/_REV_NO_/$(FB_REV_NO)/g' \ - ../builds/install/arch-specific/darwin/Description.plist \ - > $(ROOT)/gen/firebird/frameworks/FirebirdSS.framework/Resources/Description.plist - rm -fr $(ROOT)/gen/firebird/scripts - mkdir $(ROOT)/gen/firebird/scripts - cp ../builds/install/arch-specific/darwin/install-script \ - $(ROOT)/gen/firebird/scripts/postinstall - cp ../builds/install/arch-specific/darwin/preupgrade-script \ - $(ROOT)/gen/firebird/scripts/preinstall - chmod u+x $(ROOT)/gen/firebird/scripts/postinstall - chmod u+x $(ROOT)/gen/firebird/scripts/preinstall - - rm -fr $(ROOT)/gen/firebird/resources - mkdir $(ROOT)/gen/firebird/resources - cp ../builds/install/arch-specific/darwin/Welcome.txt \ - $(ROOT)/gen/firebird/resources/Welcome.txt - cp ../builds/install/arch-specific/darwin/License.txt \ - $(ROOT)/gen/firebird/resources/License.txt - cp ../builds/install/arch-specific/darwin/DistributionSS.xml \ - $(ROOT)/gen/firebird/DistributionSS.xml - - rm -fr firebird/packages - mkdir firebird/packages - pkgbuild --root $(ROOT)/gen/firebird/frameworks/FirebirdSS.framework \ - --identifier com.firebirdsql.Firebird \ - --install-location /Library/Frameworks/Firebird.framework \ - --scripts $(ROOT)/gen/firebird/scripts \ - firebird/packages/FirebirdSS.pkg - - productbuild --distribution firebird/DistributionSS.xml \ - --resources firebird/resources \ - --package-path firebird/packages \ - firebird/$(INST_NM).pkg - -# rm firebird/firebirdSS.pkg - -install: install_@FIREBIRD_ARCH_TYPE@ - - -install_super: - sudo installer -verbose -dumplog -pkg \ - firebird/FirebirdSS-$(FB_MAJOR_VERS).$(FB_MINOR_VERS).$(FB_REV_NO)-$(FB_BUILD_NO)-$(FB_PLATFORM).pkg -target / - -install_classic: - sudo installer -verbose -dumplog -pkg \ - firebird/FirebirdCS-$(FB_MAJOR_VERS).$(FB_MINOR_VERS).$(FB_REV_NO)-$(FB_BUILD_NO)-$(FB_PLATFORM).pkg -target / diff --git a/builds/install/arch-specific/darwin/Readme.txt b/builds/install/arch-specific/darwin/Readme.txt index f5b8b019ed..bddb22767c 100644 --- a/builds/install/arch-specific/darwin/Readme.txt +++ b/builds/install/arch-specific/darwin/Readme.txt @@ -1,14 +1,15 @@ -The Firebird install process will create a new user: firebird. This is for added security. Please don't delete this user unless you know what you are doing. The installer installs the Firebird framework in /Library/Frameworks. The default installs one super-user database user: "sysdba", password "masterkey". You should change that password using gsec according to the documentation. +The Firebird install process will create a new user: firebird. This is for added security. Please don't delete this user. The installer creates a Firebird framework in /Library/Frameworks. By default the install creates one super-user database user "SYSDBA" with a password "masterkey". You should change that password using gsec or isql according to the documentation. -All the standard command line executables are installed in /Library/Frameworks/Firebird.framework/Resources/bin. If you are interested in helping with the Firebird Project please contact us via the Firebird website at www.firebirdsql.org. +All the standard command line executables are installed in /Library/Frameworks/Firebird.framework/Resources/bin. -Please note that every MacOS X user you want to have access to your database MUST have read/write permissions on the .fdb file. +If you are interested in helping with the Firebird Project please contact us via the Firebird website at www.firebirdsql.org. -The release notes can be found in the doc directory Generic documentation for Firebird can be found on the IBPhoenix web site at www.ibphoenix.com, as well as at the Firebird website. There is also a yahoo group named "ib-support" if you have any problems with Firebird. +The release notes can be found in the doc directory. More generic documentation for Firebird can be found on www.firebirdsql.org and the IBPhoenix web site at www.ibphoenix.com. There is also a yahoo group that can be subscribed to named "ib-support" if you have any problems. Thanks to: John Bellardo (Original MacOSX port for Firebird) David Pugh (Firebird 1.5.3 Port) -Paul Beach & Alex Peshkov (Firebird 1.5.x & 2.x Ports) +Paul Beach & Alex Peshkov (Firebird 1.5.x,2.x & 3.x Ports) +Paul Beach (Firebird Installer) Daniel Puckett (Firebird 2.x Launch Daemon for MacOSX 10.5+) Craig Altenburg (Improvements to the install scripts) diff --git a/builds/install/arch-specific/darwin/Welcome.txt b/builds/install/arch-specific/darwin/Welcome.txt index f1c88fccc4..bb52a7e437 100644 --- a/builds/install/arch-specific/darwin/Welcome.txt +++ b/builds/install/arch-specific/darwin/Welcome.txt @@ -1,5 +1,5 @@ Thank you for choosing the Firebird relational database engine. -Firebird is a relational database offering many ANSI SQL-92 features that runs on Linux, Windows, and a variety of Unix platforms. Firebird offers excellent concurrency, high performance, and powerful language support for stored procedures and triggers. It has been used in production systems, under a variety of names since 1981. +Firebird is a relational database offering many ANSI SQL-2003 features that runs on Linux, Windows, MacOSX and a variety of other Unix platforms. Firebird offers excellent concurrency, high performance, and powerful language support for stored procedures and triggers. It has been used in production systems, under a variety of names since 1981. -Firebird is a commercially independent project of C and C++ programmers, technical advisors and supporters developing and enhancing a multi-platform relational database management system based on the source code released by Inprise Corp (now known as Borland Software Corp) under the InterBase Public License v.1.0 on 25 July, 2000. +Firebird is a commercially independent project of C and C++ programmers, technical advisors and supporters developing and enhancing a multi-platform relational database management system based on the source code released by Borland under the InterBase Public License on the 25th July, 2000. diff --git a/builds/install/arch-specific/darwin/changeServerMode b/builds/install/arch-specific/darwin/changeServerMode new file mode 100755 index 0000000000..321ec92d8c --- /dev/null +++ b/builds/install/arch-specific/darwin/changeServerMode @@ -0,0 +1,134 @@ +#!/bin/sh +# +# The contents of this file are subject to the Initial +# Developer's Public License Version 1.0 (the "License"); +# you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl. +# +# Software distributed under the License is distributed AS IS, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. +# See the License for the specific language governing rights +# and limitations under the License. +# +# The Original Code was created by Paul Beach +# based on the original Posix script created by Alex Peshkov +# for the Firebird Open Source RDBMS project. +# +# Copyright (c) 2017 Paul Beach +# Alex Peshkov +# and all contributors signed below. +# +# All Rights Reserved. +# Contributor(s): ______________________________________. +# + +FB_FW=/Library/Frameworks/Firebird.framework +DAEMONLOC=/Library/LaunchDaemons + +#------------------------------------------------------------------------ +# add a line in the (usually) /etc/services or /etc/inetd.conf file +# Here there are three cases, not found => add +# found & different => replace +# found & same => do nothing +# + +replaceLineInFile() { + FileName="$1" + echo $Filename + newLine="$2" + oldLine=`grep "$3" $FileName` + + if [ -z "$oldLine" ] + then + echo "$newLine" >> "$FileName" + elif [ "$oldLine" != "$newLine" ] + then + MakeTemp + grep -v "$oldLine" "$FileName" > "$TmpFile" + echo "$newLine" >> $TmpFile + cp $TmpFile $FileName + rm -f $TmpFile + echo "Updated $1" + fi +} + +MakeTemp() { + TmpFile=`mktemp -q /tmp/firebird_tmp.XXXXXX` + if [ $? -ne 0 ] + then + for n in `seq 1000` + do + TmpFile=/tmp/firebird_tmp.$n + if [ ! -e $TmpFile ] + then + touch $TmpFile + return + fi + done + fi +} + +cat <