File: create_packages.mac

package info (click to toggle)
doublecmd 1.1.30-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,968 kB
  • sloc: pascal: 374,335; sh: 1,180; ansic: 724; makefile: 132; python: 52; xml: 16
file content (90 lines) | stat: -rwxr-xr-x 2,599 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh

# 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)

# Read version number
DC_MAJOR=$(grep 'MajorVersionNr' ../src/doublecmd.lpi | grep -o '[0-9.]\+')
DC_MINOR=$(grep 'MinorVersionNr' ../src/doublecmd.lpi | grep -o '[0-9.]\+' || echo 0)
DC_MICRO=$(grep 'RevisionNr' ../src/doublecmd.lpi | grep -o '[0-9.]\+' || echo 0)
DC_VER=$DC_MAJOR.$DC_MINOR.$DC_MICRO

# Create temp dir for building
BUILD_DC_TMP_DIR=/var/tmp/doublecmd-$DC_VER

# Export from Git
rm -rf $BUILD_DC_TMP_DIR
mkdir $BUILD_DC_TMP_DIR
git -C ../ checkout-index -a -f --prefix=$BUILD_DC_TMP_DIR/

# Save revision number
DC_REVISION=$(linux/update-revision.sh ../ $BUILD_DC_TMP_DIR)

# Set processor architecture
if [ -z $CPU_TARGET ]; then
  export CPU_TARGET=$(fpc -iTP)
fi

export CPU_TARGET=`echo $CPU_TARGET|tr '[:upper:]' '[:lower:]'`

# Set widgetset
if [ -z $lcl ]; then
  export lcl=cocoa
fi

# Set minimal Mac OS X target version
if [ -z $MACOSX_DEPLOYMENT_TARGET ]; then
  if [ $CPU_TARGET = "aarch64" ]; then
    export MACOSX_DEPLOYMENT_TARGET=11.0
  else
    export MACOSX_DEPLOYMENT_TARGET=10.11
  fi
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 release

# Update application bundle version
defaults write $(pwd)/doublecmd.app/Contents/Info CFBundleVersion $DC_REVISION
defaults write $(pwd)/doublecmd.app/Contents/Info CFBundleShortVersionString $DC_VER
plutil -convert xml1 $(pwd)/doublecmd.app/Contents/Info.plist
chmod 644 $(pwd)/doublecmd.app/Contents/Info.plist

# Create *.dmg package
mkdir -p $BUILD_PACK_DIR
install/darwin/install.sh $BUILD_PACK_DIR
pushd $BUILD_PACK_DIR
if [ "$lcl" = "qt" ]; then
  macdeployqt doublecmd.app
fi
mv doublecmd.app 'Double Commander.app'
codesign --deep --force --verify --verbose --sign '-' 'Double Commander.app'
popd

install/darwin/create-dmg/create-dmg \
  --volname "Double Commander" \
  --volicon "$BUILD_PACK_DIR/.VolumeIcon.icns" \
  --background "$BUILD_PACK_DIR/.background/bg.jpg" \
  --window-pos 200 200 \
  --window-size 680 366 \
  --text-size 16 \
  --icon-size 128 \
  --icon "Double Commander.app" 110 120 \
  --app-drop-link 360 120 \
  --icon "install.txt" 566 123 \
  --icon ".background" 100 500 \
  "$PACK_DIR/doublecmd-$DC_VER-$DC_REVISION.$lcl.$CPU_TARGET.dmg" \
  "$BUILD_PACK_DIR/"

# Clean DC build dir
rm -rf $BUILD_DC_TMP_DIR
rm -rf $BUILD_PACK_DIR