-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·54 lines (51 loc) · 1.29 KB
/
build
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
#!/bin/bash
#
# build - compile and optionally install cbftp
#
usage() {
printf "\nUsage: ./build [-i] [-p prefix] [-u] project [project2 ...]"
printf "\nWhere:"
printf "\n\t-i indicates install"
printf "\n\t-p prefix specifies installation prefix (default ${PREFIX})"
printf "\n\t-u displays this usage message and exits\n"
printf "\nNo arguments: build cpftp, configure with prefix=${PREFIX}, build\n"
exit 1
}
INSTALL=
platform=`uname -s`
if [ "${platform}" == "Darwin" ]
then
PREFIX=/usr/local
export STATIC_SSL_PATH="/usr/local/opt/openssl@3"
export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
else
PREFIX=/usr
fi
while getopts "ip:u" flag; do
case $flag in
i)
INSTALL=1
;;
p)
PREFIX="$OPTARG"
;;
u)
usage
;;
esac
done
shift $(( OPTIND - 1 ))
[ -f bin/cbftp ] || {
[ -f /etc/arch-release ] && {
NCW="src/ui/ncurseswrap.h"
cp ${NCW} /tmp/nc_save$$
cat ${NCW} | sed -e "s%ncursesw/curses.h%ncurses.h%" > /tmp/nc$$
cp /tmp/nc$$ ${NCW}
rm -f /tmp/nc$$
}
make
[ -f /tmp/nc_save$$ ] && cp /tmp/nc_save$$ ${NCW}
}
chmod +x bin/*