-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): update workflow to package Snort 3 with dependencies into …
…a single .deb file
- Loading branch information
Showing
2 changed files
with
34 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,11 @@ sudo mv ~/go/bin/protoc-gen-go-grpc /usr/local/bin/ | |
|
||
# Create working directories | ||
WORK_DIR=/work | ||
PACKAGE_DIR=~/snort_package | ||
DEBIAN_DIR=$PACKAGE_DIR/DEBIAN | ||
sudo mkdir -p $WORK_DIR | ||
mkdir -p $PACKAGE_DIR | ||
mkdir -p $DEBIAN_DIR | ||
sudo chmod 777 $WORK_DIR | ||
|
||
# Install libdaq | ||
|
@@ -54,7 +58,7 @@ tar -xvf v${LIBDAQ_VERSION}.tar.gz | |
cd libdaq-${LIBDAQ_VERSION} | ||
./bootstrap && ./configure && make | ||
sudo checkinstall --pkgname=libdaq --pkgversion=${LIBDAQ_VERSION} --backup=no --deldoc=yes --fstrans=no --default | ||
sudo mv libdaq_${LIBDAQ_VERSION}-1_amd64.deb $WORK_DIR | ||
sudo mv libdaq_${LIBDAQ_VERSION}-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf v${LIBDAQ_VERSION}.tar.gz | ||
|
||
|
@@ -64,7 +68,7 @@ tar -xvf libdnet-${LIBDNET_VERSION}.tar.gz | |
cd libdnet-libdnet-${LIBDNET_VERSION} | ||
./configure && make | ||
sudo checkinstall --pkgname=libdnet --pkgversion=${LIBDNET_VERSION} --backup=no --deldoc=yes --fstrans=no --default | ||
sudo mv libdnet_${LIBDNET_VERSION}-1_amd64.deb $WORK_DIR | ||
sudo mv libdnet_${LIBDNET_VERSION}-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf libdnet-${LIBDNET_VERSION} libdnet-${LIBDNET_VERSION}.tar.gz | ||
|
||
|
@@ -74,7 +78,7 @@ tar -xvf flex-${FLEX_VERSION}.tar.gz | |
cd flex-${FLEX_VERSION} | ||
./configure && make | ||
sudo checkinstall --pkgname=flex --pkgversion=${FLEX_VERSION} --backup=no --deldoc=yes --fstrans=no --default | ||
sudo mv flex_${FLEX_VERSION}-1_amd64.deb $WORK_DIR | ||
sudo mv flex_${FLEX_VERSION}-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf flex-${FLEX_VERSION} flex-${FLEX_VERSION}.tar.gz | ||
|
||
|
@@ -84,7 +88,7 @@ tar -xvf hwloc-${HWLOC_VERSION}.tar.gz | |
cd hwloc-${HWLOC_VERSION} | ||
./configure && make | ||
sudo checkinstall --pkgname=hwloc --pkgversion=${HWLOC_VERSION} --backup=no --deldoc=yes --fstrans=no --default | ||
sudo mv hwloc_${HWLOC_VERSION}-1_amd64.deb $WORK_DIR | ||
sudo mv hwloc_${HWLOC_VERSION}-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf hwloc-${HWLOC_VERSION} hwloc-${HWLOC_VERSION}.tar.gz | ||
|
||
|
@@ -94,7 +98,7 @@ git clone https://luajit.org/git/luajit.git | |
cd luajit | ||
make | ||
sudo checkinstall --pkgname=luajit --pkgversion=2.1.0 --backup=no --deldoc=yes --fstrans=no --default | ||
sudo mv luajit_2.1.0-1_amd64.deb $WORK_DIR | ||
sudo mv luajit_2.1.0-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf luajit | ||
|
||
|
@@ -104,7 +108,7 @@ tar -xvf pcre-${PCRE_VERSION}.tar.gz | |
cd pcre-${PCRE_VERSION} | ||
./configure && make | ||
sudo checkinstall --pkgname=pcre --pkgversion=${PCRE_VERSION} --backup=no --deldoc=yes --fstrans=no --default | ||
sudo mv pcre_${PCRE_VERSION}-1_amd64.deb $WORK_DIR | ||
sudo mv pcre_${PCRE_VERSION}-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf pcre-${PCRE_VERSION} pcre-${PCRE_VERSION}.tar.gz | ||
|
||
|
@@ -114,7 +118,7 @@ tar -xvf zlib-${ZLIB_VERSION}.tar.gz | |
cd zlib-${ZLIB_VERSION} | ||
./configure && make | ||
sudo checkinstall --pkgname=zlib --pkgversion=${ZLIB_VERSION} --backup=no --deldoc=yes --fstrans=no --default | ||
sudo mv zlib_${ZLIB_VERSION}-1_amd64.deb $WORK_DIR | ||
sudo mv zlib_${ZLIB_VERSION}-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf zlib-${ZLIB_VERSION} zlib-${ZLIB_VERSION}.tar.gz | ||
|
||
|
@@ -127,9 +131,27 @@ export my_path=/usr/local | |
cd build | ||
make -j$(nproc) | ||
sudo checkinstall --pkgname=snort3 --pkgversion=${SNORT_VER} --backup=no --deldoc=yes --fstrans=no --default | ||
|
||
|
||
sudo mv snort3_${SNORT_VER}-1_amd64.deb $PACKAGE_DIR | ||
cd $WORK_DIR | ||
rm -rf snort3-${SNORT_VER} ${SNORT_VER}.tar.gz | ||
|
||
echo "Snort 3 installation and packaging is complete." | ||
# Create control file | ||
cat <<EOF > $DEBIAN_DIR/control | ||
Package: snort-package | ||
Version: 1.0 | ||
Section: base | ||
Priority: optional | ||
Architecture: all | ||
Depends: libdaq (>= ${LIBDAQ_VERSION}), libdnet (>= ${LIBDNET_VERSION}), flex (>= ${FLEX_VERSION}), hwloc (>= ${HWLOC_VERSION}), pcre (>= ${PCRE_VERSION}), zlib (>= ${ZLIB_VERSION}) | ||
Maintainer: Dylane Bengono <[email protected]> | ||
Description: Snort package with dependencies | ||
This package includes Snort and its required dependencies. | ||
EOF | ||
|
||
# Build the final package | ||
dpkg-deb --build $PACKAGE_DIR | ||
|
||
# Clean up | ||
rm -rf $PACKAGE_DIR | ||
|
||
echo "Snort package with dependencies is created successfully." |