-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-fluentd.sh
executable file
·87 lines (69 loc) · 2.3 KB
/
build-fluentd.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
#!/usr/bin/env bash
#set -x
umask 022
PKGSRC_BASE=/app
PREFIX=/app/elastic/dists/fluentd
CVS_BRANCH="HEAD"
#PKGSRC_URL="https://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz"
#PKGSRC_URL="ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.gz"
#PKGSRC_URL="ftp://ftp.netbsd.org/pub/pkgsrc/stable/pkgsrc.tar.gz"
PKGSRC_MODULES=""
RUBY_MODULES=""
CLEAN_MODULES=""
export PKGSRC_BASE
export PREFIX
. ruby.sh
exit
# instalace pkgsrc modulu
for module in $PKGSRC_MODULES
do
_module=`echo $module | sed 's/.*\/\(.*\)/\1/g' | sed 's/py-/py\[0-9\]\{2\}-/g'`
_nol=`$PREFIX/sbin/pkg_info |perl -nle "print if m/^$_module/" |wc -l`
if [ $_nol -eq 0 ]; then
(cd ${PKGSRC_BASE}/pkgsrc/$module && bmake install clean clean-depends) || exit 1
fi
done
#if [ ! -f "${PREFIX}/conf/openssl/certs/ca-certificates.crt" ]; then
# bash ${PREFIX}/sbin/mozilla-rootcerts install || exit 1
#fi
# odchytnout verzi Glances
VERSION=`$PREFIX/bin/pip3.7 search Glances |perl -nle "print if m/^Glances\ \([0-9]/" |${AWK} -F '[()]' '{print $2}'` || exit 1
echo $VERSION
# instalace modulu pres pip
$PREFIX/bin/pip3.7 install $PIP_MODULES || exit 1
# cisteni prefixu
_modules=""
for module in $CLEAN_MODULES
do
_module=`echo $module | sed 's/py-/py\[0-9\]\{2\}-/g'`
_nol=`$PREFIX/sbin/pkg_info |perl -nle "print if m/^$_module-[0-9]/" |wc -l`
# echo $_module : $_nol
if [ $_nol -ne 0 ]; then
_modules="$_modules $_module"
fi
done
if [ "$_modules" != "" ]; then
echo "Deleting modules: $_modules"
$PREFIX/sbin/pkg_delete $_modules || exit 1
fi
rm -rf \
$PREFIX/include/* \
$PREFIX/info/* \
$PREFIX/man/* \
$PREFIX/pkgdb \
$PREFIX/pkgdb.refcount \
$PREFIX/share/doc/* \
$PREFIX/lib/python3.7/bsddb/test \
$PREFIX/lib/python3.7/email/test \
$PREFIX/lib/python3.7/json/tests \
$PREFIX/lib/python3.7/unittest/test \
$PREFIX/lib/python3.7/test \
$PREFIX/lib/python3.7/ctypes/test \
$PREFIX/lib/python3.7/lib2to3/tests \
$PREFIX/lib/python3.7/sqlite3/test \
$PREFIX/lib/python3.7/distutils/tests \
$PREFIX/lib/python3.7/idlelib/idle_test \
$PREFIX/lib/python3.7/lib-tk/test || exit 1
for f in `find ${PREFIX} -type f | perl -nle 'print if m/pyc$|pyo$/'`; do rm -f ${f}; done
# vytvoreni balicku
(cd $PREFIX/.. && ${TAR} czf glances-${VERSION}-`uname -s | tr '[:upper:]' '[:lower:]'`-`uname -p`.tar.gz glances) || exit 1