102 lines
2.6 KiB
Modula-2
102 lines
2.6 KiB
Modula-2
BootStrap: docker
|
|
From: ubuntu:22.04
|
|
|
|
%arguments
|
|
NUM_THREADS=1
|
|
WS_VER=3.4.0
|
|
MI_COMMIT=40bab1d
|
|
|
|
%files
|
|
00-cpp_compat.patch /build/00-cpp_compat.patch
|
|
01-radio_bearer_config.patch /build/01-radio_bearer_config.patch
|
|
|
|
%post
|
|
# Update and install dependencies
|
|
mkdir -p /build
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
apt-get update
|
|
apt-get upgrade -y
|
|
apt-get install -y \
|
|
git \
|
|
python3 \
|
|
python3-pip \
|
|
python3-venv \
|
|
python3-wxgtk4.0 \
|
|
python3-matplotlib \
|
|
cmake \
|
|
pkg-config \
|
|
wget \
|
|
libglib2.0-dev \
|
|
bison \
|
|
flex \
|
|
libpcap-dev \
|
|
libgcrypt-dev \
|
|
qtbase5-dev \
|
|
qtchooser \
|
|
qt5-qmake \
|
|
qtbase5-dev-tools \
|
|
qttools5-dev \
|
|
qtmultimedia5-dev \
|
|
libqt5svg5-dev \
|
|
libc-ares-dev \
|
|
libsdl2-mixer-2.0-0 \
|
|
libsdl2-image-2.0-0 \
|
|
libsdl2-2.0-0
|
|
pip3 install pyserial
|
|
|
|
# Download resources
|
|
cd /build
|
|
wget "https://github.com/wireshark/wireshark/archive/refs/tags/v{{ WS_VER }}.tar.gz" \
|
|
-nv -O "wireshark-{{ WS_VER }}.tar.xz"
|
|
tar -xf "wireshark-{{ WS_VER }}.tar.xz"
|
|
git clone "https://github.com/xythrez/mobileinsight-core.git"
|
|
git -C mobileinsight-core checkout "{{ MI_COMMIT }}"
|
|
|
|
# Compile and install wireshark
|
|
cd "/build/wireshark-{{ WS_VER }}"
|
|
for patch in /build/*.patch; do
|
|
patch -p1 < "$patch"
|
|
done
|
|
cmake -DBUILD_wireshark=OFF .
|
|
make -j "{{ NUM_THREADS }}"
|
|
make install
|
|
ldconfig
|
|
|
|
# Compile and install Wireshark dissector
|
|
cd /build/mobileinsight-core/ws_dissector
|
|
g++ ws_dissector.cpp packet-aww.cpp -o ws_dissector \
|
|
$(pkg-config --libs --cflags glib-2.0) \
|
|
-I"/build/wireshark-{{ WS_VER }}" \
|
|
-L"/usr/local/lib" \
|
|
-lwireshark \
|
|
-lwsutil \
|
|
-lwiretap
|
|
strip ws_dissector
|
|
install -Dm 755 ws_dissector /usr/local/bin/ws_dissector
|
|
|
|
# Compile and install MobileInsight
|
|
cd /build/mobileinsight-core
|
|
python3 setup.py install
|
|
mkdir -p /usr/local/share/mobileinsight
|
|
cp -r gui/* /usr/local/share/mobileinsight
|
|
ln -s /usr/local/share/mobileinsight/mi-gui /usr/local/bin/mi-gui
|
|
cp -r examples /opt/mobileinsight-examples
|
|
|
|
# Link python3 to python
|
|
cd /usr/bin
|
|
ln -s python3 python
|
|
|
|
# Cleanup
|
|
apt-get autoclean -y
|
|
rm -rf /build
|
|
|
|
%runscript
|
|
set -e
|
|
echo "Welcome to MobileInsight Apptainer!"
|
|
if [ $# -eq 0 ]; then
|
|
exec /bin/bash
|
|
else
|
|
"$@"
|
|
fi
|
|
|