From 7f206eeda3aa08a9b16d1be5ac5cb7799604576e Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 16 Aug 2004 12:17:49 +0000 Subject: [PATCH] added create_clean_lazarus_directory.sh git-svn-id: trunk@5801 - --- .gitattributes | 1 + tools/install/README | 8 +-- .../install/create_clean_lazarus_directory.sh | 59 +++++++++++++++++++ .../create_lazarus_tgz_from_local_dir.sh | 6 +- 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 tools/install/create_clean_lazarus_directory.sh diff --git a/.gitattributes b/.gitattributes index 8788abac89..33d28ff9aa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1473,6 +1473,7 @@ tools/getallmofiles.sh -text svneol=native#application/x-sh tools/getallpofiles.sh -text svneol=native#application/x-sh tools/install/build_fpc_rpm.sh -text svneol=native#application/x-sh tools/install/build_fpcsrc_rpm.sh -text svneol=native#application/x-sh +tools/install/create_clean_lazarus_directory.sh -text svneol=native#application/x-sh tools/install/create_fpc_deb.sh -text svneol=native#application/x-sh tools/install/create_fpc_export_tgz.sh -text svneol=native#application/x-sh tools/install/create_fpc_tgz_from_local_dir.sh -text svneol=native#application/x-sh diff --git a/tools/install/README b/tools/install/README index e42bf3aa2d..4bc9ec5118 100644 --- a/tools/install/README +++ b/tools/install/README @@ -129,20 +129,20 @@ Mac OS X: Creating the DMG packages for FPC and Lazarus: 1. create a temp directory with a usr/local hierarchy under it, owned - by root (e.g. sudo mkdir -p ~/pascal/fpcinst/usr/local) + by root (e.g. sudo mkdir -p ~/fpcinst/usr/local) 2. cd fpc (your fpc source directory) 3. make all -4. sudo make install INSTALL_PREFIX=~/pascal/fpcinst/usr/local +4. sudo make install INSTALL_PREFIX=~/fpcinst/usr/local (it's very important that you use sudo, because the ownership info will be the same when it's installed on the user's computer and you don't want those files to belong to the user that happens to have the same uid as you have) 5. cd compiler - sudo make installsymlink INSTALL_PREFIX=~/pascal/fpcinst/usr/local + sudo make installsymlink INSTALL_PREFIX=~/fpcinst/usr/local 6. unzip the /tools/install/macosx/fpc_installer_info.zip somewhere, open "fpc 1.9.5.pmsp" (it will open in PackageMaker) change the "resources" path so it points to the unzipped fpc_resources directory and the "files" - path so it points to ~/pascal/fpcinst and then choose File->Create Package + path so it points to ~/fpcinst and then choose File->Create Package 7. Put the package in a directory called "Free Pascal Compiler 1.9.5", add in the "Introduction.txt" and "ReadMe.txt" files from the dmg you already downloaded and create a (compressed or not doesn't really diff --git a/tools/install/create_clean_lazarus_directory.sh b/tools/install/create_clean_lazarus_directory.sh new file mode 100644 index 0000000000..0a8f018100 --- /dev/null +++ b/tools/install/create_clean_lazarus_directory.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +set -x +set -e + +LazSrcDir=$1 +LazDestDir=$2 + +LazSrcDir=$(echo $LazSrcDir | sed -e 's#//#/#' -e 's#/$##') +LazDestDir=$(echo $LazDestDir | sed -e 's#//#/#' -e 's#/$##') + +if [ "x$LazSrcDir" = "x" ]; then + echo "Usage: $0 " + exit +fi +if [ "x$LazDestDir" = "x" ]; then + echo "Usage: $0 " + exit +fi +if [ "x$LazDestDir" = "x/" ]; then + echo "Usage: $0 " + exit +fi +if [ ! -d $LazSrcDir/designer ]; then + echo "The directory does not look like a lazarus source directory (lazarus/)" + exit +fi + +echo "copy $LazSrcDir to $LazDestDir ..." +if [ `which rsync` ]; then + rsync -va --exclude="CVS" --exclude=".cvsignore" \ + --exclude="*.ppu" --exclude="*.ppw" --exclude="*.ppl" \ + --exclude="*.o" --exclude="*.ow" --exclude="*.a" --exclude="*.rst" \ + --exclude=".#*" --exclude="*.~*" --exclude="*.bak" \ + --exclude="*.orig" --exclude="*.rej" --exclude="*.bak" \ + --exclude=".xvpics" --exclude="*.compiled" --exclude="killme*" \ + $LazSrcDir $LazDestDir +else + echo cp -a $LazSrcDir $LazDestDir +fi + +echo "cleaning up (CVS, ppu, o) ..." +cd $LazDestDir +make clean +make -C examples clean +make -C tools clean +for Ext in ppu ppw ppl o ow rst cvsignore bak orig rej xvpics; do + find . -name "*.$Ext" -exec rm -f {} \; +done +find . -name "*.~*" -exec rm -f {} \; +find . -name "*.#*" -exec rm -f {} \; +find . -name "CVS" -exec rm -rf {} \; +rm -rf tools/install/*.tgz +rm -rf tools/install/*.*.spec +cd - + + +# end. + diff --git a/tools/install/create_lazarus_tgz_from_local_dir.sh b/tools/install/create_lazarus_tgz_from_local_dir.sh index 6ff86bd311..c29fbc2653 100644 --- a/tools/install/create_lazarus_tgz_from_local_dir.sh +++ b/tools/install/create_lazarus_tgz_from_local_dir.sh @@ -15,13 +15,11 @@ if [ ! -d $LazSrcDir/designer ]; then exit fi -echo "copy $LazSrcDir to /tmp/lazarus ..." +echo "remove /tmp/lazarus ..." cd /tmp rm -rf /tmp/lazarus cd - -cp -a $LazSrcDir /tmp/lazarus - -sh clean_lazaru_directory.sh $LazSrcDir +sh create_clean_lazarus_directory.sh $LazSrcDir /tmp/lazarus # pack echo "packing ..."