File tree Expand file tree Collapse file tree 3 files changed +5
-23
lines changed
Expand file tree Collapse file tree 3 files changed +5
-23
lines changed Original file line number Diff line number Diff line change 22apk update
33apk add \
44 bash \
5+ build-base \
56 git \
67 perl \
78 make \
@@ -28,4 +29,4 @@ apk add \
2829 curl \
2930 rsync \
3031 util-linux \
31- patch
32+ patch
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ GIT_LIBPCAP="https://github.com/the-tcpdump-group/libpcap.git"
77
88BUILD_DIRECTORY=" /build"
99OUTPUT_DIRECTORY=" /output"
10- GCC_OPTS=" -static -fPIC"
10+ GCC_OPTS=" -static -static-libgcc - fPIC"
1111GXX_OPTS=" -static -static-libstdc++ -fPIC"
1212TMP_DIR=$( mktemp -dt building_lib.XXXXXX)
1313trap " rm -rf ${TMP_DIR} " EXIT TERM
@@ -174,25 +174,6 @@ get_version(){
174174 echo " $version "
175175}
176176
177- get_version_simple (){
178- local cmd=" $1 "
179- if [ -z " $cmd " ]; then
180- echo " Please provide a command to determine the version" >&2
181- echo " Example: /build/test --version | awk '{print \$ 2}'" >&2
182- exit 1
183- fi
184-
185- local version=" -"
186- version+=$( eval " $cmd " )
187-
188- if [ " $version " == " -" ]; then
189- version+=" ${CURRENT_ARCH} "
190- else
191- version+=" -${CURRENT_ARCH} "
192- fi
193- echo " $version "
194- }
195-
196177lib_create_tmp_dir (){
197178 local tmp_dir=$( mktemp -dt -p ${TMP_DIR} tmpdir.XXXXXX)
198179 echo " $tmp_dir "
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ build_tcpdump() {
2222 # need to create configure when using newer tags
2323 ./autogen.sh
2424 export LIBPCAP_PATH=" ${BUILD_DIRECTORY} /libpcap"
25- CFLAGS=" ${GCC_OPTS} -I${LIBPCAP_PATH} -L${LIBPCAP_PATH} " \
25+ CFLAGS=" ${GCC_OPTS} -I. -I ${LIBPCAP_PATH} -L${LIBPCAP_PATH} " \
2626 CXXFLAGS=" ${GXX_OPTS} " \
2727 CPPFLAGS=" -static" \
2828 LDFLAGS=" -static" \
@@ -36,7 +36,7 @@ main() {
3636 lib_build_libpcap
3737 build_tcpdump
3838 local version
39- version=$( get_version_simple " cat ${BUILD_DIRECTORY} /tcpdump/VERSION " )
39+ version=$( get_version " ${BUILD_DIRECTORY} /tcpdump/tcpdump --version 2>&1 | head -n1 | awk '{print \$ 3}' " )
4040 echo " Got version: ${version} "
4141 version_number=$( echo " $version " | cut -d" -" -f2)
4242 cp " ${BUILD_DIRECTORY} /tcpdump/tcpdump" " ${OUTPUT_DIRECTORY} /tcpdump${version} "
You can’t perform that action at this time.
0 commit comments