Skip to content

Commit

Permalink
add models-ng (C++ modules), Rocky8 Dockerfile and update rpms.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
cejkato2 committed Aug 12, 2024
1 parent 195c6f8 commit 981ba15
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
[submodule "detectors"]
path = detectors
url = https://github.com/CESNET/Nemea-Detectors
[submodule "modules-ng"]
path = modules-ng
url = https://github.com/CESNET/nemea-modules-ng
20 changes: 20 additions & 0 deletions docker/rocky8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM rockylinux:8-minimal
RUN microdnf install dnf
RUN dnf -y install epel-release
RUN curl -s 'https://copr.fedorainfracloud.org/coprs/g/CESNET/NEMEA/repo/epel-8/group_CESNET-NEMEA-epel-8.repo' > /etc/yum.repos.d/group_CESNET-NEMEA-epel-8.repo
#RUN dnf -y update
RUN dnf -y --enablerepo=devel --enablerepo=powertools install epel-rpm-macros \
python3-rpm-macros python-rpm-macros python-srpm-macros rpm-build git which \
doxygen bison flex libcurl-devel lua-devel bzip2-devel libpcap-devel \
openssl-devel libxml2-devel libidn-devel make automake autoconf \
pkgconfig gcc gcc-c++ libtool cmake \
python3-devel python3-setuptools python3-pip python3-wheel \
python38 python38-devel python38-pip python38-wheel python38-setuptools \
python39 python39-devel python39-pip python39-wheel python39-setuptools \
python3-jinja2 python3-ply python3-pynspect python3-yaml

# python3-nemea-pytrap
RUN dnf clean all

CMD ["/bin/bash"]

1 change: 1 addition & 0 deletions modules-ng
Submodule modules-ng added at 9d81cf
44 changes: 30 additions & 14 deletions rpms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@

#set -x

if [ "$#" -eq 1 ]; then
chuser="$1"
else
echo "For non-interactive mode run with username as argument, e.g.:"
echo " $0 builder"
echo "where builder is a non-root user for building RPMs."
fi

if [ -x "`which dnf`" ]; then
export pkginst=dnf
elif [ -x "`which yum`" ]; then
Expand All @@ -45,23 +53,28 @@ else
exit 1
fi

echo "Warning: You must have 'rpmbuild' in order to generate RPM package."
echo "If you want to abort this script, press CTRL+C (i.e. send SIGINT signal)"
sleep 5
if [ -z "$chuser" ]; then
echo "Warning: You must have 'rpmbuild' in order to generate RPM package."
echo "If you want to abort this script, press CTRL+C (i.e. send SIGINT signal)"
sleep 5

if [ "x`whoami`" != xroot ]; then
echo "Run this script as root, since it must install RPM packages continuously"
exit 1
fi
if [ "x`whoami`" != xroot ]; then
echo "Run this script as root, since it must install RPM packages continuously"
exit 1
fi

read -p "Enter the name of user who will compile packages: " chuser
read -p "Enter the name of user who will compile packages: " chuser

read -p "Are You sure You want to continue? [yn]" -n1 ans
read -p "Are You sure You want to continue? [yn]" -n1 ans

if [ "x$ans" != xy ]; then
exit 0
if [ "x$ans" != xy ]; then
exit 0
fi
fi

./bootstrap.sh
./configure -q

echo "Remove previously installed packages"
$pkginst remove -q -y libtrap\* unirec\* nemea\*
$pkginst install -q -y libnf-devel libpcap-devel libidn-devel bison flex
Expand All @@ -88,9 +101,12 @@ export chuser
)
su $chuser -p -c "./bootstrap.sh >/dev/null 2>/dev/null&& ./configure -q"
(
cd python
su $chuser -p -c "make && make rpm"
$pkginst install -y -q $(find \( -name '*noarch.rpm' -o -name '*64.rpm' \))
cd pytrap
su $chuser -p -c "make rpm"
$pkginst install -y -q $(find \( -name '*.rpm' -o -name '*64.rpm' \))
su $chuser -p -c "python3.6 setup.py bdist_wheel"
su $chuser -p -c "python3.8 setup.py bdist_wheel"
su $chuser -p -c "python3.9 setup.py bdist_wheel"
)
(
cd pycommon
Expand Down

0 comments on commit 981ba15

Please sign in to comment.