Skip to content

Commit 9550106

Browse files
committed
fix missing tcpdump include, add missing build_bsae, revert version hacks
Signed-off-by: Stephen L Arnold <[email protected]>
1 parent 90a68d0 commit 9550106

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

build/install_deps_alpine.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
apk update
33
apk 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

build/lib.sh

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ GIT_LIBPCAP="https://github.com/the-tcpdump-group/libpcap.git"
77

88
BUILD_DIRECTORY="/build"
99
OUTPUT_DIRECTORY="/output"
10-
GCC_OPTS="-static -fPIC"
10+
GCC_OPTS="-static -static-libgcc -fPIC"
1111
GXX_OPTS="-static -static-libstdc++ -fPIC"
1212
TMP_DIR=$(mktemp -dt building_lib.XXXXXX)
1313
trap "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-
196177
lib_create_tmp_dir(){
197178
local tmp_dir=$(mktemp -dt -p ${TMP_DIR} tmpdir.XXXXXX)
198179
echo "$tmp_dir"

build/targets/build_tcpdump.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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}"

0 commit comments

Comments
 (0)