File wazuh-agent.spec of Package wazuh-agent
#
# spec file for package wazuh-agent
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: wazuh-agent
Version: 4.11.0
Release: 0
Summary: The Wazuh agent for endpoints
License: AGPL-3.0
URL: https://github.com/wazuh/wazuh-agent
Source: %{name}-%{version}.tar.gz
#
# RESOURCES_URL := $(RESOURCES_URL_BASE)$(DEPS_VERSION)
# RESOURCES_URL_BASE := https://packages.wazuh.com/deps/
# DEPS_VERSION = 35
# Source2X: https://packages.wazuh.com/deps/35/libraries/sources/
#
# https://github.com/wazuh/wazuh/blob/v4.11.0/src/Makefile#L1442
# cJSON
# curl
# libdb
# libffi
# libyaml
# openssl
# procps
# sqlite
# zlib
# audit-userspace
# msgpack
# bzip2
# nlohmann
# googletest
# libpcre2
# libplist
# pacman
# libarchive
# popt
# lua
# rpm
# rocksdb
# lzma
# cpp-httplib
# benchmark
Source21: https://packages.wazuh.com/deps/35/libraries/sources/cJSON.tar.gz
Source22: https://packages.wazuh.com/deps/35/libraries/sources/curl.tar.gz
Source23: https://packages.wazuh.com/deps/35/libraries/sources/libdb.tar.gz
Source24: https://packages.wazuh.com/deps/35/libraries/sources/libffi.tar.gz
Source25: https://packages.wazuh.com/deps/35/libraries/sources/libyaml.tar.gz
Source26: https://packages.wazuh.com/deps/35/libraries/sources/openssl.tar.gz
Source27: https://packages.wazuh.com/deps/35/libraries/sources/procps.tar.gz
Source28: https://packages.wazuh.com/deps/35/libraries/sources/sqlite.tar.gz
Source29: https://packages.wazuh.com/deps/35/libraries/sources/zlib.tar.gz
Source30: https://packages.wazuh.com/deps/35/libraries/sources/audit-userspace.tar.gz
Source31: https://packages.wazuh.com/deps/35/libraries/sources/msgpack.tar.gz
Source32: https://packages.wazuh.com/deps/35/libraries/sources/bzip2.tar.gz
Source33: https://packages.wazuh.com/deps/35/libraries/sources/nlohmann.tar.gz
Source34: https://packages.wazuh.com/deps/35/libraries/sources/googletest.tar.gz
Source35: https://packages.wazuh.com/deps/35/libraries/sources/libpcre2.tar.gz
Source36: https://packages.wazuh.com/deps/35/libraries/sources/libplist.tar.gz
Source37: https://packages.wazuh.com/deps/35/libraries/sources/pacman.tar.gz
Source38: https://packages.wazuh.com/deps/35/libraries/sources/libarchive.tar.gz
Source39: https://packages.wazuh.com/deps/35/libraries/sources/popt.tar.gz
Source40: https://packages.wazuh.com/deps/35/libraries/sources/lua.tar.gz
Source41: https://packages.wazuh.com/deps/35/libraries/sources/rpm.tar.gz
Source42: https://packages.wazuh.com/deps/35/libraries/sources/rocksdb.tar.gz
Source43: https://packages.wazuh.com/deps/35/libraries/sources/lzma.tar.gz
Source44: https://packages.wazuh.com/deps/35/libraries/sources/cpp-httplib.tar.gz
Source45: https://packages.wazuh.com/deps/35/libraries/sources/benchmark.tar.gz
Source46: https://packages.wazuh.com/deps/35/libraries/sources/cpython.tar.gz
Source51: https://github.com/wazuh/wazuh-http-request/tarball/8a302e514de6ef4df86717027682922f705330f4#/http-request.tar.gz
BuildRequires: make
BuildRequires: cmake
BuildRequires: grep
BuildRequires: sed
BuildRequires: gawk
BuildRequires: clang
BuildRequires: clang-devel
BuildRequires: clang-tools
BuildRequires: gcc-c++
BuildRequires: libstdc++-devel
BuildRequires: pkgconfig
%description
Wazuh is a free and open-source platform for threat prevention, detection, and
response, capable of protecting workloads across on-premises, virtualized,
containerized, and cloud-based environments.
This package contains the Wazuh Agent, a key component in the Wazuh
solution. The agent is deployed on monitored systems to collect data, which is
then sent to the Wazuh Server for analysis. Wazuh has full integration with
OpenSearch, offering powerful search capabilities and visualization tools for
navigating security alerts.
%prep
%autosetup -p 1
mkdir -p src/external/
cp %{SOURCE21} src/external/
cp %{SOURCE22} src/external/
cp %{SOURCE23} src/external/
cp %{SOURCE24} src/external/
cp %{SOURCE25} src/external/
cp %{SOURCE26} src/external/
cp %{SOURCE27} src/external/
cp %{SOURCE28} src/external/
cp %{SOURCE29} src/external/
cp %{SOURCE30} src/external/
cp %{SOURCE31} src/external/
cp %{SOURCE32} src/external/
cp %{SOURCE33} src/external/
cp %{SOURCE34} src/external/
cp %{SOURCE35} src/external/
cp %{SOURCE36} src/external/
cp %{SOURCE37} src/external/
cp %{SOURCE38} src/external/
cp %{SOURCE39} src/external/
cp %{SOURCE40} src/external/
cp %{SOURCE41} src/external/
cp %{SOURCE42} src/external/
cp %{SOURCE43} src/external/
cp %{SOURCE44} src/external/
cp %{SOURCE45} src/external/
cp %{SOURCE46} src/external/
cd src/external/
for i in *tar.gz
do
tar xf "$i"
done
cd ../../
mkdir -p src/shared_modules/
cp %{SOURCE51} src/shared_modules/
cd src/shared_modules/
for i in *tar.gz
do
tar xf "$i"
done
cd ../../
%build
cd src/
sed -i '/^CHECK_/d' Makefile
make deps TARGET=agent
make external/libdb/build_unix/.libs/libdb-18.1.a
make TARGET=agent
cd ../
%install
make install TARGET=agent
%files
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%changelog