diff --git a/Slony/build-linux-ppc64.sh b/Slony/build-linux-ppc64.sh deleted file mode 100755 index 9842c84ab..000000000 --- a/Slony/build-linux-ppc64.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_Slony_linux_ppc64() { - - # Enter the source directory and cleanup if required - cd $WD/Slony/source - - if [ -e slony.linux-ppc64 ]; - then - echo "Removing existing slony.linux-ppc64 source directory" - rm -rf slony.linux-ppc64 || _die "Couldn't remove the existing slony.linux-ppc64 source directory (source/slony.linux-ppc64)" - fi - - echo "Creating slony source directory ($WD/Slony/source/slony.linux-ppc64)" - mkdir -p slony.linux-ppc64 || _die "Couldn't create the slony.linux-ppc64 directory" - chmod ugo+w slony.linux-ppc64 || _die "Couldn't set the permissions on the source directory" - - # Grab a copy of the slony source tree - cp -R slony1-$PG_VERSION_SLONY/* slony.linux-ppc64 || _die "Failed to copy the source code (source/slony1-$PG_VERSION_SLONY)" - chmod -R ugo+w slony.linux-ppc64 || _die "Couldn't set the permissions on the source directory" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/Slony/staging/linux-ppc64 ]; - then - echo "Removing existing staging directory" - rm -rf $WD/Slony/staging/linux-ppc64 || _die "Couldn't remove the existing staging directory" - fi - - echo "Creating staging directory ($WD/Slony/staging/linux-ppc64)" - mkdir -p $WD/Slony/staging/linux-ppc64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/Slony/staging/linux-ppc64 || _die "Couldn't set the permissions on the staging directory" - - echo "Removing existing slony files from the PostgreSQL directory" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64; rm -f bin/slon bin/slonik bin/slony_logshipper lib/postgresql/slony_funcs.so" || _die "Failed to remove slony binary files" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64; rm -f share/postgresql/slony*.sql" || _die "remove slony share files" -} - - -################################################################################ -# PG Build -################################################################################ - -_build_Slony_linux_ppc64() { - - # build slony - PG_STAGING=$PG_PATH_LINUX_X64/Slony/staging/linux-ppc64 - - echo "Configuring the slony source tree" - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/Slony/source/slony.linux-ppc64/; ./configure --with-pgconfigdir=$PG_PGHOME_LINUX_X64/bin" || _die "Failed to configure slony" - - echo "Building slony" - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/Slony/source/slony.linux-ppc64; make" || _die "Failed to build slony" - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/Slony/source/slony.linux-ppc64; make install" || _die "Failed to install slony" - - echo "Changing the rpath for the slonik binaries and libraries" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64/bin; for f in slon slonik slony_logshipper ; do chrpath --replace \"\\\${ORIGIN}/../lib\" \$f; done" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64/lib/postgresql; chrpath --replace \"\\\${ORIGIN}/../lib\" slony1_funcs.so" - - cd $WD - -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_Slony_linux_ppc64() { - - cd $WD/Slony - - mkdir -p staging/linux-ppc64/installer/Slony || _die "Failed to create a directory for the install scripts" - - cp scripts/linux/createshortcuts.sh staging/linux-ppc64/installer/Slony/createshortcuts.sh || _die "Failed to copy the createshortcuts script (scripts/linux/createshortcuts.sh)" - chmod ugo+x staging/linux-ppc64/installer/Slony/createshortcuts.sh - - cp scripts/linux/check-pgversion.sh staging/linux-ppc64/installer/Slony/check-pgversion.sh || _die "Failed to copy the check-pgversion script (scripts/linux/check-pgversion.sh)" - chmod ugo+x staging/linux-ppc64/installer/Slony/check-pgversion.sh - - cp scripts/linux/removeshortcuts.sh staging/linux-ppc64/installer/Slony/removeshortcuts.sh || _die "Failed to copy the removeshortcuts script (scripts/linux/removeshortcuts.sh)" - chmod ugo+x staging/linux-ppc64/installer/Slony/removeshortcuts.sh - - cp scripts/linux/configureslony.sh staging/linux-ppc64/installer/Slony/configureslony.sh || _die "Failed to copy the configureSlony script (scripts/linux/configureslony.sh)" - chmod ugo+x staging/linux-ppc64/installer/Slony/configureslony.sh - - mkdir -p staging/linux-ppc64/scripts || _die "Failed to create a directory for the launch scripts" - cp -R scripts/linux/launchbrowser.sh staging/linux-ppc64/scripts/launchbrowser.sh || _die "Failed to copy the launch scripts (scripts/linux)" - chmod ugo+x staging/linux-ppc64/scripts/launchbrowser.sh - - cp -R scripts/linux/launchSlonyDocs.sh staging/linux-ppc64/scripts/launchSlonyDocs.sh || _die "Failed to copy the launch scripts (scripts/linux)" - chmod ugo+x staging/linux-ppc64/scripts/launchSlonyDocs.sh - - # Copy the XDG scripts - mkdir -p staging/linux-ppc64/installer/xdg || _die "Failed to create a directory for the xdg scripts" - cp -R $WD/scripts/xdg/xdg* staging/linux-ppc64/installer/xdg || _die "Failed to copy the xdg scripts (scripts/xdg/*)" - chmod ugo+x staging/linux-ppc64/installer/xdg/xdg* - - # Copy in the menu pick images and XDG items - mkdir -p staging/linux-ppc64/scripts/images || _die "Failed to create a directory for the menu pick images" - cp resources/*.png staging/linux-ppc64/scripts/images || _die "Failed to copy the menu pick images (resources/*.png)" - - # Version string, for the xdg filenames - PG_VERSION_STR=`echo $PG_MAJOR_VERSION | sed 's/\./_/g'` - SLONY_VERSION_STR=`echo $PG_VERSION_SLONY | cut -f1,2 -d "." | sed 's/\./_/g'` - - mkdir -p staging/linux-ppc64/scripts/xdg || _die "Failed to create a directory for the menu pick items" - cp resources/xdg/pg-postgresql.directory staging/linux-ppc64/scripts/xdg/pg-postgresql-$PG_VERSION_STR.directory || _die "Failed to copy a menu pick directory" - cp resources/xdg/pg-launchSlonyDocs.desktop staging/linux-ppc64/scripts/xdg/pg-launchSlonyDocs-$SLONY_VERSION_STR.desktop || _die "Failed to copy a menu pick desktop" - - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml linux-ppc || _die "Failed to build the installer" - - mv $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-linux-ppc.bin $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-linux-ppc64.bin - - cd $WD -} - diff --git a/Slony/build-linux-x64.sh b/Slony/build-linux-x64.sh deleted file mode 100755 index a6f37f9d9..000000000 --- a/Slony/build-linux-x64.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_Slony_linux_x64() { - - echo "BEGIN PREP Slony Linux-x64" - - # Enter the source directory and cleanup if required - cd $WD/Slony/source - - if [ -e slony.linux-x64 ]; - then - echo "Removing existing slony.linux-x64 source directory" - rm -rf slony.linux-x64 || _die "Couldn't remove the existing slony.linux-x64 source directory (source/slony.linux-x64)" - fi - - echo "Creating slony source directory ($WD/Slony/source/slony.linux-x64)" - mkdir -p slony.linux-x64 || _die "Couldn't create the slony.linux-x64 directory" - chmod ugo+w slony.linux-x64 || _die "Couldn't set the permissions on the source directory" - - # Grab a copy of the slony source tree - cp -R slony1-$PG_VERSION_SLONY/* slony.linux-x64 || _die "Failed to copy the source code (source/slony1-$PG_VERSION_SLONY)" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/Slony/staging/linux-x64.build ]; - then - echo "Removing existing staging directory" - rm -rf $WD/Slony/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" - fi - - echo "Creating staging directory ($WD/Slony/staging/linux-x64.build)" - mkdir -p $WD/Slony/staging/linux-x64.build || _die "Couldn't create the staging directory" - chmod ugo+w $WD/Slony/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" - - echo "Removing existing slony files from the PostgreSQL directory" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64; rm -f bin/slon bin/slonik bin/slony_logshipper lib/postgresql/slony_funcs.$PG_VERSION_SLONY.so" || _die "Failed to remove slony binary files" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64; rm -f share/postgresql/slony*.sql" || _die "remove slony share files" - - echo "END PREP Slony Linux-x64" -} - - -################################################################################ -# PG Build -################################################################################ - -_build_Slony_linux_x64() { - - echo "BEGIN BUILD Slony Linux-x64" - - # build slony - PG_STAGING=$PG_PATH_LINUX_X64/Slony/staging/linux-x64.build - - echo "Configuring the slony source tree" - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/Slony/source/slony.linux-x64/; ./configure --enable-debug --with-pgconfigdir=$PG_PGHOME_LINUX_X64/bin --with-pgport=yes LD_LIBRARY_PATH=$PG_PGHOME_LINUX_X64/lib" || _die "Failed to configure slony" - - echo "Building slony" - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/Slony/source/slony.linux-x64; LD_LIBRARY_PATH=$PG_PGHOME_LINUX_X64/lib make" || _die "Failed to build slony" - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/Slony/source/slony.linux-x64; make install" || _die "Failed to install slony" - - echo "Changing the rpath for the slonik binaries and libraries" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64/bin; for f in slon slonik slony_logshipper ; do chrpath --replace \"\\\${ORIGIN}/../lib\" \$f; done" - ssh $PG_SSH_LINUX_X64 "cd $PG_PGHOME_LINUX_X64/lib/postgresql; chrpath --replace \"\\\${ORIGIN}/../../lib\" slony1_funcs.$PG_VERSION_SLONY.so" - - cd $WD/Slony - - # Slony installs it's files into postgresql directory - # We need to copy them to staging directory - mkdir -p $WD/Slony/staging/linux-x64.build/bin - ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/bin/slon $PG_STAGING/bin" || _die "Failed to copy slon binary to staging directory" - ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/bin/slonik $PG_STAGING/bin" || _die "Failed to copy slonik binary to staging directory" - ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/bin/slony_logshipper $PG_STAGING/bin" || _die "Failed to copy slony_logshipper binary to staging directory" - chmod +rx $WD/Slony/staging/linux-x64.build/bin/* - - mkdir -p $WD/Slony/staging/linux-x64.build/lib - ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/lib/postgresql/slony1_funcs.$PG_VERSION_SLONY.so $PG_STAGING/lib" || _die "Failed to copy slony_funs.so to staging directory" - chmod +r $WD/Slony/staging/linux-x64.build/lib/* - - mkdir -p $WD/Slony/staging/linux-x64.build/Slony - ssh $PG_SSH_LINUX_X64 "cp $PG_PGHOME_LINUX_X64/share/postgresql/slony*.sql $PG_STAGING/Slony" || _die "Failed to share files to staging directory" - - # Generate debug symbols - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" - - # Remove existing symbols directory in output directory - if [ -e $WD/output/symbols/linux-x64/Slony ]; - then - echo "Removing existing $WD/output/symbols/linux-x64/Slony directory" - rm -rf $WD/output/symbols/linux-x64/Slony || _die "Couldn't remove the existing $WD/output/symbols/linux-x64/Slony directory." - fi - - # Move symbols directory in output - mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/Slony/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/Slony || _die "Failed to move $WD/Slony/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/Slony directory" - - echo "Removing last successful staging directory ($WD/Slony/staging/linux-x64)" - rm -rf $WD/Slony/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" - mkdir -p $WD/Slony/staging/linux-x64 || _die "Couldn't create the last successful staging directory" - chmod ugo+w $WD/Slony/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" - - echo "Copying the complete build to the successful staging directory" - cp -rp $WD/Slony/staging/linux-x64.build/* $WD/Slony/staging/linux-x64 || _die "Couldn't copy the existing staging directory" - echo "PG_VERSION_SLONY=$PG_VERSION_SLONY" > $WD/Slony/staging/linux-x64/versions-linux-x64.sh - echo "PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY" >> $WD/Slony/staging/linux-x64/versions-linux-x64.sh - - cd $WD - - echo "END BUILD Slony Linux-x64" - -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_Slony_linux_x64() { - - echo "BEGIN POST Slony Linux-x64" - - source $WD/Slony/staging/linux-x64/versions-linux-x64.sh - PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) - - PG_STAGING=$PG_PATH_LINUX_X64/Slony/staging/linux-x64 - - cd $WD/Slony - - mkdir -p staging/linux-x64/installer/Slony || _die "Failed to create a directory for the install scripts" - - cp scripts/linux/createshortcuts.sh staging/linux-x64/installer/Slony/createshortcuts.sh || _die "Failed to copy the createshortcuts script (scripts/linux/createshortcuts.sh)" - chmod ugo+x staging/linux-x64/installer/Slony/createshortcuts.sh - - cp scripts/linux/removeshortcuts.sh staging/linux-x64/installer/Slony/removeshortcuts.sh || _die "Failed to copy the removeshortcuts script (scripts/linux/removeshortcuts.sh)" - chmod ugo+x staging/linux-x64/installer/Slony/removeshortcuts.sh - - cp scripts/linux/configureslony.sh staging/linux-x64/installer/Slony/configureslony.sh || _die "Failed to copy the configureSlony script (scripts/linux/configureslony.sh)" - chmod ugo+x staging/linux-x64/installer/Slony/configureslony.sh - - mkdir -p staging/linux-x64/scripts || _die "Failed to create a directory for the launch scripts" - cp -R scripts/linux/launchbrowser.sh staging/linux-x64/scripts/launchbrowser.sh || _die "Failed to copy the launch scripts (scripts/linux)" - chmod ugo+x staging/linux-x64/scripts/launchbrowser.sh - - cp -R scripts/linux/launchSlonyDocs.sh staging/linux-x64/scripts/launchSlonyDocs.sh || _die "Failed to copy the launch scripts (scripts/linux)" - chmod ugo+x staging/linux-x64/scripts/launchSlonyDocs.sh - - # Copy the XDG scripts - mkdir -p staging/linux-x64/installer/xdg || _die "Failed to create a directory for the xdg scripts" - cp -R $WD/scripts/xdg/xdg* staging/linux-x64/installer/xdg || _die "Failed to copy the xdg scripts (scripts/xdg/*)" - chmod ugo+x staging/linux-x64/installer/xdg/xdg* - - # Copy in the menu pick images and XDG items - mkdir -p staging/linux-x64/scripts/images || _die "Failed to create a directory for the menu pick images" - cp resources/*.png staging/linux-x64/scripts/images || _die "Failed to copy the menu pick images (resources/*.png)" - - # Version string, for the xdg filenames - PG_VERSION_STR=`echo $PG_MAJOR_VERSION | sed 's/\./_/g'` - SLONY_VERSION_STR=`echo $PG_VERSION_SLONY | cut -f1,2 -d "." | sed 's/\./_/g'` - - mkdir -p staging/linux-x64/scripts/xdg || _die "Failed to create a directory for the menu pick items" - cp resources/xdg/pg-postgresql.directory staging/linux-x64/scripts/xdg/pg-postgresql-$PG_VERSION_STR.directory || _die "Failed to copy a menu pick directory" - cp resources/xdg/pg-launchSlonyDocs.desktop staging/linux-x64/scripts/xdg/pg-launchSlonyDocs-$SLONY_VERSION_STR.desktop || _die "Failed to copy a menu pick desktop" - - # Set permissions to all files and folders in staging - _set_permissions linux-x64 - - ssh $PG_SSH_LINUX_X64 "chmod 755 $PG_STAGING/Slony/slony*.sql" || _die "Failed to set the permissions for sql files" - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_SLONY -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-linux-x64.run $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}linux-x64.run - - cd $WD - - echo "END POST Slony Linux-x64" -} - diff --git a/Slony/build-linux.sh b/Slony/build-linux.sh deleted file mode 100755 index c33b72ee8..000000000 --- a/Slony/build-linux.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_Slony_linux() { - - echo "BEGIN PREP Slony Linux" - - # Enter the source directory and cleanup if required - cd $WD/Slony/source - - if [ -e slony.linux ]; - then - echo "Removing existing slony.linux source directory" - rm -rf slony.linux || _die "Couldn't remove the existing slony.linux source directory (source/slony.linux)" - fi - - echo "Creating slony source directory ($WD/Slony/source/slony.linux)" - mkdir -p slony.linux || _die "Couldn't create the slony.linux directory" - chmod ugo+w slony.linux || _die "Couldn't set the permissions on the source directory" - - # Grab a copy of the slony source tree - cp -R slony1-$PG_VERSION_SLONY/* slony.linux || _die "Failed to copy the source code (source/slony1-$PG_VERSION_SLONY)" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/Slony/staging/linux.build ]; - then - echo "Removing existing staging directory" - rm -rf $WD/Slony/staging/linux.build || _die "Couldn't remove the existing staging directory" - fi - - echo "Creating staging directory ($WD/Slony/staging/linux.build)" - mkdir -p $WD/Slony/staging/linux.build || _die "Couldn't create the staging directory" - chmod ugo+w $WD/Slony/staging/linux.build || _die "Couldn't set the permissions on the staging directory" - - echo "Removing existing slony files from the PostgreSQL directory" - ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX; rm -f bin/slon bin/slonik bin/slony_logshipper lib/postgresql/slony_funcs.$PG_VERSION_SLONY.so" || _die "Failed to remove slony binary files" - ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX; rm -f share/postgresql/slony*.sql" || _die "remove slony share files" - - echo "END PREP Slony Linux" - -} - - -################################################################################ -# PG Build -################################################################################ - -_build_Slony_linux() { - - echo "BEGIN BUILD Slony Linux" - - # build slony - PG_STAGING=$PG_PATH_LINUX/Slony/staging/linux.build - - echo "Configuring the slony source tree" - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/Slony/source/slony.linux/; LD_LIBRARY_PATH=$PG_PGHOME_LINUX/lib ./configure --enable-debug --with-pgconfigdir=$PG_PGHOME_LINUX/bin --with-pgport=yes" || _die "Failed to configure slony" - - echo "Building slony" - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/Slony/source/slony.linux; LD_LIBRARY_PATH=$PG_PGHOME_LINUX/lib make" || _die "Failed to build slony" - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/Slony/source/slony.linux; make install" || _die "Failed to install slony" - - echo "Changing the rpath for the slonik binaries and libraries" - ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX/bin; for f in slon slonik slony_logshipper ; do chrpath --replace \"\\\${ORIGIN}/../lib\" \$f; done" - ssh $PG_SSH_LINUX "cd $PG_PGHOME_LINUX/lib/postgresql; chrpath --replace \"\\\${ORIGIN}/../../lib\" slony1_funcs.$PG_VERSION_SLONY.so" - - cd $WD/Slony - - # Slony installs it's files into postgresql directory - # We need to copy them to staging directory - mkdir -p $WD/Slony/staging/linux.build/bin - ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/bin/slon $PG_STAGING/bin" || _die "Failed to copy slon binary to staging directory" - ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/bin/slonik $PG_STAGING/bin" || _die "Failed to copy slonik binary to staging directory" - ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/bin/slony_logshipper $PG_STAGING/bin" || _die "Failed to copy slony_logshipper binary to staging directory" - chmod +rx $WD/Slony/staging/linux.build/bin/* - - mkdir -p $WD/Slony/staging/linux.build/lib - ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/lib/postgresql/slony1_funcs.$PG_VERSION_SLONY.so $PG_STAGING/lib" || _die "Failed to copy slony_funs.so to staging directory" - chmod +r $WD/Slony/staging/linux.build/lib/* - - mkdir -p $WD/Slony/staging/linux.build/Slony - ssh $PG_SSH_LINUX "cp $PG_PGHOME_LINUX/share/postgresql/slony*.sql $PG_STAGING/Slony" || _die "Failed to share files to staging directory" - - # Generate debug symbols - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" - - # Remove existing symbols directory in output directory - if [ -e $WD/output/symbols/linux/Slony ]; - then - echo "Removing existing $WD/output/symbols/linux/Slony directory" - rm -rf $WD/output/symbols/linux/Slony || _die "Couldn't remove the existing $WD/output/symbols/linux/Slony directory." - fi - - # Move symbols directory in output - mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/Slony/staging/linux.build/symbols $WD/output/symbols/linux/Slony || _die "Failed to move $WD/Slony/staging/linux.build/symbols to $WD/output/symbols/linux/Slony directory" - - echo "Removing last successful staging directory ($WD/Slony/staging/linux)" - rm -rf $WD/Slony/staging/linux || _die "Couldn't remove the last successful staging directory" - mkdir -p $WD/Slony/staging/linux || _die "Couldn't create the last successful staging directory" - chmod ugo+w $WD/Slony/staging/linux || _die "Couldn't set the permissions on the successful staging directory" - - echo "Copying the complete build to the successful staging directory" - cp -rp $WD/Slony/staging/linux.build/* $WD/Slony/staging/linux || _die "Couldn't copy the existing staging directory" - echo "PG_VERSION_SLONY=$PG_VERSION_SLONY" > $WD/Slony/staging/linux/versions-linux.sh - echo "PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY" >> $WD/Slony/staging/linux/versions-linux.sh - - cd $WD - - echo "END BUILD Slony Linux" - -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_Slony_linux() { - - echo "BEGIN POST Slony Linux" - - source $WD/Slony/staging/linux/versions-linux.sh - PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) - - PG_STAGING=$PG_PATH_LINUX/Slony/staging/linux - - cd $WD/Slony - - mkdir -p staging/linux/installer/Slony || _die "Failed to create a directory for the install scripts" - - cp scripts/linux/createshortcuts.sh staging/linux/installer/Slony/createshortcuts.sh || _die "Failed to copy the createshortcuts script (scripts/linux/createshortcuts.sh)" - chmod ugo+x staging/linux/installer/Slony/createshortcuts.sh - - cp scripts/linux/removeshortcuts.sh staging/linux/installer/Slony/removeshortcuts.sh || _die "Failed to copy the removeshortcuts script (scripts/linux/removeshortcuts.sh)" - chmod ugo+x staging/linux/installer/Slony/removeshortcuts.sh - - cp scripts/linux/configureslony.sh staging/linux/installer/Slony/configureslony.sh || _die "Failed to copy the configureSlony script (scripts/linux/configureslony.sh)" - chmod ugo+x staging/linux/installer/Slony/configureslony.sh - - mkdir -p staging/linux/scripts || _die "Failed to create a directory for the launch scripts" - cp -R scripts/linux/launchbrowser.sh staging/linux/scripts/launchbrowser.sh || _die "Failed to copy the launch scripts (scripts/linux)" - chmod ugo+x staging/linux/scripts/launchbrowser.sh - cp -R scripts/linux/launchSlonyDocs.sh staging/linux/scripts/launchSlonyDocs.sh || _die "Failed to copy the launch scripts (scripts/linux)" - chmod ugo+x staging/linux/scripts/launchSlonyDocs.sh - - # Copy the XDG scripts - mkdir -p staging/linux/installer/xdg || _die "Failed to create a directory for the xdg scripts" - cp -R $WD/scripts/xdg/xdg* staging/linux/installer/xdg || _die "Failed to copy the xdg scripts (scripts/xdg/*)" - chmod ugo+x staging/linux/installer/xdg/xdg* - - # Copy in the menu pick images and XDG items - mkdir -p staging/linux/scripts/images || _die "Failed to create a directory for the menu pick images" - cp resources/*.png staging/linux/scripts/images || _die "Failed to copy the menu pick images (resources/*.png)" - - # Version string, for the xdg filenames - PG_VERSION_STR=`echo $PG_MAJOR_VERSION | sed 's/\./_/g'` - SLONY_VERSION_STR=`echo $PG_VERSION_SLONY | cut -f1,2 -d "." | sed 's/\./_/g'` - - mkdir -p staging/linux/scripts/xdg || _die "Failed to create a directory for the menu pick items" - cp resources/xdg/pg-postgresql.directory staging/linux/scripts/xdg/pg-postgresql-$PG_VERSION_STR.directory || _die "Failed to copy a menu pick directory" - cp resources/xdg/pg-launchSlonyDocs.desktop staging/linux/scripts/xdg/pg-launchSlonyDocs-$SLONY_VERSION_STR.desktop || _die "Failed to copy a menu pick desktop" - - # Set permissions to all files and folders in staging - _set_permissions linux - - ssh $PG_SSH_LINUX "chmod 755 $PG_STAGING/Slony/slony*.sql" || _die "Failed to set the permissions for sql files" - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_SLONY -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-linux.run $WD/output/slony-pg96-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}linux.run - - cd $WD - - echo "END POST Slony Linux" -} - diff --git a/Slony/build-windows.sh b/Slony/build-windows.sh deleted file mode 100755 index 3d2dadb50..000000000 --- a/Slony/build-windows.sh +++ /dev/null @@ -1,210 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_Slony_windows() { - - echo "BEGIN PREP Slony Windows" - - # Enter the source directory and cleanup if required - cd $WD/Slony/source - - if [ -e Slony.windows ]; - then - echo "Removing existing Slony.windows source directory" - rm -rf Slony.windows || _die "Couldn't remove the existing Slony.windows source directory (source/Slony.windows)" - fi - - if [ -e Slony.zip ]; - then - echo "Removing existing Slony.zip file" - rm -rf Slony.zip || _die "Couldn't remove the existing Slony.windows source directory (source/Slony.zip)" - fi - - echo "Creating Slony source directory ($WD/Slony/source/Slony.windows)" - mkdir -p Slony.windows || _die "Couldn't create the Slony.windows directory" - chmod ugo+w Slony.windows || _die "Couldn't set the permissions on the source directory" - # Grab a copy of the Slony source tree - cp -R slony1-$PG_VERSION_SLONY/* Slony.windows || _die "Failed to copy the source code (source/Slony-$PG_VERSION_Slony)" - - cd Slony.windows - patch -p1 <$WD/tarballs/slony_for_VS12.patch || _die "Failed to apply patch." - #patch -p0 <$WD/tarballs/slony_pg95.patch || _die "Failed to apply patch for pg95." - cd $WD/Slony/source - - echo "Archieving Slony sources" - zip -r Slony.zip Slony.windows/ || _die "Couldn't create archieve of the Slony sources (Slony.zip)" - chmod -R ugo+w Slony.windows || _die "Couldn't set the permissions on the source directory" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/Slony/staging/windows ]; - then - echo "Removing existing staging directory" - rm -rf $WD/Slony/staging/windows || _die "Couldn't remove the existing staging directory" - fi - - echo "Creating staging directory ($WD/Slony/staging/windows)" - mkdir -p $WD/Slony/staging/windows || _die "Couldn't create the staging directory" - chmod ugo+w $WD/Slony/staging/windows || _die "Couldn't set the permissions on the staging directory" - - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.zip del /S /Q Slony.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Slony.zip on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.windows rd /S /Q Slony.windows" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Slony.windows directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.staging.build rd /S /Q Slony.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\Slony.staging.build directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST slony-staging.zip del /S /Q slony-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\slony-staging.zip on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST build-Slony.bat del /S /Q build-Slony.bat" || _die "Couldn't remove the $PG_PATH_WINDOWS\\build-Slony.bat on Windows VM" - - echo "Copying Slony sources to Windows VM" - scp Slony.zip $PG_SSH_WINDOWS:$PG_PATH_WINDOWS || _die "Couldn't copy the Slony archieve to windows VM (Slony.zip)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c unzip Slony.zip" || _die "Couldn't extract Slony archieve on windows VM (Slony.zip)" - - echo "END PREP Slony Windows" -} - - -################################################################################ -# PG Build -################################################################################ - -_build_Slony_windows() { - - echo "BEGIN BUILD Slony Windows" - - # build Slony - PG_STAGING=`echo $PG_PATH_WINDOWS | sed -e 's/://g' | sed -e 's:\\\\:/:g' | sed -e 's:^:/:g'` - PG_PGHOME_WINDOWS=$PG_PATH_WINDOWS/pgsql-$PG_MAJOR_VERSION.$PG_MINOR_VERSION - - cat < "build-Slony.bat" -REM Setting Visual Studio Environment -CALL "$PG_VSINSTALLDIR_WINDOWS\Common7\Tools\vsvars32.bat" - -@SET PG_INC=$PG_PATH_WINDOWS\output\include -@SET PG_LIB=$PG_PATH_WINDOWS\output\lib -@SET GETTEXT_LIB=$PG_PGBUILD_WINDOWS\lib -@SET GETTEXT_INC=$PG_PGBUILD_WINDOWS\include -@SET PTHREADS_INC=$PG_PGBUILD_WINDOWS\include -@SET PTHREADS_LIB=$PG_PGBUILD_WINDOWS\lib -@SET PGVER=$PG_MAJOR_VERSION -@SET SLONY_VERSION=$PG_VERSION_SLONY -@SET PGSHARE=\"\" - -cd Slony.windows\src\slonik -nmake /E /F win32.mak slonik.exe -cd ..\backend -nmake /E /F win32.mak slony1_funcs.%SLONY_VERSION%.dll -cd ..\slon -nmake /E /F win32.mak slon.exe - -EOT - - scp build-Slony.bat $PG_SSH_WINDOWS:$PG_PATH_WINDOWS - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c build-Slony.bat" - - # Slony installs it's files into postgresql directory - # We need to copy them to staging directory - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/slon/slon.exe $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to copy slon binary to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/slonik/slonik.exe $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to copy slonik binary to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PGBUILD_WINDOWS/bin/pthreadVC2.dll $PG_PATH_WINDOWS/Slony.staging.build/bin" || _die "Failed to copy slonik binary to staging directory" - - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging.build/lib" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.$PG_VERSION_SLONY.dll $PG_PATH_WINDOWS/Slony.staging.build/lib" || _die "Failed to copy slony_funcs.dll to staging directory" - - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/Slony.staging.build/Slony" || _die "Failed to create the bin directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_base.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.v83.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_base.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_base.v84.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_base.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_funcs.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.v83.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_funcs.v83.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/Slony.windows/src/backend/slony1_funcs.v84.sql $PG_PATH_WINDOWS/Slony.staging.build/Slony/slony1_funcs.v84.$PG_VERSION_SLONY.sql" || _die "Failed to share files to staging directory" - - echo "Removing last successful staging directory ($PG_PATH_WINDOWS/Slony.staging)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST Slony.staging rd /S /Q Slony.staging" || _die "Couldn't remove the last successful staging directory directory" - ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\Slony.staging" || _die "Couldn't create the last successful staging directory" - - echo "Copying the complete build to the successful staging directory" -ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y Slony.staging.build\\\\* Slony.staging\\\\" || _die "Couldn't copy the existing staging directory" - - ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_SLONY=$PG_VERSION_SLONY > $PG_PATH_WINDOWS\\\\Slony.staging/versions-windows.sh" || _die "Failed to write replication version number into versions-windows.sh" - ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_SLONY=$PG_BUILDNUM_SLONY >> $PG_PATH_WINDOWS\\\\Slony.staging/versions-windows.sh" || _die "Failed to write replication build number into versions-windows.sh" - - echo "END BUILD Slony Windows" -} - - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_Slony_windows() { - - echo "BEGIN POST Slony Windows" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/Slony/staging/windows ]; - then - echo "Removing existing staging directory" - rm -rf $WD/Slony/staging/windows || _die "Couldn't remove the existing staging directory" - fi - echo "Creating staging directory ($WD/Slony/staging/windows)" - mkdir -p $WD/Slony/staging/windows || _die "Couldn't create the staging directory" - chmod ugo+w $WD/Slony/staging/windows || _die "Couldn't set the permissions on the staging directory" - - # Zip up the installed code, copy it back here, and unpack. - echo "Copying slony built tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST slony-staging.zip del /S /Q slony-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\slony-staging.zip on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\Slony.staging; cmd /c zip -r ..\\\\slony-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/Slony.staging)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/slony-staging.zip $WD/Slony/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/slony-staging.zip)" - unzip $WD/Slony/staging/windows/slony-staging.zip -d $WD/Slony/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/slony-staging.zip)" - rm $WD/Slony/staging/windows/slony-staging.zip - - dos2unix $WD/Slony/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" - source $WD/Slony/staging/windows/versions-windows.sh - PG_BUILD_SLONY=$(expr $PG_BUILD_SLONY + $SKIPBUILD) - - cd $WD/Slony - - mkdir -p staging/windows/installer/Slony || _die "Failed to create a directory for the install scripts" - - cp scripts/windows/configureslony.bat staging/windows/installer/Slony/configureslony.bat || _die "Failed to copy the configureSlony script (scripts/windows/configureslony.bat)" - - # Copy in the menu pick images - mkdir -p staging/windows/scripts/images || _die "Failed to create a directory for the menu pick images" - cp resources/*.ico staging/windows/scripts/images || _die "Failed to copy the menu pick images (resources/*.png)" - - pushd staging/windows - generate_3rd_party_license "slony" - popd - - if [ -f installer-win.xml ]; then - rm -f installer-win.xml - fi - cp installer.xml installer-win.xml - - _replace @@WIN64MODE@@ "0" installer-win.xml || _die "Failed to replace the WIN64MODE setting in the installer.xml" - _replace @@WINDIR@@ windows installer-win.xml || _die "Failed to replace the WINDIR setting in the installer.xml" - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer-win.xml windows || _die "Failed to build the installer" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_SLONY -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-windows.exe $WD/output/slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}windows.exe - - # Sign the installer - win32_sign "slony-pg$PG_CURRENT_VERSION-$PG_VERSION_SLONY-$PG_BUILDNUM_SLONY-${BUILD_FAILED}windows.exe" - - cd $WD - - echo "END POST Slony Windows" -} - - diff --git a/Slony/scripts/linux/configureslony.sh b/Slony/scripts/linux/configureslony.sh deleted file mode 100755 index 1f130350d..000000000 --- a/Slony/scripts/linux/configureslony.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Copyright (c) 2012-2022, EnterpriseDB Corporation. All rights reserved - -PGHOME=$1 - -#Copying the lib files to pkglibdir -libdir=`$PGHOME/bin/pg_config --pkglibdir` -mv -f $PGHOME/lib/slony1_funcs*.so $libdir/ - -#Copying the share files to sharedir -sharedir=`$PGHOME/bin/pg_config --sharedir` - -#Creating file removal scripts to run at the time of uninstallation -filelist=`ls $PGHOME/share/Slony/` -echo "#!/bin/bash" > $PGHOME/Slony/installer/Slony/removeFiles.sh -echo "#Remove these files installed in the lib directory" >> $PGHOME/Slony/installer/Slony/removeFiles.sh -echo "rm -rf $libdir/slony1_funcs*.so" >> $PGHOME/Slony/installer/Slony/removeFiles.sh -echo "#Remove these files installed in the share directory" >> $PGHOME/Slony/installer/Slony/removeFiles.sh -for f in $filelist -do - echo "rm -rf $sharedir/$f" >> $PGHOME/Slony/installer/Slony/removeFiles.sh -done -chmod ugo+x $PGHOME/Slony/installer/Slony/removeFiles.sh - -mv -f $PGHOME/share/Slony/* $sharedir/ -rm -rf $PGHOME/share/Slony - - diff --git a/Slony/scripts/linux/createshortcuts.sh b/Slony/scripts/linux/createshortcuts.sh deleted file mode 100755 index b9408b98a..000000000 --- a/Slony/scripts/linux/createshortcuts.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012-2022, EnterpriseDB Corporation. All rights reserved - -# Check the command line -if [ $# -ne 5 ]; -then - echo "Usage: $0 " - exit 127 -fi - -INSTALLDIR="$1" -PG_VERSION=$2 -SLONY_VERSION=$3 -BRANDING=$4 -TEMPDIR=$5 - -# Version string, for the xdg filenames -PG_VERSION_STR=`echo $PG_VERSION | sed 's/\./_/g'` -SLONY_VERSION_STR=`echo $SLONY_VERSION | cut -f1,2 -d "." | sed 's/\./_/g'` - -# Branding string, for the xdg filenames. If the branding is 'PostgreSQL X.Y', -# Don't do anything to ensure we remain backwards compatible. -if [ "x$BRANDING" = "xPostgreSQL $PG_VERSION" ]; -then - BRANDING_STR="postgresql-$PG_VERSION_STR" - BRANDED=0 -else - BRANDING_STR=`echo $BRANDING | sed 's/\./_/g' | sed 's/ /_/g'` - BRANDED=1 -fi - - -# Exit code -WARN=0 - -# Working directory -WD=`pwd` - -# Error handlers -_die() { - echo $1 - exit 1 -} - -_warn() { - echo $1 - WARN=2 -} - -# Search & replace in a file - _replace($find, $replace, $file) -_replace() { - sed -e "s^$1^$2^g" "$3" > "$TEMPDIR/$$.tmp" || _die "Failed for search and replace '$1' with '$2' in $3" - mv $TEMPDIR/$$.tmp "$3" || _die "Failed to move $TEMPDIR/$$.tmp to $3" -} - -# Substitute values into a file ($in) -_fixup_file() { - _replace INSTALL_DIR "$INSTALLDIR" "$1" - _replace PG_MAJOR_VERSION "$PG_VERSION" "$1" - _replace PG_BRANDING "$BRANDING" "$1" -} - -# Create the icon resources -"$INSTALLDIR/Slony/installer/xdg/xdg-icon-resource" install --size 32 "$INSTALLDIR/Slony/scripts/images/pg-postgresql.png" -"$INSTALLDIR/Slony/installer/xdg/xdg-icon-resource" install --size 32 "$INSTALLDIR/Slony/scripts/images/pg-launchSlonyDocs.png" - -# Fixup the scripts -chmod ugo+x "$INSTALLDIR/Slony/installer/Slony/"*.sh -_fixup_file "$INSTALLDIR/Slony/scripts/launchSlonyDocs.sh" - -chmod ugo+x "$INSTALLDIR/Slony/scripts/launchSlonyDocs.sh" - -# Fixup the XDG files (don't just loop in case we have old entries we no longer want) -_fixup_file "$INSTALLDIR/Slony/scripts/xdg/pg-launchSlonyDocs-$SLONY_VERSION_STR.desktop" -_fixup_file "$INSTALLDIR/Slony/scripts/xdg/pg-postgresql-$PG_VERSION_STR.directory" - -# Copy the primary desktop file to the branded version. We don't do this if -# the installation is not branded, to retain backwards compatibility. -if [ $BRANDED -ne 0 ]; -then - cp "$INSTALLDIR/Slony/scripts/xdg/pg-postgresql-$PG_VERSION_STR.directory" "$INSTALLDIR/Slony/scripts/xdg/pg-$BRANDING_STR.directory" -fi - -# Create the menu shortcuts - first the top level, then the documentation menu. -"$INSTALLDIR/Slony/installer/xdg/xdg-desktop-menu" install --mode system \ - "$INSTALLDIR/Slony/scripts/xdg/pg-$BRANDING_STR.directory" \ - "$INSTALLDIR/Slony/scripts/xdg/pg-launchSlonyDocs-$SLONY_VERSION_STR.desktop" || _warn "Failed to create the Slony menu" - -#Ubuntu 10.04 and greater require menu cache update - -if [ -f /usr/share/gnome-menus/update-gnome-menus-cache ]; -then - echo "Rebuilding /usr/share/applications/desktop.${LANG}.cache" - /usr/share/gnome-menus/update-gnome-menus-cache /usr/share/applications/ > /usr/share/applications/desktop.${LANG}.cache -fi -echo "$0 ran to completion" -exit 0 diff --git a/Slony/scripts/linux/getMajorVersion.sh b/Slony/scripts/linux/getMajorVersion.sh deleted file mode 100755 index 7d051eec2..000000000 --- a/Slony/scripts/linux/getMajorVersion.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# Copyright (c) 2012-2022, EnterpriseDB Corporation. All rights reserved - -echo $1 | cut -f1 -d "." diff --git a/Slony/scripts/linux/launchSlonyDocs.sh b/Slony/scripts/linux/launchSlonyDocs.sh deleted file mode 100755 index a35029214..000000000 --- a/Slony/scripts/linux/launchSlonyDocs.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Copyright (c) 2012-2022, EnterpriseDB Corporation. All rights reserved - -INSTALLDIR="INSTALL_DIR" -URL="http://www.slony.info/documentation/" - -"$INSTALLDIR/Slony/scripts/launchbrowser.sh" $URL - diff --git a/Slony/scripts/linux/launchbrowser.sh b/Slony/scripts/linux/launchbrowser.sh deleted file mode 100755 index 604ca7718..000000000 --- a/Slony/scripts/linux/launchbrowser.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012-2022, EnterpriseDB Corporation. All rights reserved -################################################################################## -# launchbrowser.sh -# -# -# Launch a url (supplied as parameter) in a web browser in a platform -# independent manner. Since as till now(07-30-07) there are no standards -# defined to launch a web browser in a platform independent manner, -# therefore we implement this, more or less on the basis of guess work. -# First we check if the $BROWSER environment variable is defined or not. If -# its defined then we simply open the browser pointed by it, otherwise we -# search for a list of popular browsers and invoke it as soon as we find -# any. -########################################################################### - -########################################################################### -# Global functions -########################################################################### - -# usage() -# print usage -# -usage() -{ - printf "usage:\n" - printf "$0 \n" -} - -########################################################################### -# Main program -########################################################################### - -if [ $# -ne 1 ] -then - usage - exit 1 -fi - -URL="$1" -if [ -n "$BROWSER" ] -then - # the browser environment variable is defined, now check if it contains - # path to a valid web browser - BPATH=`which $BROWSER` - if [ $? -eq 0 ] # the browser is valid, so invoke the command - then - $BPATH "$URL" - exit 0 - fi -fi - -# The $BROWSER environment variable is either not defined or does not point to a valid -# Browser. So now we have to look it up ourselves. - -BRW_FOUND=0 -# list of popular browsers which we are going to search -BRW_LIST="firefox mozilla opera konqueror netscape epiphany safari" - -for i in $BRW_LIST -do - BPATH=`which $i` - if [ $? -eq 0 ] - then - $BPATH "$URL" - BRW_FOUND=1 - break - fi -done - -# exit with no success exit code (i.e 1) if browser was not found -if [ $BRW_FOUND -eq 0 ] -then - exit 1 -else - exit 0 -fi - diff --git a/Slony/scripts/linux/removeshortcuts.sh b/Slony/scripts/linux/removeshortcuts.sh deleted file mode 100755 index d04f5acc5..000000000 --- a/Slony/scripts/linux/removeshortcuts.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012-2022, EnterpriseDB Corporation. All rights reserved - -# Check the command line -if [ $# -ne 4 ]; -then - echo "Usage: $0 " - exit 127 -fi - -INSTALLDIR="$1" -SLONY_VERSION=$2 -PG_VERSION=$3 -BRANDING=$4 -TEMPFILE=`mktemp -q /tmp/$$.tmp-XXXXXXXXXX` - -# Version string, for the xdg filenames -SLONY_VERSION_STR=`echo $SLONY_VERSION | cut -f1,2 -d "." | sed 's/\./_/g'` -PG_VERSION_STR=`echo $PG_VERSION | sed 's/\./_/g'` - -# Branding string, for the xdg filenames. If the branding is 'PostgreSQL X.Y', -# Don't do anything to ensure we remain backwards compatible. -if [ "x$BRANDING" = "xPostgreSQL $PG_VERSION" ]; -then - BRANDING_STR="postgresql-$PG_VERSION_STR" - BRANDED=0 -else - BRANDING_STR=`echo $BRANDING | sed 's/\./_/g' | sed 's/ /_/g'` - BRANDED=1 -fi - -# Exit code -WARN=0 - -# Working directory -WD=`pwd` - -# Error handlers -_die() { - echo $1 - exit 1 -} - -_warn() { - echo $1 - WARN=2 -} - -# Search & replace in a file - _replace($find, $replace, $file) -_replace() { - sed -e "s^$1^$2^g" $3 > "$TEMPFILE" || _die "Failed for search and replace '$1' with '$2' in $3" - mv $TEMPFILE $3 || _die "Failed to move $TEMPFILE to $3" - chmod 644 $3 -} - -# Remove the menu shortcuts -"$INSTALLDIR/Slony/installer/xdg/xdg-desktop-menu" uninstall --mode system \ - "$INSTALLDIR/Slony/scripts/xdg/pg-launchSlonyDocs-$SLONY_VERSION_STR.desktop" || _warn "Failed to remove the Slony docs menu item" - -# Remove the icon resources -"$INSTALLDIR/Slony/installer/xdg/xdg-icon-resource" uninstall --mode system --size 32 "$INSTALLDIR/Slony/scripts/images/launch-SlonyDocs.png" - -# Only remove the directory file if it's branded -if [ $BRANDED -ne 0 ]; -then - rm "$INSTALLDIR/Slony/scripts/xdg/pg-$BRANDING_STR.directory" -fi -xdg_dir_name=menus - -xdg_system_dirs="$XDG_CONFIG_DIRS" -[ -n "$xdg_system_dirs" ] || xdg_system_dirs=/etc/xdg -xdg_global_dir= -for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do - if [ -w $x/$xdg_dir_name ] ; then - xdg_global_dir="$x/$xdg_dir_name" - break - fi -done -xdg_global_dir="$xdg_global_dir/applications-merged" - -# Hack up the XDG menu files to make sure everything really does go. -_replace "pg-launchSlonyDocs-$SLONY_VERSION_STR.desktop" "" "$xdg_global_dir/pg-$BRANDING_STR.menu" - -#Ubuntu 10.04 and greater require menu cache update - -if [ -f /usr/share/gnome-menus/update-gnome-menus-cache ]; -then - echo "Rebuilding /usr/share/applications/desktop.${LANG}.cache" - /usr/share/gnome-menus/update-gnome-menus-cache /usr/share/applications/ > /usr/share/applications/desktop.${LANG}.cache -fi -echo "$0 ran to completion" -exit 0 - diff --git a/pgmemcache/build-linux-ppc64.sh b/pgmemcache/build-linux-ppc64.sh deleted file mode 100644 index 166e7ce4e..000000000 --- a/pgmemcache/build-linux-ppc64.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_pgmemcache_linux_ppc64() { - - # Enter the source directory and cleanup if required - cd $WD/pgmemcache/source - - if [ -e pgmemcache.linux-ppc64 ]; - then - echo "Removing existing pgmemcache.linux-ppc64 source directory" - rm -rf pgmemcache.linux-ppc64 || _die "Couldn't remove the existing pgmemcache.linux-ppc64 source directory (source/pgmemcache.linux-ppc64)" - fi - if [ -e libmemcached.linux-ppc64 ]; - then - echo "Removing existing libmemcached.linux-ppc64 source directory" - rm -rf libmemcached.linux-ppc64 || _die "Couldn't remove the existing libmemcached.linux-ppc64 source directory (source/libmemcached.linux-ppc64)" - fi - - echo "Creating source directory ($WD/pgmemcache/source/pgmemcache.linux-ppc64)" - mkdir -p $WD/pgmemcache/source/pgmemcache.linux-ppc64 || _die "Couldn't create the pgmemcache.linux-ppc64 directory" - echo "Creating source directory ($WD/pgmemcache/source/libmemcached.linux-ppc64)" - mkdir -p $WD/pgmemcache/source/libmemcached.linux-ppc64 || _die "Couldn't create the libmemcached.linux-ppc64 directory" - - # Grab a copy of the source tree - cp -R pgmemcache/* pgmemcache.linux-ppc64 || _die "Failed to copy the source code (source/pgmemcache_$PG_VERSION_PGMEMCACHE)" - chmod -R ugo+w pgmemcache.linux-ppc64 || _die "Couldn't set the permissions on the source directory" - - cp -R libmemcached-$PG_TARBALL_LIBMEMCACHED/* libmemcached.linux-ppc64 || _die "Failed to copy the source code (source/libmemcached-$PG_VERSION_LIBMEMCACHED)" - chmod -R ugo+w libmemcached.linux-ppc64 || _die "Couldn't set the permissions on the source directory" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/pgmemcache/staging/linux-ppc64 ]; - then - echo "Removing existing staging directory" - rm -rf $WD/pgmemcache/staging/linux-ppc64 || _die "Couldn't remove the existing staging directory" - fi - - ssh $PG_SSH_LINUX_PPC64 "rm -rf $PG_PGHOME_LINUX_PPC64/include/libmemcached $PG_PGHOME_LINUX_PPC64/include/postgresql/server/libmemcached" || _die "Failed to remove libmemcached from server staging directory" - - echo "Creating staging directory ($WD/pgmemcache/staging/linux-ppc64)" - mkdir -p $WD/pgmemcache/staging/linux-ppc64 || _die "Couldn't create the staging directory" - chmod ugo+w $WD/pgmemcache/staging/linux-ppc64 || _die "Couldn't set the permissions on the staging directory" - - -} - -################################################################################ -# PG Build -################################################################################ - -_build_pgmemcache_linux_ppc64() { - - # Note: Make sure the linux-ppc64 VM contain memcached binary in the PATH. - - ssh $PG_SSH_LINUX_PPC64 "cd $PG_PATH_LINUX_PPC64/pgmemcache/source/libmemcached.linux-ppc64; ./configure prefix=$PG_PGHOME_LINUX_PPC64 " || _die "Failed to configure libmemcache" - ssh $PG_SSH_LINUX_PPC64 "cd $PG_PATH_LINUX_PPC64/pgmemcache/source/libmemcached.linux-ppc64; make " || _die "Failed to build libmemcached" - ssh $PG_SSH_LINUX_PPC64 "cd $PG_PATH_LINUX_PPC64/pgmemcache/source/libmemcached.linux-ppc64; make install " || _die "Failed to install libmemcached" - - ssh $PG_SSH_LINUX_PPC64 "mv $PG_PGHOME_LINUX_PPC64/include/libmemcached $PG_PGHOME_LINUX_PPC64/include/postgresql/server/" || _die "Failed to copy libmemcached to staging directory" - ssh $PG_SSH_LINUX_PPC64 "mv $PG_PGHOME_LINUX_PPC64/include/libhashkit $PG_PGHOME_LINUX_PPC64/include/postgresql/server/" || _die "Failed to copy libhashkit to staging directory" - - ssh $PG_SSH_LINUX_PPC64 "mkdir -p $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/lib " || _die "Failed to create staging/linux-ppc64/lib " - ssh $PG_SSH_LINUX_PPC64 "mkdir -p $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/include " || _die "Failed to create staging/linux-ppc64/include " - ssh $PG_SSH_LINUX_PPC64 "mkdir -p $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/share " || _die "Failed to create staging/linux-ppc64/share " - - ssh $PG_SSH_LINUX_PPC64 "cd $PG_PATH_LINUX_PPC64/pgmemcache/source/pgmemcache.linux-ppc64; PATH=\$PATH:$PG_PGHOME_LINUX_PPC64/bin make " || _die "Failed to build pgmemcache" - ssh $PG_SSH_LINUX_PPC64 "cd $PG_PATH_LINUX_PPC64/pgmemcache/source/pgmemcache.linux-ppc64; PATH=\$PATH:$PG_PGHOME_LINUX_PPC64/bin make install " || _die "Failed to install pgmemcache" - ssh $PG_SSH_LINUX_PPC64 "cp $PG_PGHOME_LINUX_PPC64/lib/postgresql/pgmemcache.so $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/lib/; rm -f $PG_PGHOME_LINUX_PPC64/lib/postgresql/pgmemcache.so" || _die "Failed to copy pgmemcache to staging directory" - ssh $PG_SSH_LINUX_PPC64 "cp $PG_PGHOME_LINUX_PPC64/share/postgresql/contrib/pgmemcache.sql $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/share/; rm -f $PG_PGHOME_LINUX_PPC64/share/postgresql/contrib/pgmemcache.sql" || _die "Failed to copy pgmemcache sql to staging directory" - - ssh $PG_SSH_LINUX_PPC64 "cp $PG_PGHOME_LINUX_PPC64/lib/libmemcached* $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/lib/ ; rm -f $PG_PGHOME_LINUX_PPC64/lib/libmemcached* " || _die "Failed to copy libmemcached to staging directory" - ssh $PG_SSH_LINUX_PPC64 "cp $PG_PGHOME_LINUX_PPC64/lib/libhashkit* $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/lib/ ; rm -f $PG_PGHOME_LINUX_PPC64/lib/libhashkit* " || _die "Failed to copy libhashkit to staging directory" - ssh $PG_SSH_LINUX_PPC64 "cp -R $PG_PGHOME_LINUX_PPC64/include/postgresql/server/libmemcached $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/include/; rm -rf $PG_PGHOME_LINUX_PPC64/include/postgresql/server/libmemcached" || _die "Failed to copy libmemcached folder to staging directory" - ssh $PG_SSH_LINUX_PPC64 "cp -R $PG_PGHOME_LINUX_PPC64/include/postgresql/server/libhashkit $PG_PATH_LINUX_PPC64/pgmemcache/staging/linux-ppc64/include/; rm -rf $PG_PGHOME_LINUX_PPC64/include/postgresql/server/libhashkit" || _die "Failed to copy libhashkit folder to staging directory" - -} - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_pgmemcache_linux_ppc64() { - - - cd $WD/pgmemcache - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml linux-ppc || _die "Failed to build the installer" - - mv $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-linux-ppc.bin $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-linux-ppc64.bin - cd $WD -} - diff --git a/pgmemcache/build-linux-x64.sh b/pgmemcache/build-linux-x64.sh deleted file mode 100755 index baa05c687..000000000 --- a/pgmemcache/build-linux-x64.sh +++ /dev/null @@ -1,161 +0,0 @@ -#!/bin/bash - -################################################################################ -# pgmemcache Build preparation -################################################################################ - -_prep_pgmemcache_linux_x64() { - - echo "BEGIN PREP pgmemcache Linux-x64" - - echo "############################################" - echo "# pgmemcache : LINUX-X64 : Build preparation #" - echo "############################################" - - PGMEM_PACKAGE_PATH=$WD/pgmemcache - PGMEM_PLATFORM=linux-x64 - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build - PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source - - # Remove any existing source directory that might exists, and create a clean one - if [ -e $PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM ]; then - echo "Removing existing source directory (pgmemcache.$PGMEM_PLATFORM/pgmemcache.$PGMEM_PLATFORM)" - rm -rf $PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM || _die "Couldn't remove the existing source directory ($PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM)" - fi - cp -r $PGMEM_SOURCE/pgmemcache-$PG_VERSION_PGMEMCACHE $PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM || _die "Couldn't copy the source directory (pgmemcache.$PGMEM_PLATFORM)" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $PGMEM_STAGING ]; - then - echo "Removing existing staging directory" - rm -rf $PGMEM_STAGING || _die "Couldn't remove the existing staging directory ($PGMEM_STAGING)" - fi - - echo "Creating staging directory ($PGMEM_STAGING)" - mkdir -p $PGMEM_STAGING || _die "Couldn't create the staging directory" - - echo "END PREP pgmemcache Linux-x64" -} - -################################################################################ -# pgmemcache Build -################################################################################ - -_build_pgmemcache_linux_x64() { - - echo "BEGIN BUILD pgmemcache Linux-x64" - - echo "##################################" - echo "# pgmemcache : LINUX-X64 : Build #" - echo "##################################" - - PGMEM_PACKAGE_PATH=$WD/pgmemcache - PGMEM_PLATFORM=linux-x64 - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build - PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source/pgmemcache.$PGMEM_PLATFORM - PG_PATH=$PG_PGHOME_LINUX_X64 - PVT_SSH=$PG_SSH_LINUX_X64 - PVT_REPO=$PG_PATH_LINUX_X64 - PGMEM_PACKAGE_VM_PATH=$PVT_REPO/pgmemcache/source/pgmemcache.$PGMEM_PLATFORM - - cd $PGMEM_SOURCE - ssh $PVT_SSH "cd $PGMEM_PACKAGE_VM_PATH; LD_LIBRARY_PATH=$PG_PATH/lib PATH=$PG_PATH/bin:$PATH make CFLAGS=\" -I/opt/local/Current/include \" LDFLAGS=\" -L/opt/local/Current/lib -Wl,--rpath,$PGMEM_PACKAGE_VM_PATH/../lib\"" || _die "Failed to build the pgmemcache for $PGMEM_PLATFORM" - - echo "Changing rpath" - ssh $PVT_SSH "cd $PGMEM_PACKAGE_VM_PATH; chrpath --replace \"\\\${ORIGIN}\" pgmemcache.so" - - cd $PGMEM_SOURCE - - # Copying the binaries - mkdir -p $PGMEM_STAGING/include || _die "Failed to create include directory" - mkdir -p $PGMEM_STAGING/lib || _die "Failed to create lib directory" - mkdir -p $PGMEM_STAGING/share/extension || _die "Failed to create share directory" - - ssh $PVT_SSH "cp -pR /opt/local/Current/lib/libmemcached.so* $PVT_REPO/pgmemcache/staging/linux-x64.build/lib/" || _die "Failed to copy the libmemcached binaries" - cp -pR $PGMEM_SOURCE/pgmemcache.so $PGMEM_STAGING/lib || _die "Failed to copy the pgmemcache binary" - cp -pR $PGMEM_SOURCE/*.sql $PGMEM_STAGING/share/extension || _die "Failed to copy the share files for the pgmemcache" - cp -pR $PGMEM_SOURCE/pgmemcache.control $PGMEM_STAGING/share/extension || _die "Failed to copy the control file for the pgmemcache" - ssh $PVT_SSH "cp -pR /opt/local/Current/include/* $PVT_REPO/pgmemcache/staging/linux-x64.build/include" || _die "Failed to copy the header files for the libmemcached" - - chmod a+rx $PGMEM_STAGING/lib/* || _die "Failed to set permissions" - chmod a+r $PGMEM_STAGING/share/extension/* || _die "Failed to set permissions" - - # Generate debug symbols - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX_X64/pgmemcache/staging/linux-x64.build" || _die "Failed to execute create_debug_symbols.sh" - - # Remove existing symbols directory in output directory - if [ -e $WD/output/symbols/linux-x64/pgmemcache ]; - then - echo "Removing existing $WD/output/symbols/linux-x64/pgmemcache directory" - rm -rf $WD/output/symbols/linux-x64/pgmemcache || _die "Couldn't remove the existing $WD/output/symbols/linux-x64/pgmemcache directory." - fi - - # Move symbols directory in output - mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/pgmemcache/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/pgmemcache || _die "Failed to move $WD/pgmemcache/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/pgmemcache directory" - - echo "Removing last successful staging directory ($WD/pgmemcache/staging/linux-x64)" - rm -rf $WD/pgmemcache/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" - mkdir -p $WD/pgmemcache/staging/linux-x64 || _die "Couldn't create the last successful staging directory" - chmod ugo+w $WD/pgmemcache/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" - - echo "Copying the complete build to the successful staging directory" - cp -rp $WD/pgmemcache/staging/linux-x64.build/* $WD/pgmemcache/staging/linux-x64 || _die "Couldn't copy the existing staging directory" - echo "PG_VERSION_PGMEMCACHE=$PG_VERSION_PGMEMCACHE" > $WD/pgmemcache/staging/linux-x64/versions-linux-x64.sh - echo "PG_BUILDNUM_PGMEMCACHE=$PG_BUILDNUM_PGMEMCACHE" >> $WD/pgmemcache/staging/linux-x64/versions-linux-x64.sh - - echo "END BUILD pgmemcache Linux-x64" -} - - -################################################################################ -# pgmemcache Post Process -################################################################################ - -_postprocess_pgmemcache_linux_x64() { - - echo "BEGIN POST pgmemcache Linux-x64" - - echo "#########################################" - echo "# pgmemcache : LINUX-X64 : Post Process #" - echo "#########################################" - - source $WD/pgmemcache/staging/linux-x64/versions-linux-x64.sh - PG_BUILD_PGMEMCACHE=$(expr $PG_BUILD_PGMEMCACHE + $SKIPBUILD) - - PGMEM_PACKAGE_PATH=$WD/pgmemcache - PGMEM_PLATFORM=linux-x64 - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM - - cd $PGMEM_PACKAGE_PATH - - pushd staging/linux-x64 - generate_3rd_party_license "pgmemcache" - popd - - # Make all the files readable under the given directory - find "$PGMEM_STAGING" -exec chmod a+r {} \; - # Make all the directories readable, writable and executable under the given directory - find "$PGMEM_STAGING" -type d -exec chmod 755 {} \; - # Make all the shared objects readable and executable under the given directory - find "$PGMEM_STAGING" -name "*.so*" -exec chmod 755 {} \; - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml ${PGMEM_PLATFORM} || _die "Failed to build the installer (${PGMEM_PLATFORM})" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_PGMEMCACHE -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-linux-x64.run $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}linux-x64.run - - cd $WD - - echo "END POST pgmemcache Linux-x64" - -} - diff --git a/pgmemcache/build-linux.sh b/pgmemcache/build-linux.sh deleted file mode 100755 index 6c9fbf1d4..000000000 --- a/pgmemcache/build-linux.sh +++ /dev/null @@ -1,161 +0,0 @@ -#!/bin/bash - -################################################################################ -# pgmemcache Build preparation -################################################################################ - -_prep_pgmemcache_linux() { - - echo "BEGIN PREP pgmemcache Linux" - - echo "############################################" - echo "# pgmemcache : LINUX : Build preparation #" - echo "############################################" - - PGMEM_PACKAGE_PATH=$WD/pgmemcache - PGMEM_PLATFORM=linux - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build - PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source - - # Remove any existing source directory that might exists, and create a clean one - if [ -e $PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM ]; then - echo "Removing existing source directory (pgmemcache.$PGMEM_PLATFORM/pgmemcache.$PGMEM_PLATFORM)" - rm -rf $PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM || _die "Couldn't remove the existing source directory ($PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM)" - fi - cp -r $PGMEM_SOURCE/pgmemcache-$PG_VERSION_PGMEMCACHE $PGMEM_SOURCE/pgmemcache.$PGMEM_PLATFORM || _die "Couldn't copy the source directory (pgmemcache.$PGMEM_PLATFORM)" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $PGMEM_STAGING ]; - then - echo "Removing existing staging directory" - rm -rf $PGMEM_STAGING || _die "Couldn't remove the existing staging directory ($PGMEM_STAGING)" - fi - - echo "Creating staging directory ($PGMEM_STAGING)" - mkdir -p $PGMEM_STAGING || _die "Couldn't create the staging directory" - echo "END PREP pgmemcache Linux" -} - -################################################################################ -# pgmemcache Build -################################################################################ - -_build_pgmemcache_linux() { - - echo "BEGIN BUILD pgmemcache Linux" - - echo "##############################" - echo "# pgmemcache : LINUX : Build #" - echo "##############################" - - PGMEM_PACKAGE_PATH=$WD/pgmemcache - PGMEM_PLATFORM=linux - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/${PGMEM_PLATFORM}.build - PGMEM_SOURCE=$PGMEM_PACKAGE_PATH/source/pgmemcache.$PGMEM_PLATFORM - PG_PATH=$PG_PGHOME_LINUX - PVT_SSH=$PG_SSH_LINUX - PVT_REPO=$PG_PATH_LINUX - PGMEM_PACKAGE_VM_PATH=$PVT_REPO/pgmemcache/source/pgmemcache.$PGMEM_PLATFORM - - cd $PGMEM_SOURCE - ssh $PVT_SSH "cd $PGMEM_PACKAGE_VM_PATH; LD_LIBRARY_PATH=$PG_PATH/lib PATH=$PG_PATH/bin:$PATH make CFLAGS=\" -I/opt/local/Current/include \" LDFLAGS=\" -L/opt/local/Current/lib -Wl,--rpath,$PGMEM_PACKAGE_VM_PATH/../lib\"" || _die "Failed to build the pgmemcache for $PGMEM_PLATFORM" - - echo "Changing rpath" - ssh $PVT_SSH "cd $PGMEM_PACKAGE_VM_PATH; chrpath --replace \"\\\${ORIGIN}\" pgmemcache.so" - - cd $PGMEM_SOURCE - - # Copying the binaries - mkdir -p $PGMEM_STAGING/include || _die "Failed to create include directory" - mkdir -p $PGMEM_STAGING/lib || _die "Failed to create lib directory" - mkdir -p $PGMEM_STAGING/share/extension || _die "Failed to create share directory" - - ssh $PVT_SSH "cp -pR /opt/local/Current/lib/libmemcached.so* $PVT_REPO/pgmemcache/staging/linux.build/lib/" || _die "Failed to copy the libmemcached binaries" - cp -pR $PGMEM_SOURCE/pgmemcache.so $PGMEM_STAGING/lib || _die "Failed to copy the pgmemcache binary" - cp -pR $PGMEM_SOURCE/*.sql $PGMEM_STAGING/share/extension || _die "Failed to copy the share files for the pgmemcache" - cp -pR $PGMEM_SOURCE/pgmemcache.control $PGMEM_STAGING/share/extension || _die "Failed to copy the control file for the pgmemcache" - ssh $PVT_SSH "cp -pR /opt/local/Current/include/libmemcached* $PVT_REPO/pgmemcache/staging/linux.build/include/" || _die "Failed to copy the header files for the libmemcached" - - chmod a+rx $PGMEM_STAGING/lib/* || _die "Failed to set permissions" - chmod a+r $PGMEM_STAGING/share/extension/* || _die "Failed to set permissions" - - # Generate debug symbols - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_PATH_LINUX/pgmemcache/staging/linux.build" || _die "Failed to execute create_debug_symbols.sh" - - # Remove existing symbols directory in output directory - if [ -e $WD/output/symbols/linux/pgmemcache ]; - then - echo "Removing existing $WD/output/symbols/linux/pgmemcache directory" - rm -rf $WD/output/symbols/linux/pgmemcache || _die "Couldn't remove the existing $WD/output/symbols/linux/pgmemcache directory." - fi - - # Move symbols directory in output - mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/pgmemcache/staging/linux.build/symbols $WD/output/symbols/linux/pgmemcache || _die "Failed to move $WD/pgmemcache/staging/linux.build/symbols to $WD/output/symbols/linux/pgmemcache directory" - - echo "Removing last successful staging directory ($WD/pgmemcache/staging/linux)" - rm -rf $WD/pgmemcache/staging/linux || _die "Couldn't remove the last successful staging directory" - mkdir -p $WD/pgmemcache/staging/linux || _die "Couldn't create the last successful staging directory" - chmod ugo+w $WD/pgmemcache/staging/linux || _die "Couldn't set the permissions on the successful staging directory" - - echo "Copying the complete build to the successful staging directory" - cp -rp $WD/pgmemcache/staging/linux.build/* $WD/pgmemcache/staging/linux || _die "Couldn't copy the existing staging directory" - echo "PG_VERSION_PGMEMCACHE=$PG_VERSION_PGMEMCACHE" > $WD/pgmemcache/staging/linux/versions-linux.sh - echo "PG_BUILDNUM_PGMEMCACHE=$PG_BUILDNUM_PGMEMCACHE" >> $WD/pgmemcache/staging/linux/versions-linux.sh - - echo "END BUILD pgmemcache Linux" - -} - - -################################################################################ -# pgmemcache Post Process -################################################################################ - -_postprocess_pgmemcache_linux() { - - echo "BEGIN POST pgmemcache Linux" - - echo "#######################################" - echo "# pgmemcache : LINUX : Post Process #" - echo "#######################################" - - source $WD/pgmemcache/staging/linux/versions-linux.sh - PG_BUILD_PGMEMCACHE=$(expr $PG_BUILD_PGMEMCACHE + $SKIPBUILD) - - PGMEM_PACKAGE_PATH=$WD/pgmemcache - PGMEM_PLATFORM=linux - PGMEM_STAGING=$PGMEM_PACKAGE_PATH/staging/$PGMEM_PLATFORM - - cd $PGMEM_PACKAGE_PATH - - pushd staging/linux - generate_3rd_party_license "pgmemcache" - popd - - # Make all the files readable under the given directory - find "$PGMEM_STAGING" -exec chmod a+r {} \; - # Make all the directories readable, writable and executable under the given directory - find "$PGMEM_STAGING" -type d -exec chmod 755 {} \; - # Make all the shared objects readable and executable under the given directory - find "$PGMEM_STAGING" -name "*.so*" -exec chmod 755 {} \; - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml ${PGMEM_PLATFORM} || _die "Failed to build the installer (${PGMEM_PLATFORM})" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_PGMEMCACHE -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-linux.run $WD/output/pgmemcache-pg$PG_CURRENT_VERSION-$PG_VERSION_PGMEMCACHE-$PG_BUILDNUM_PGMEMCACHE-${BUILD_FAILED}linux.run - - cd $WD - - echo "END POST pgmemcache Linux" - -} - diff --git a/sqlprotect/build-linux-x64.sh b/sqlprotect/build-linux-x64.sh deleted file mode 100644 index 36f5526ca..000000000 --- a/sqlprotect/build-linux-x64.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_sqlprotect_linux_x64() { - - echo "BEGIN PREP sqlprotect Linux-x64" - - cd $WD/server/source - - # Remove any existing sqlprotect directory that might exist, in server - if [ -e postgres.linux-x64/contrib/SQLPROTECT ]; - then - echo "Removing existing sqlprotect directory" - rm -rf postgres.linux-x64/contrib/SQLPROTECT || _die "Couldn't remove the existing sqlprotect directory" - fi - - # create a copy of the sqlprotect tree - cd postgres.linux-x64/contrib - git clone ssh://pginstaller@cvs.enterprisedb.com/git/SQLPROTECT - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/sqlprotect/staging/linux-x64.build ]; - then - echo "Removing existing staging directory" - rm -rf $WD/sqlprotect/staging/linux-x64.build || _die "Couldn't remove the existing staging directory" - fi - - echo "Creating staging directory ($WD/sqlprotect/staging/linux-x64.build)" - mkdir -p $WD/sqlprotect/staging/linux-x64.build/sqlprotect || _die "Couldn't create the staging directory" - chmod ugo+w $WD/sqlprotect/staging/linux-x64.build || _die "Couldn't set the permissions on the staging directory" - - echo "END PREP sqlprotect Linux-x64" -} - -################################################################################ -# Build -################################################################################ - -_build_sqlprotect_linux_x64() { - - PG_STAGING=$PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build - - echo "BEGIN BUILD sqlprotect Linux-x64" - - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/; make distclean ; make" || _die "Failed to build sqlprotect" - - ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/lib/postgresql" || _die "Failed to create staging/linux-x64.build/lib/postgresql" - ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/share" || _die "Failed to create staging/linux-x64.build/share" - ssh $PG_SSH_LINUX_X64 "mkdir -p $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/doc" || _die "Failed to create staging/linux-x64.build/doc" - - ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" - ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/share/" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_LINUX_X64 "cp $PG_PATH_LINUX_X64/server/source/postgres.linux-x64/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_LINUX_X64/sqlprotect/staging/linux-x64.build/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" - chmod -R ugo+r $WD/sqlprotect/staging/linux-x64.build - - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/linux-x64.build/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/linux-x64.build/sqlprotect_license.txt || _die "Unable to change permissions for license file" - - # Generate debug symbols - ssh $PG_SSH_LINUX_X64 "cd $PG_PATH_LINUX_X64/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" - - # Remove existing symbols directory in output directory - if [ -e $WD/output/symbols/linux-x64/sqlprotect ]; - then - echo "Removing existing $WD/output/symbols/linux-x64/sqlprotect directory" - rm -rf $WD/output/symbols/linux-x64/sqlprotect || _die "Couldn't remove the existing $WD/output/symbols/linux-x64/sqlprotect directory." - fi - - # Move symbols directory in output - mkdir -p $WD/output/symbols/linux-x64 || _die "Failed to create $WD/output/symbols/linux-x64 directory" - mv $WD/sqlprotect/staging/linux-x64.build/symbols $WD/output/symbols/linux-x64/sqlprotect || _die "Failed to move $WD/sqlprotect/staging/linux-x64.build/symbols to $WD/output/symbols/linux-x64/sqlprotect directory" - - echo "Removing last successful staging directory ($WD/sqlprotect/staging/linux-x64)" - rm -rf $WD/sqlprotect/staging/linux-x64 || _die "Couldn't remove the last successful staging directory" - mkdir -p $WD/sqlprotect/staging/linux-x64 || _die "Couldn't create the last successful staging directory" - chmod ugo+w $WD/sqlprotect/staging/linux-x64 || _die "Couldn't set the permissions on the successful staging directory" - - echo "Copying the complete build to the successful staging directory" - cp -rp $WD/sqlprotect/staging/linux-x64.build/* $WD/sqlprotect/staging/linux-x64 || _die "Couldn't copy the existing staging directory" - echo "PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT" > $WD/sqlprotect/staging/linux-x64/versions-linux-x64.sh - echo "PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT" >> $WD/sqlprotect/staging/linux-x64/versions-linux-x64.sh - - echo "END BUILD sqlprotect Linux-x64" -} - - -################################################################################ -# Post process -################################################################################ - -_postprocess_sqlprotect_linux_x64() { - - echo "BEGIN POST sqlprotect Linux-x64" - - source $WD/sqlprotect/staging/linux-x64/versions-linux-x64.sh - PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) - - cd $WD/sqlprotect - - # Set permissions to all files and folders in staging - _set_permissions linux-x64 - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml linux-x64 || _die "Failed to build the installer" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_SQLPROTECT -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-linux-x64.run $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}linux-x64.run - - cd $WD - - echo "END POST sqlprotect Linux-x64" -} diff --git a/sqlprotect/build-linux.sh b/sqlprotect/build-linux.sh deleted file mode 100644 index 4e2dc4f5a..000000000 --- a/sqlprotect/build-linux.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_sqlprotect_linux() { - - echo "BEGIN PREP sqlprotect Linux" - - cd $WD/server/source - - # Remove any existing sqlprotect directory that might exist, in server - if [ -e postgres.linux/contrib/SQLPROTECT ]; - then - echo "Removing existing sqlprotect directory" - rm -rf postgres.linux/contrib/SQLPROTECT || _die "Couldn't remove the existing sqlprotect directory" - fi - - # create a copy of the sqlprotect tree - cd postgres.linux/contrib - git clone ssh://pginstaller@cvs.enterprisedb.com/git/SQLPROTECT - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/sqlprotect/staging/linux.build ]; - then - echo "Removing existing staging directory" - rm -rf $WD/sqlprotect/staging/linux.build || _die "Couldn't remove the existing staging directory" - fi - - echo "Creating staging directory ($WD/sqlprotect/staging/linux.build)" - mkdir -p $WD/sqlprotect/staging/linux.build/sqlprotect || _die "Couldn't create the staging directory" - chmod ugo+w $WD/sqlprotect/staging/linux.build || _die "Couldn't set the permissions on the staging directory" - - echo "END PREP sqlprotect Linux" -} - -################################################################################ -# Build -################################################################################ - -_build_sqlprotect_linux() { - - PG_STAGING=$PG_PATH_LINUX/sqlprotect/staging/linux.build - - echo "BEGIN BUILD sqlprotect Linux" - - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/; make distclean ; make" || _die "Failed to build sqlprotect" - - ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux.build/lib/postgresql" || _die "Failed to create staging/linux.build/lib/postgresql" - ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux.build/share" || _die "Failed to create staging/linux.build/share" - ssh $PG_SSH_LINUX "mkdir -p $PG_PATH_LINUX/sqlprotect/staging/linux.build/doc" || _die "Failed to create staging/linux.build/doc" - - ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/sqlprotect.so $PG_PATH_LINUX/sqlprotect/staging/linux.build/lib/postgresql/" || _die "Failed to copy sqlprotect.so to staging directory" - ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_LINUX/sqlprotect/staging/linux.build/share/" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_LINUX "cp $PG_PATH_LINUX/server/source/postgres.linux/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_LINUX/sqlprotect/staging/linux.build/doc/" || _die "Failed to copy README-sqlprotect.txt to staging directory" - - chmod -R ugo+r $WD/sqlprotect/staging/linux.build - - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/linux.build/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/linux.build/sqlprotect_license.txt || _die "Unable to change permissions for license file" - - #Generate debug symbols - ssh $PG_SSH_LINUX "cd $PG_PATH_LINUX/resources; chmod 755 create_debug_symbols.sh; ./create_debug_symbols.sh $PG_STAGING" || _die "Failed to execute create_debug_symbols.sh" - - # Remove existing symbols directory in output directory - if [ -e $WD/output/symbols/linux/sqlprotect ]; - then - echo "Removing existing $WD/output/symbols/linux/sqlprotect directory" - rm -rf $WD/output/symbols/linux/sqlprotect || _die "Couldn't remove the existing $WD/output/symbols/linux/sqlprotect directory." - fi - - # Move symbols directory in output - mkdir -p $WD/output/symbols/linux || _die "Failed to create $WD/output/symbols/linux directory" - mv $WD/sqlprotect/staging/linux.build/symbols $WD/output/symbols/linux/sqlprotect || _die "Failed to move $WD/sqlprotect/staging/linux.build/symbols to $WD/output/symbols/linux/sqlprotect directory" - - echo "Removing last successful staging directory ($WD/sqlprotect/staging/linux)" - rm -rf $WD/sqlprotect/staging/linux || _die "Couldn't remove the last successful staging directory" - mkdir -p $WD/sqlprotect/staging/linux || _die "Couldn't create the last successful staging directory" - chmod ugo+w $WD/sqlprotect/staging/linux || _die "Couldn't set the permissions on the successful staging directory" - - echo "Copying the complete build to the successful staging directory" - cp -rp $WD/sqlprotect/staging/linux.build/* $WD/sqlprotect/staging/linux || _die "Couldn't copy the existing staging directory" - echo "PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT" > $WD/sqlprotect/staging/linux/versions-linux.sh - echo "PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT" >> $WD/sqlprotect/staging/linux/versions-linux.sh - - echo "END BUILD sqlprotect Linux" -} - - -################################################################################ -# Post process -################################################################################ - -_postprocess_sqlprotect_linux() { - - echo "BEGIN POST sqlprotect Linux" - - source $WD/sqlprotect/staging/linux/versions-linux.sh - PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) - - cd $WD/sqlprotect - - # Set permissions to all files and folders in staging - _set_permissions linux - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer.xml linux || _die "Failed to build the installer" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_SQLPROTECT -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-linux.run $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}linux.run - - cd $WD - - echo "END POST sqlprotect Linux" -} - diff --git a/sqlprotect/build-windows.sh b/sqlprotect/build-windows.sh deleted file mode 100755 index d9590c80c..000000000 --- a/sqlprotect/build-windows.sh +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/bash - - -################################################################################ -# Build preparation -################################################################################ - -_prep_sqlprotect_windows() { - - echo "BEGIN PREP sqlprotect Windows" - - cd $WD/server/source - - # Remove any existing sqlprotect directory that might exist, in server - if [ -e postgres.windows/contrib/SQLPROTECT ]; - then - echo "Removing existing sqlprotect directory" - rm -rf postgres.windows/contrib/SQLPROTECT || _die "Couldn't remove the existing sqlprotect directory" - fi - - # create a copy of the sqlprotect tree - cd postgres.windows/contrib - git clone ssh://pginstaller@cvs.enterprisedb.com/git/SQLPROTECT - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/sqlprotect/staging/windows ]; - then - echo "Removing existing staging directory" - rm -rf $WD/sqlprotect/staging/windows || _die "Couldn't remove the existing staging directory" - fi - - echo "Creating staging directory ($WD/sqlprotect/staging/windows)" - mkdir -p $WD/sqlprotect/staging/windows/sqlprotect || _die "Couldn't create the staging directory" - chmod ugo+w $WD/sqlprotect/staging/windows || _die "Couldn't set the permissions on the staging directory" - - echo "Archiving sqlprotect sources" - cd $WD/server/source - if [ -e sqlprotect.zip ]; - then - echo "Removing existing source archive" - rm sqlprotect.zip || _die "Couldn't remove sqlprotect.zip" - fi - zip sqlprotect.zip postgres.windows/contrib/SQLPROTECT/* || _die "Couldn't create archive of the sqlprotect sources (sqlprotect.zip)" - - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect.zip del /S /Q sqlprotect.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\sqlprotect.zip on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect.staging.build rd /S /Q sqlprotect.staging.build" || _die "Couldn't remove the $PG_PATH_WINDOWS\\sqlprotect.staging.build directory on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect-staging.zip del /S /Q sqlprotect-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\\sqlprotect-staging.zip on Windows VM" - - # Removing sqlprotect if it already exists - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/contrib; cmd /c if EXIST SQLPROTECT del /S /Q SQLPROTECT" || _die "Couldn't remove sqlprotect on windows VM (sqlprotect)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/release; cmd /c if EXIST sqlprotect del /S /Q sqlprotect" || _die "Couldn't remove sqlprotect on windows VM (sqlprotect)" - - # Copy sources on windows VM - echo "Copying sqlprotect sources to Windows VM" - scp sqlprotect.zip $PG_SSH_WINDOWS:$PG_PATH_WINDOWS || _die "Couldn't copy the sqlprotect archive to windows VM (sqlprotect.zip)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c unzip sqlprotect.zip" || _die "Couldn't extract postgresql archieve on windows VM (sqlprotect.zip)" - chmod -R ugo+r $WD/sqlprotect/staging/windows - - echo "END PREP sqlprotect Windows" -} - -################################################################################ -# PG Build -################################################################################ - -_build_sqlprotect_windows() { - - echo "BEGIN BUILD sqlprotect Windows" - -cat < "$WD/server/source/build32-sqlprotect.bat" - -@SET PATH=%PATH%;$PG_PERL_WINDOWS\bin - -build.bat sqlprotect RELEASE - -EOT - - scp $WD/server/source/build32-sqlprotect.bat $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/postgres.windows/src/tools/msvc || _die "Failed to copy the build32.bat" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS/postgres.windows/src/tools/msvc; ./build32-sqlprotect.bat " || _die "could not build sqlprotect on windows vm" - - # We need to copy shared objects to staging directory - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging.build/lib/postgresql" || _die "Failed to create the lib directory" - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging.build/share" || _die "Failed to create the share directory" - ssh $PG_SSH_WINDOWS "mkdir -p $PG_PATH_WINDOWS/sqlprotect.staging.build/doc" || _die "Failed to create the doc directory" - - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/release/sqlprotect/sqlprotect.dll $PG_PATH_WINDOWS/sqlprotect.staging.build/lib/postgresql" || _die "Failed to copy sqlprotect.dll to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/contrib/SQLPROTECT/sqlprotect.sql $PG_PATH_WINDOWS/sqlprotect.staging.build/share" || _die "Failed to copy sqlprotect.sql to staging directory" - ssh $PG_SSH_WINDOWS "cp $PG_PATH_WINDOWS/postgres.windows/contrib/SQLPROTECT/README-sqlprotect.txt $PG_PATH_WINDOWS/sqlprotect.staging.build/doc" || _die "Failed to copy README-sqlprotect.txt to staging directory" - - # Remove any existing sqlprotect directory that might exist, in server - if [ -e postgres.windows/contrib/SQLPROTECT ]; - then - echo "Removing existing sqlprotect directory" - rm -rf postgres.windows/contrib/SQLPROTECT || _die "Couldn't remove the existing sqlprotect directory" - fi - - echo "Removing last successful staging directory ($PG_PATH_WINDOWS\\\\sqlprotect.staging)" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect.staging rd /S /Q sqlprotect.staging" || _die "Couldn't remove the last successful staging directory directory" - ssh $PG_SSH_WINDOWS "cmd /c mkdir $PG_PATH_WINDOWS\\\\sqlprotect.staging" || _die "Couldn't create the last successful staging directory" - - echo "Copying the complete build to the successful staging directory" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c xcopy /E /Q /Y sqlprotect.staging.build\\\\* sqlprotect.staging\\\\" || _die "Couldn't copy the existing staging directory" - - ssh $PG_SSH_WINDOWS "cmd /c echo PG_VERSION_SQLPROTECT=$PG_VERSION_SQLPROTECT > $PG_PATH_WINDOWS\\\\sqlprotect.staging/versions-windows.sh" || _die "Failed to write sqlprotect version number into versions-windows.sh" - ssh $PG_SSH_WINDOWS "cmd /c echo PG_BUILDNUM_SQLPROTECT=$PG_BUILDNUM_SQLPROTECT >> $PG_PATH_WINDOWS\\\\sqlprotect.staging/versions-windows.sh" || _die "Failed to write sqlprotect build number into versions-windows.sh" - - - echo "END BUILD sqlprotect Windows" -} - - - -################################################################################ -# PG Build -################################################################################ - -_postprocess_sqlprotect_windows() { - - echo "BEGIN POST sqlprotect Windows" - - # Remove any existing staging directory that might exist, and create a clean one - if [ -e $WD/sqlprotect/staging/windows ]; - then - echo "Removing existing staging directory" - rm -rf $WD/sqlprotect/staging/windows || _die "Couldn't remove the existing staging directory" - fi - echo "Creating staging directory ($WD/sqlprotect/staging/windows)" - mkdir -p $WD/sqlprotect/staging/windows/sqlprotect || _die "Couldn't create the staging directory" - chmod ugo+w $WD/sqlprotect/staging/windows || _die "Couldn't set the permissions on the staging directory" - - # Zip up the installed code, copy it back here, and unpack. - echo "Copying sqlprotect build tree to Unix host" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS; cmd /c if EXIST sqlprotect-staging.zip del /S /Q sqlprotect-staging.zip" || _die "Couldn't remove the $PG_PATH_WINDOWS\sqlprotect-staging.zip on Windows VM" - ssh $PG_SSH_WINDOWS "cd $PG_PATH_WINDOWS\\\\sqlprotect.staging; cmd /c zip -r ..\\\\sqlprotect-staging.zip *" || _die "Failed to pack the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect.staging)" - scp $PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect-staging.zip $WD/sqlprotect/staging/windows || _die "Failed to copy the built source tree ($PG_SSH_WINDOWS:$PG_PATH_WINDOWS/sqlprotect-staging.zip)" - unzip $WD/sqlprotect/staging/windows/sqlprotect-staging.zip -d $WD/sqlprotect/staging/windows || _die "Failed to unpack the built source tree ($WD/staging/windows/sqlprotect-staging.zip)" - rm $WD/sqlprotect/staging/windows/sqlprotect-staging.zip - - dos2unix $WD/sqlprotect/staging/windows/versions-windows.sh || _die "Failed to convert format of versions-windows.sh from dos to unix" - source $WD/sqlprotect/staging/windows/versions-windows.sh - PG_BUILD_SQLPROTECT=$(expr $PG_BUILD_SQLPROTECT + $SKIPBUILD) - - cp $WD/sqlprotect/resources/licence.txt $WD/sqlprotect/staging/windows/sqlprotect_license.txt || _die "Unable to copy sqlprotect_license.txt" - chmod 444 $WD/sqlprotect/staging/windows/sqlprotect_license.txt || _die "Unable to change permissions for license file" - - cd $WD/sqlprotect - - if [ -f installer-win.xml ]; - then - rm -f installer-win.xml - fi - cp installer.xml installer-win.xml - - _replace @@WIN64MODE@@ "0" installer-win.xml || _die "Failed to replace the WIN64MODE setting in the installer.xml" - _replace @@WINDIR@@ "windows" installer-win.xml || _die "Failed to replace the WINDIR setting in the installer.xml" - - # Build the installer - "$PG_INSTALLBUILDER_BIN" build installer-win.xml windows || _die "Failed to build the installer" - - # If build passed empty this variable - BUILD_FAILED="build_failed-" - if [ $PG_BUILD_SQLPROTECT -gt 0 ]; - then - BUILD_FAILED="" - fi - - # Rename the installer - mv $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-windows.exe $WD/output/edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}windows.exe || _die "Failed to rename the installer" - - # Sign the installer - win32_sign "edb-sqlprotect-$PG_VERSION_SQLPROTECT-$PG_BUILDNUM_SQLPROTECT-${BUILD_FAILED}windows.exe" - - cd $WD - - echo "END POST sqlprotect Windows" -} -