ADD: Script for create installation package for Mac OS X

This commit is contained in:
Alexander Koblov 2012-01-02 08:51:50 +00:00
commit 15d4d3a92e
3 changed files with 208 additions and 0 deletions

55
install/create_packages.mac Executable file
View file

@ -0,0 +1,55 @@
#!/bin/sh
# Set Double Commander version
DC_VER=0.5.5
# The new package will be saved here
PACK_DIR=$(pwd)/darwin/release
# Temp dir for creating *.dmg package
BUILD_PACK_DIR=/var/tmp/doublecmd-$(date +%y.%m.%d)
# Create temp dir for building
BUILD_DC_TMP_DIR=/var/tmp/doublecmd-$DC_VER
# DC revision number
DC_REVISION=$(svnversion -n ../)
# Export from SVN
rm -rf $BUILD_DC_TMP_DIR
svn export ../ $BUILD_DC_TMP_DIR
# Save revision number
mkdir $BUILD_DC_TMP_DIR/.svn
cp -a ../.svn/entries $BUILD_DC_TMP_DIR/.svn/
# Set widgetset
if [ -z $lcl ]; then
export lcl=carbon
fi
# Set processor architecture
if [ -z $CPU_TARGET ]; then
export CPU_TARGET=$(fpc -iTP)
fi
# Copy libraries
cp -a darwin/lib/$CPU_TARGET/*.dylib $BUILD_DC_TMP_DIR/
cp -a darwin/lib/$CPU_TARGET/$lcl/*.dylib $BUILD_DC_TMP_DIR/
cd $BUILD_DC_TMP_DIR
# Build all components of Double Commander
./build.sh all
# Create *.dmg package
mkdir -p $BUILD_PACK_DIR
install/darwin/install.sh $BUILD_PACK_DIR
cd $BUILD_PACK_DIR
sed -i -e 's/<UseConfigInProgramDir>False/<UseConfigInProgramDir>True/' doublecmd.app/doublecmd.xml
mv doublecmd.app 'Double Commander.app'
hdiutil create -anyowners -volname "Double Commander" -imagekey zlib-level=9 -format UDZO -srcfolder 'Double Commander.app' $PACK_DIR/doublecmd-$DC_VER-$DC_REVISION.$lcl.$CPU_TARGET.dmg
# Clean DC build dir
rm -rf $BUILD_DC_TMP_DIR
rm -rf $BUILD_PACK_DIR

View file

@ -0,0 +1,83 @@
<?xml version="1.0"?>
<doublecmd DCVersion="0.5.5 alpha" ConfigVersion="1">
<Configuration Save="True">
<UseConfigInProgramDir>False</UseConfigInProgramDir>
</Configuration>
<Colors>
<FileFilters>
<Filter>
<Name>Pascal sources</Name>
<FileMasks>*.pas;*.pp</FileMasks>
<Color>32768</Color>
<Attributes/>
</Filter>
<Filter>
<Name>Pascal binaries</Name>
<FileMasks>*.ppu;*.o;*.dcu</FileMasks>
<Color>16711680</Color>
<Attributes/>
</Filter>
<Filter>
<Name>Specified Executables</Name>
<FileMasks>*</FileMasks>
<Color>55758</Color>
<Attributes>-rwxrwxr*x</Attributes>
</Filter>
<Filter>
<Name>Executables</Name>
<FileMasks>*</FileMasks>
<Color>32768</Color>
<Attributes>-*x*</Attributes>
</Filter>
</FileFilters>
</Colors>
<Plugins>
<DsxPlugins/>
<WcxPlugins>
<WcxPlugin Enabled="True">
<ArchiveExt>lzma</ArchiveExt>
<Path>%commander_path%/plugins/wcx/lzma/lzma.wcx</Path>
<Flags>1</Flags>
</WcxPlugin>
<WcxPlugin Enabled="True">
<ArchiveExt>cpio</ArchiveExt>
<Path>%commander_path%/plugins/wcx/cpio/cpio.wcx</Path>
<Flags>0</Flags>
</WcxPlugin>
<WcxPlugin Enabled="True">
<ArchiveExt>deb</ArchiveExt>
<Path>%commander_path%/plugins/wcx/deb/deb.wcx</Path>
<Flags>4</Flags>
</WcxPlugin>
<WcxPlugin Enabled="True">
<ArchiveExt>rpm</ArchiveExt>
<Path>%commander_path%/plugins/wcx/rpm/rpm.wcx</Path>
<Flags>4</Flags>
</WcxPlugin>
<WcxPlugin Enabled="True">
<ArchiveExt>rar</ArchiveExt>
<Path>%commander_path%/plugins/wcx/unrar/unrar.wcx</Path>
<Flags>4</Flags>
</WcxPlugin>
</WcxPlugins>
<WdxPlugins>
<WdxPlugin>
<Name>rpm_wdx</Name>
<Path>%commander_path%/plugins/wdx/rpm_wdx/rpm_wdx.wdx</Path>
<DetectString>EXT="RPM"</DetectString>
</WdxPlugin>
<WdxPlugin>
<Name>deb_wdx</Name>
<Path>%commander_path%/plugins/wdx/deb_wdx/deb_wdx.wdx</Path>
<DetectString>EXT="DEB"</DetectString>
</WdxPlugin>
</WdxPlugins>
<WfxPlugins>
<WfxPlugin Enabled="True">
<Name>FTP</Name>
<Path>%commander_path%/plugins/wfx/ftp/ftp.wfx</Path>
</WfxPlugin>
</WfxPlugins>
<WlxPlugins/>
</Plugins>
</doublecmd>

70
install/darwin/install.sh Executable file
View file

@ -0,0 +1,70 @@
#!/bin/bash
# Set processor architecture
if [ -z $CPU_TARGET ]; then
export CPU_TARGET=$(fpc -iTP)
fi
export DC_APP_DIR=$1/doublecmd.app
export DC_INSTALL_DIR=$DC_APP_DIR/Contents/MacOS
mkdir -p $DC_INSTALL_DIR
mkdir -p $DC_INSTALL_DIR/plugins
# WCX plugins directories
mkdir -p $DC_INSTALL_DIR/plugins/wcx
mkdir -p $DC_INSTALL_DIR/plugins/wcx/cpio
mkdir -p $DC_INSTALL_DIR/plugins/wcx/deb
mkdir -p $DC_INSTALL_DIR/plugins/wcx/lzma
mkdir -p $DC_INSTALL_DIR/plugins/wcx/rpm
mkdir -p $DC_INSTALL_DIR/plugins/wcx/unrar
# WDX plugins directories
mkdir -p $DC_INSTALL_DIR/plugins/wdx
mkdir -p $DC_INSTALL_DIR/plugins/wdx/scripts
mkdir -p $DC_INSTALL_DIR/plugins/wdx/rpm_wdx
mkdir -p $DC_INSTALL_DIR/plugins/wdx/deb_wdx
# WFX plugins directories
mkdir -p $DC_INSTALL_DIR/plugins/wfx
mkdir -p $DC_INSTALL_DIR/plugins/wfx/ftp
mkdir -p $DC_INSTALL_DIR/plugins/wfx/samba
# Copy files
cp -r doublecmd.app/* $DC_APP_DIR/
cp -a doublecmd $DC_INSTALL_DIR/
cp -a install/darwin/doublecmd.xml $DC_INSTALL_DIR/
cp -a doublecmd.ext.example $DC_INSTALL_DIR/
cp -a editor.col $DC_INSTALL_DIR/
cp -a twilight.col $DC_INSTALL_DIR/
cp -a pixmaps.txt $DC_INSTALL_DIR/
cp -a default.bar $DC_INSTALL_DIR/
cp -a multiarc.ini $DC_INSTALL_DIR/
# Copy plugins
# WCX
install -m 644 plugins/wcx/cpio/lib/cpio.wcx $DC_INSTALL_DIR/plugins/wcx/cpio/
install -m 644 plugins/wcx/deb/lib/deb.wcx $DC_INSTALL_DIR/plugins/wcx/deb/
install -m 644 plugins/wcx/lzma/lib/lzma.wcx $DC_INSTALL_DIR/plugins/wcx/lzma/
install -m 644 plugins/wcx/rpm/lib/rpm.wcx $DC_INSTALL_DIR/plugins/wcx/rpm/
install -m 644 plugins/wcx/unrar/lib/unrar.wcx $DC_INSTALL_DIR/plugins/wcx/unrar/
# WDX
install -m 644 plugins/wdx/rpm_wdx/lib/rpm_wdx.wdx $DC_INSTALL_DIR/plugins/wdx/rpm_wdx/
install -m 644 plugins/wdx/deb_wdx/lib/deb_wdx.wdx $DC_INSTALL_DIR/plugins/wdx/deb_wdx/
install -m 644 plugins/wdx/scripts/* $DC_INSTALL_DIR/plugins/wdx/scripts/
# WFX
install -m 644 plugins/wfx/ftp/lib/ftp.wfx $DC_INSTALL_DIR/plugins/wfx/ftp/
install -m 644 plugins/wfx/samba/lib/samba.wfx $DC_INSTALL_DIR/plugins/wfx/samba/
# Copy documentation
mkdir -p $DC_INSTALL_DIR/doc
cp -r doc/en $DC_INSTALL_DIR/doc/
cp -a doc/*.txt $DC_INSTALL_DIR/doc/
# Copy directories
cp -r language $DC_INSTALL_DIR/
cp -r pixmaps $DC_INSTALL_DIR/
# Copy libraries
cp -a *.dylib $DC_INSTALL_DIR/