File: run

package info (click to toggle)
libreoffice 1:6.1.5-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,699,584 kB
  • sloc: cpp: 4,078,558; xml: 324,485; java: 281,935; python: 48,236; ansic: 36,476; perl: 32,383; sh: 13,671; yacc: 10,820; makefile: 9,085; cs: 6,600; lex: 2,184; objc: 1,904; awk: 978; pascal: 949; asm: 866; php: 79; csh: 20; sed: 5
file content (102 lines) | stat: -rwxr-xr-x 3,205 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

# simple wrapper script to run non-installed executables from workdir

if uname | grep -i CYGWIN >/dev/null; then

    dir=$(realpath "$(pwd)")

    while test ! -d "${dir}/instdir/program" ; do
        if test "${dir}" = "/"; then
            echo "error: cannot find \"program\" dir from \"$(pwd)\""
            exit 1
        fi
        dir=$(realpath "${dir}/..")
    done

    exedir=$(cygpath -m "${dir}"/workdir/LinkTarget/Executable)
    export URE_BOOTSTRAP=file:///$(cygpath -m "${dir}")/instdir/program/fundamental.ini
    export PATH=${PATH:+$PATH:}"${dir}"/instdir/program

#    echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
#    echo "setting search path to: ${PATH}"
#    echo "execing: ${exedir}/$1"

    exec ${LO_TRACE} "${exedir}/$@"

elif [ $(uname) = Darwin ]; then

    dir=$(pwd)

    # Get PRODUCTNAME from config_host.mk, LibreOffice or LibreOfficeDev
    eval `grep 'export PRODUCTNAME=' config_host.mk`

    if [ ! -d "${dir}/instdir/$PRODUCTNAME.app" ]; then
        echo "error: cannot find \"instdir/$PRODUCTNAME.app\" dir in \"$(pwd)\""
        exit 1
    fi

    exedir="${dir}"/workdir/LinkTarget/Executable
    export URE_BOOTSTRAP=file://"${dir}"/instdir/$PRODUCTNAME.app/Contents/Resources/fundamentalrc
    export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+$DYLD_LIBRARY_PATH:}"${dir}"/instdir/$PRODUCTNAME.app/Contents/Frameworks

#    echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
#    echo "setting search path to: ${DYLD_LIBRARY_PATH}"
#    echo "execing: ${exedir}/$1"

    exec ${LO_TRACE} "${exedir}/$@"

elif [ $(uname) = Haiku ]; then

    dir=$(readlink -f "$(pwd)")

    while test ! -d "${dir}/instdir/program" ; do
        if test "${dir}" = "/"; then
            echo "error: cannot find \"program\" dir from \"$(pwd)\""
            exit 1
        fi
        dir=$(readlink -f "${dir}/..")
    done

    exedir="${dir}"/workdir/LinkTarget/Executable
    export URE_BOOTSTRAP=file://"${dir}"/instdir/program/fundamentalrc
    export LIBRARY_PATH=${LIBRARY_PATH:+$LIBRARY_PATH:}"${dir}"/instdir/program

#    echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
#    echo "setting search path to: ${LIBRARY_PATH}"
#    echo "execing: ${exedir}/$1"

    exec ${LO_TRACE} "${exedir}/$@"

else

    dir=$(readlink -f "$(pwd)")

    while test ! -d "${dir}/instdir/program" ; do
        if test "${dir}" = "/"; then
            echo "error: cannot find \"program\" dir from \"$(pwd)\""
            exit 1
        fi
        dir=$(readlink -f "${dir}/..")
    done

    exedir="${dir}"/workdir/LinkTarget/Executable
    export URE_BOOTSTRAP=file://"${dir}"/instdir/program/fundamentalrc
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"${dir}"/instdir/program

#    echo "setting URE_BOOTSTRAP to: ${URE_BOOTSTRAP}"
#    echo "setting search path to: ${LD_LIBRARY_PATH}"
#    echo "execing: ${exedir}/$1"

    exec ${LO_TRACE} "${exedir}/$@"

fi

# vi:set shiftwidth=4 expandtab: