forked from getlantern/lantern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copypt.bash
executable file
·35 lines (31 loc) · 1.07 KB
/
copypt.bash
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
#!/usr/bin/env bash
# This script copies the pluggable transports to the resources directory for
# whatever platform we're running on. They can't go into the normal
# src/main/resources directory because maven has filtering turned on by
# default for resources directories, which corrupts binaries. Beyond that,
# we only want to include pluggable transports for the relevant platform
# because we build platform-specific jars.
function die() {
echo $*
exit 1
}
if [ $(uname) == "Darwin" ]
then
ls -la configureNetworkServices | grep rwsr | grep wheel || ./setNetUidOsx.bash
ptdir=osx
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]
then
if [ $(uname -m) == 'x86_64' ]; then
ptdir=linux_x86_64
elif [ $(uname -m) == 'armv6l' ]; then
ptdir=linux_arm
else
ptdir=linux_x86_32
fi
elif [ -n "$COMSPEC" -a -x "$COMSPEC" ]
then
ptdir=win
fi
test -d src/main/pt || mkdir src/main/pt || die "Could not create pt directory?"
echo "Copying from install/$ptdir/pt to src/main/pt/"
cp -R install/$ptdir/pt src/main/pt/ || die "Could not copy pluggable transports?"