apt install python-docutils -y
apt install libsystemd-dev
apt install pandoc -y
apt-get install build-essential cmake gcc libudev-dev libnl-3-dev libnl-route-3-dev ninja-build pkg-config valgrind python3-dev cython3
apt install dh-python
wget https://github.com/linux-rdma/rdma-core/releases/download/v27.0/rdma-core-27.0.tar.gz
# Apply patch libirdma-27.0.patch to rdma-core
cd $CUR && tar -xzvf rdma-core-27.0.tar.gz
cd $CUR/rdma-core-27.0 && patch -p2 < $CUR/libirdma-27.0.patch
# Build rdma-core
cd $CUR/rdma-core-27.0 && dh clean --with python3,systemd --builddirectory=build-deb
cd $CUR/rdma-core-27.0 && dh build --with systemd --builddirectory=build-deb
cd $CUR/rdma-core-27.0 && dh binary --with python3,systemd --builddirectory=build-deb
# This creates .deb packages in the parent directory
# To install the .deb packages
dpkg -i ../*.deb