Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gvmd: init at 23.4.0 #303758

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions pkgs/by-name/gv/gvmd/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
cmake,
doxygen,
fetchFromGitHub,
git,
glib,
gnutls,
gpgme,
graphviz,
gvm-libs,
icu,
lib,
libbsd,
libical,
libidn2,
libpkgconf,
libselinux,
libsepol,
libtasn1,
libxslt,
openvas-scanner,
ospd-openvas,
p11-kit,
perl538Packages,
pcre2,
pkg-config,
postgresql,
stdenv,
util-linux,
xmltoman,
}:

stdenv.mkDerivation rec {
pname = "gvmd";
version = "23.4.0";

src = fetchFromGitHub {
owner = "greenbone";
repo = "gvmd";
rev = "refs/tags/v${version}";
hash = "sha256-Bxq6o98viMMwt2eoiZgPDTYqD/z6jRWYLgH/ZJvkpV4=";
};

prePatch = ''
superherointj marked this conversation as resolved.
Show resolved Hide resolved
substituteInPlace src/sql_pg.c \
--replace-fail "#include <postgresql/libpq-fe.h>" "#include <${postgresql}/include/libpq-fe.h>"
Tochiaha marked this conversation as resolved.
Show resolved Hide resolved
substituteInPlace doc/CMakeLists.txt \
--replace-fail "share/doc/gvm/html/" "\''${GMP_DIR}/doc/gvm/html/" \
--replace-fail "share/man/man8/" "\''${GVMD_MAN_DIR}/man/man8/"
'';

configurePhase = ''
runHook preConfigure

cmake -DSYSCONFDIR=$out/etc \
Tochiaha marked this conversation as resolved.
Show resolved Hide resolved
-DBINDIR=$out/bin \
-DSBINDIR=$out/sbin \
-DLIBDIR=$out/lib \
-DLOCALSTATEDIR=$out/var \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-DLOCALSTATEDIR=$out/var \
-DLOCALSTATEDIR=$out/var \

State in the nix store?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without it result to https://termbin.com/bdhv

-DINCLUDEDIR=$out/include \
-DGMP_DIR=$out/share \
-DGVMD_MAN_DIR=$out/share \
-DDATADIR=$out/share \
Copy link
Contributor

@superherointj superherointj Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-DDATADIR=$out/share \
-DDATADIR=$out/share \

Which kind of data is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without it result to https://termbin.com/bdhv

-DGVM_SYSCONF_DIR=$out/etc/gvm \
-DGVM_DATA_DIR=$out/share/gvm \
Copy link
Contributor

@superherointj superherointj Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which kind of data is this?

-DGVM_STATE_DIR=$out/var/lib/gvm \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State in the nix store?

-DGVMD_STATE_DIR=$out/var/lib/gvm/gvmd \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-DGVMD_STATE_DIR=$out/var/lib/gvm/gvmd \
-DGVMD_STATE_DIR=$out/var/lib/gvm/gvmd \

State in the nix store?

-DGVM_LIB_INSTALL_DIR=$out/lib \
-DGVMD_RUN_DIR=$out/run/gvmd \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-DGVMD_RUN_DIR=$out/run/gvmd \
-DGVMD_RUN_DIR=$out/run/gvmd \

Is it a pid? If it is it shouldn't be in the nix store.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

-DXSLTPROC_EXECUTABLE=${libxslt.bin}/bin/xsltproc \
-DINSTALL_OLD_SYNC_SCRIPTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSYSTEMD_SERVICE_DIR=$out/lib/systemd/system .

runHook postConfigure
'';

postConfigure = ''
mkdir -p \
$out/var/lib/gvm/{scap-data,cert-data,data-objects}
'';

strictDeps = true;

nativeBuildInputs =
[
cmake
doxygen
pkg-config
util-linux
xmltoman
]
++ (with perl538Packages; [
XMLTwig
XMLParser
])
++ lib.optional stdenv.isDarwin git;

buildInputs = [
glib
gnutls
gpgme
graphviz
gvm-libs
icu
libbsd
libical
libidn2
libpkgconf
libselinux
libsepol
libtasn1
libxslt
openvas-scanner
ospd-openvas
p11-kit
pcre2
postgresql
xmltoman
Tochiaha marked this conversation as resolved.
Show resolved Hide resolved
];

preFixup = ''
substituteInPlace $out/lib/systemd/system/gvmd.service \
--replace-fail "/run/ospd/ospd-openvas.sock" "${ospd-openvas}/run/ospd/ospd-openvas.sock"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A sock shouldn't exist in the nix store... That wouldn't be write-able.

'';

meta = {
description = "The central management service between security scanners and the user clients";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "The central management service between security scanners and the user clients";
description = "Central management service between security scanners and the user clients";

The policy has changed https://github.com/NixOS/nixpkgs/tree/master/pkgs#meta-attributes

homepage = "https://github.com/greenbone/gvmd";
changelog = "https://github.com/greenbone/gvmd/releases/tag/v${version}";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ tochiaha ];
mainProgram = "gvmd";
Tochiaha marked this conversation as resolved.
Show resolved Hide resolved
platforms = lib.platforms.all;
};
}