update readme (#21797)
[mono-project.git] / scripts / mono-package-runtime
blob8597874faa695a174bebae3ca3d276b703fd6262
1 #!/bin/bash
2 extension="${LIBEXT:-.dylib}"
3 if [ "`uname -s`" == "Linux" ]; then
4 extension="${LIBEXT:-.so}"
5 fi
7 if [ "x$2" == "x" ]; then
8 echo usage is: mono-package-runtime MONO_INSTALL_PREFIX LABEL
9 echo The file will be created in the current directory
10 exit 1
13 prefix=$1
14 output=$2
15 if [ ! -d "$prefix" ]; then
16 echo the specified path is not a directory: $prefix
17 exit 1
20 if [ -e "$output.zip" ]; then
21 echo The output file already exists, refusing to overwrite: $output.zip
22 exit 1
25 if [ ! -e "$prefix/bin/mono" ]; then
26 echo The $prefix does not contains a bin/mono
27 exit 1
30 if [ ! -d "$prefix/lib/mono/4.5" ]; then
31 echo The $prefix does not contains a lib/mono/4.5
32 exit 1
35 o=`pwd`/$output
37 cd $prefix
38 (zip -u $o.zip bin/mono lib/mono/4.5/mscorlib.dll lib/mono/4.5/System*dll lib/mono/4.5/Mono.CSharp.dll lib/mono/4.5/Microsoft*dll lib/mono/4.5/FSharp*.dll lib/mono/4.5/I18N*dll lib/mono/4.5/Accessibility.dll lib/mono/4.5/RabbitMQ.Client.dll lib/mono/4.5/ICSharpCode.SharpZipLib.dll lib/mono/4.5/CustomMarshalers.dll etc/mono/4.5/machine.config etc/mono/4.5/web.config lib/mono/4.5/Mono.Cairo.dll lib/mono/4.5/Mono.Data.Sqlite.dll lib/mono/4.5/Mono.Posix.dll lib/mono/4.5/Mono.Security.*dll lib/mono/4.5/Mono.Simd.dll lib/mono/4.5/Mono.WebBrowser.dll lib/mono/4.5/Novell.Directory.Ldap.dll lib/libMonoSupportW$extension lib/libMonoPosixHelper$extension lib/libmono-btls-shared$extension lib/libmono-native$extension lib/libmono-native-compat$extension)
39 echo Created file $o.zip
40 tmpdir=`mktemp -d`
41 mkdir -p $tmpdir/etc/mono
42 sed 's#\$mono_libdir/##' etc/mono/config > $tmpdir/etc/mono/config
43 cd $tmpdir
44 zip -u $o.zip etc/mono/config
45 rm -r $tmpdir