Skip to content

Commit

Permalink
docs: Update rpm and deb package generation
Browse files Browse the repository at this point in the history
  • Loading branch information
lchico committed Apr 16, 2024
1 parent f547b91 commit 6f61804
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 149 deletions.
72 changes: 0 additions & 72 deletions source/development/packaging/generate-deb-package.rst

This file was deleted.

94 changes: 94 additions & 0 deletions source/development/packaging/generate-deb-rpm-package.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
.. Copyright (C) 2015, Wazuh, Inc.
.. meta::
:description: Wazuh provides an automated way of building DEB or RPM packages. Learn how to build your own Wazuh DEB or RPM packages in this section of our documentation.

.. _create-deb-rpm:

Debian or RPM
=============

Wazuh provides an automated way of building DEB or RPM packages using docker so there is no need for any other dependency.

To create an Debian or RPM package follow these steps:

Requirements
^^^^^^^^^^^^

* Docker
* Git

Download our wazuh repository from GitHub and go to the debs directory.

.. code-block:: console
$ git clone https://github.com/wazuh/wazuh && cd wazuh/packages && git checkout v|WAZUH_CURRENT|
Execute the ``generate_package.sh`` script, with the different options you desire. This script will build a Docker image with all the necessary tools to create the DEB or RPM and run a container that will build it:

.. code-block:: console
# ./generate_package.sh -h
.. code-block:: none
:class: output
Usage: ./generate_package.sh [OPTIONS]
-b, --branch <branch> [Optional] Select Git branch [].
-t, --target <target> [Required] Target package to build: manager or agent.
-a, --architecture <arch> [Optional] Target architecture of the package [amd64/i386/ppc64le/arm64/armhf].
-j, --jobs <number> [Optional] Change number of parallel jobs when compiling the manager or agent. By default: 2.
-r, --revision <rev> [Optional] Package revision. By default: 0.
-s, --store <path> [Optional] Set the destination path of package. By default, an output folder will be created.
-p, --path <path> [Optional] Installation path for the package. By default: /var/ossec.
-d, --debug [Optional] Build the binaries with debug symbols. By default: False.
-c, --checksum [Optional] Generate checksum on the same directory than the package.
-l, --legacy [Optional only for RPM] Build package for CentOS 5.
--dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one.
--tag [Optional] Tag to use with the docker image.
--sources <path> [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub. By default use the script path.
--is_stage [Optional] Use release name in package
--system [Optional] Select Package OS [rpm, deb]. By default is 'deb'.
--src [Optional] Generate the source package in the destination directory.
--future [Optional] Build test future package x.30.0 Used for development purposes.
-h, --help Show this help.
Below, you will find some examples of how to build a DEB or RPM package.


.. tabs::
.. group-tab:: DEB

.. code-block:: console
# ./generate_package.sh -s /tmp -t manager -a amd64 -r my_rev --system deb
This will generate a |WAZUH_CURRENT| Wazuh manager package DEB with revision ``my_rev`` for ``amd64`` systems.

.. code-block:: console
# ./generate_package.sh -t agent -a amd64 -p /opt/ossec --system deb
This will generate a |WAZUH_CURRENT| Wazuh agent DEB package with ``/opt/ossec`` as installation directory for ``amd64`` systems.

.. group-tab:: RPM

.. note::
Use the following architecture equivalences:
* amd64 -> x86_64
* arm64 -> aarch64
* armhf -> armv7hl

.. code-block:: console
# ./generate_package.sh -s /tmp -t manager -a amd64 -r my_rev --system rpm
This will generate a |WAZUH_CURRENT| Wazuh manager RPM package with revision ``my_rev`` for ``x86_64`` systems.

.. code-block:: console
# ./generate_package.sh -t agent -a amd64 -p /opt/ossec --system rpm
This will generate a |WAZUH_CURRENT| Wazuh agent RPM package with ``/opt/ossec`` as installation directory for ``x86_64`` systems.
74 changes: 0 additions & 74 deletions source/development/packaging/generate-rpm-package.rst

This file was deleted.

5 changes: 2 additions & 3 deletions source/development/packaging/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.. meta::
:description: Learn more about how to generate your own Wazuh packages for different platforms, such as Debian, macOS, Windows, Splunk app, and others.

.. -package-creation:
Wazuh packages generation guide
Expand All @@ -16,10 +16,9 @@ This section will show you how to generate your own Wazuh packages for different
:maxdepth: 1

generate-aix-package
generate-deb-package
generate-deb-rpm-package
generate-hpux-package
generate-osx-package
generate-rpm-package
generate-sol-package
generate-ova
generate-windows-package
Expand Down

0 comments on commit 6f61804

Please sign in to comment.