Name: network-threat-detect Version: 1.0.0 Release: 1%{?dist} Summary: GNN-based Network Threat Detection System License: MIT URL: https://github.com/example/network-threat-detect Source0: %{name}-%{version}.tar.gz BuildArch: noarch Requires: systemd Requires: (conda or micromamba or miniconda3) %description A production-ready network threat detection system using Graph Neural Networks with ONNX runtime for real-time packet analysis. %prep %setup -q %build # No compilation needed for Python package %install rm -rf %{buildroot} mkdir -p %{buildroot}%{_prefix}/lib/%{name} mkdir -p %{buildroot}%{_sysconfdir}/%{name} mkdir -p %{buildroot}%{_unitdir} cp -r src/* %{buildroot}%{_prefix}/lib/%{name}/ cp environment.yml %{buildroot}%{_prefix}/lib/%{name}/ cp config/config.yaml %{buildroot}%{_sysconfdir}/%{name}/ cp packaging/%{name}.service %{buildroot}%{_unitdir}/ %post if [ $1 -eq 1 ]; then echo "Setting up conda environment for %{name}..." CONDA_CMD="" if command -v conda &> /dev/null; then CONDA_CMD="conda" elif command -v micromamba &> /dev/null; then CONDA_CMD="micromamba" elif [ -f /opt/conda/bin/conda ]; then CONDA_CMD="/opt/conda/bin/conda" elif [ -f "$HOME/miniconda3/bin/conda" ]; then CONDA_CMD="$HOME/miniconda3/bin/conda" fi if [ -n "$CONDA_CMD" ]; then $CONDA_CMD env create -f %{_prefix}/lib/%{name}/environment.yml -p %{_prefix}/lib/%{name}/conda_env --yes 2>&1 | logger -t network-threat-detect-install if [ $? -eq 0 ]; then echo "Conda environment created successfully" systemctl daemon-reload systemctl enable %{name}.service echo "Service enabled. Start with: systemctl start %{name}" else echo "WARNING: Failed to create conda environment" echo "Please run manually: conda env create -f %{_prefix}/lib/%{name}/environment.yml -p %{_prefix}/lib/%{name}/conda_env" fi else echo "WARNING: conda/micromamba not found in PATH" echo "Please install conda and run: conda env create -f %{_prefix}/lib/%{name}/environment.yml -p %{_prefix}/lib/%{name}/conda_env" fi fi %preun if [ $1 -eq 0 ]; then systemctl stop %{name}.service 2>/dev/null || true systemctl disable %{name}.service 2>/dev/null || true fi %postun if [ $1 -eq 0 ]; then rm -rf %{_prefix}/lib/%{name}/conda_env echo "Conda environment removed" fi systemctl daemon-reload %files %{_prefix}/lib/%{name}/ %config(noreplace) %{_sysconfdir}/%{name}/config.yaml %{_unitdir}/%{name}.service %changelog * Tue Feb 17 2026 Network Security Team - 1.0.0-1 - Initial RPM release - GNN-based threat detection with ONNX runtime - Systemd integration for production deployment