forked from martin-pe/maitreya8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_mac_release.sh
executable file
·126 lines (99 loc) · 2.27 KB
/
create_mac_release.sh
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
version=`grep AC_INIT configure.ac | sed "s/.*, //g;s/)//g"`
dmgfile="maitreya8-${version}.dmg"
appname=Maitreya8.app
basedir="maitreya8-mac-${version}"
appdir="${basedir}/${appname}"
contentsdir="${appdir}/Contents"
macosdir="${contentsdir}/MacOS"
resourcesdir="${contentsdir}/Resources"
copy_resources()
{
rname=$1
# echo "copy resources of type $rname ..."
if [[ ! -d src/resources/${rname} ]]
then
echo "FATAL: directory src/resources/${rname} does not exist"
exit 1
fi
mkdir -p $resourcesdir/$rname
cp -r src/resources/${rname}/*.json $resourcesdir/${rname}
}
create_dmg()
{
echo "Creating disk image ${dmgfile}"
rm -f ${dmgfile}
hdiutil create -srcfolder ${basedir} ${dmgfile}
echo "Done"
}
cleanup()
{
echo "Cleaning directory $basedir"
rm -fr $basedir
echo "Done"
}
create_targetdir()
{
echo "Preparing Mac release in directory $appdir ..."
mkdir -p ${macosdir}
mkdir -p ${resourcesdir}
cp src/gui/maitreya8.bin $macosdir/Maitreya8
cp MacOS/Info.plist $contentsdir
cp MacOS/PkgInfo $contentsdir
cp MacOS/readme_macos.txt $basedir
echo -n "Languages: "
for l in `cat po/LINGUAS`
do
echo -n " $l"
mkdir -p $resourcesdir/$l
cp po/$l.gmo $resourcesdir/$l/maitreya8.mo
done
echo " done."
echo "Pictures ..."
mkdir -p $resourcesdir/pics
cp src/pics/*.jpg $resourcesdir/pics
cp src/pics/*.png $resourcesdir/pics
cp src/pics/*.icns $resourcesdir
mkdir -p $resourcesdir/fonts
cp -r src/fonts/Saravali.ttf $resourcesdir/fonts
cd $basedir
ln -fs Maitreya8.app/Contents/Resources/fonts/Saravali.ttf
cd -
cp COPYING $resourcesdir
cd $basedir
if test ! -L COPYING
then
ln -s ${appname}/Contents/Resources/COPYING
fi
cd -
echo "Locations ..."
mkdir -p $resourcesdir/atlas
cp src/atlas/geonames1000.sql $resourcesdir/atlas
echo "resource files ..."
cp -r src/resources/*.json $resourcesdir
copy_resources "dasas"
copy_resources "yogas"
copy_resources "wchart"
copy_resources "vchart"
copy_resources "print"
copy_resources "mview"
if test -L ${appname}
then
rm ${appname}
fi
ln -s ${appdir}
echo "Done"
}
echo "Start $1"
echo "Version is \"$version\" dmg is ${dmgfile}"
echo "Appdir is $appdir"
if [[ $1 == "clean" ]]
then
cleanup
elif [[ $1 == "dmg" ]]
then
create_targetdir
create_dmg
else
create_targetdir
fi