net-analyzer/greenbone-security-assistant: bump to 8.0.1.
authorHasan ÇALIŞIR <hasan.calisir@psauxit.com>
Mon, 12 Aug 2019 17:38:49 +0000 (20:38 +0300)
committerJoonas Niilola <juippis@gentoo.org>
Mon, 28 Oct 2019 04:03:04 +0000 (06:03 +0200)
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Hasan ÇALIŞIR <hasan.calisir@psauxit.com>
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
13 files changed:
net-analyzer/greenbone-security-assistant/Manifest
net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-cmakelist.patch [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-node.patch [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-pid.patch [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-reactjs.patch [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-sbin.patch [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-uninstall-snippet.patch [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/gsad-daemon.conf [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/gsad.init [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/gsad.logrotate [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/files/gsad.service [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/greenbone-security-assistant-8.0.1.ebuild [new file with mode: 0644]
net-analyzer/greenbone-security-assistant/metadata.xml

index db30d43db812d633ba2acf192882532bbd7b5bd3..4b67fa508149fd8f4b081b0f7a42833946042015 100644 (file)
@@ -1 +1,3 @@
 DIST greenbone-security-assistant-7.0.3.tar.gz 2918954 BLAKE2B 4a6cd5d8378bcbb0a9df6cb5b8f6560060f15d0b0cb53d2c61692cb2bc2cd86af6e9cdeb5040c4d7020c3b016779a76ec517d54614388c62aaedd596f55fa3c4 SHA512 7e1c1ef939ba08dab3b78baf1aa9c110be2febfbed5d67eefe8110c60f5089a1af44bc26693657226f417c6bd516a4a656eb159dae2a78f878e1a1b6c222b117
+DIST greenbone-security-assistant-8.0.1-node_modules.tar.gz 34084175 BLAKE2B 17c9e24961b63b957f932e4c5970113499ad65655b42e624284fb22a495d50c12e5f8289da4e17db717885b65909a6e18213fa312052c9c06c9bdc37816204f1 SHA512 552ea55fe218ae2345fa45b43af349825f255ccd86137dd245679efe6abc805d16c4ced3599f644d9b9f2686047b486d5e0c8aa4eaa0cbbf13157b9e2dbc8cc2
+DIST greenbone-security-assistant-8.0.1.tar.gz 1558918 BLAKE2B 75287784ed215300cfb30101d39b06b134092ca2d4311bcca976be23cc289529c6a8d661b99cb28e890c68f27e93a9259681add067749a772b7e3aea28761f3b SHA512 b91c1c4b8073c3ad3d3d636abbaa7881393f1448eae7366636ff618391c199c240e6bc4c848740a4267b4142aa872fb91c0798b8034d152d16016e650fbda2b8
diff --git a/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-cmakelist.patch b/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-cmakelist.patch
new file mode 100644 (file)
index 0000000..d0fc796
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/gsad/config/CMakeLists.txt       2019-07-18 20:39:10.331949702 +0300
++++ b/gsad/config/CMakeLists.txt       2019-07-18 20:40:18.946830294 +0300
+@@ -16,27 +16,3 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-if (NOT SYSTEMD_SERVICE_DIR)
+-  set (SYSTEMD_SERVICE_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system")
+-endif (NOT SYSTEMD_SERVICE_DIR)
+-
+-if (NOT DEFAULT_CONFIG_DIR)
+-  set (DEFAULT_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/etc/default")
+-endif (NOT DEFAULT_CONFIG_DIR)
+-
+-if (NOT LOGROTATE_DIR)
+-  set (LOGROTATE_DIR "${CMAKE_INSTALL_PREFIX}/etc/logrotate.d")
+-endif (NOT LOGROTATE_DIR)
+-
+-configure_file (gsad.service.in gsad.service)
+-configure_file (gsad.logrotate.in gsad.logrotate)
+-
+-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gsad.service
+-         DESTINATION ${SYSTEMD_SERVICE_DIR}/)
+-
+-install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/gsad.default
+-         DESTINATION ${DEFAULT_CONFIG_DIR}/ RENAME gsad)
+-
+-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gsad.logrotate
+-         DESTINATION ${LOGROTATE_DIR}/ RENAME gsad)
+-
diff --git a/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-node.patch b/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-node.patch
new file mode 100644 (file)
index 0000000..116bd48
--- /dev/null
@@ -0,0 +1,34 @@
+--- a/gsa/CMakeLists.txt       2019-07-17 16:45:39.000000000 +0300
++++ b/gsa/CMakeLists.txt       2019-07-17 22:24:49.466906757 +0300
+@@ -1095,28 +1095,17 @@
+      ${GSA_JS_SRC_FILES}
+      PARENT_SCOPE)
+-
+-add_custom_command (OUTPUT node-modules.stamp
+-                    DEPENDS ${GSA_PKG_FILES}
+-                    COMMAND ${INSTALLER} "${INSTALLER_ARGS}" "install"
+-                    COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/node-modules.stamp
+-                    WORKING_DIRECTORY ${GSA_SRC_DIR}
+-                    COMMENT "Install gsa-ng js dependencies")
+-
+-
+ add_custom_command (OUTPUT bundle.stamp
+-                    COMMAND ${CMAKE_COMMAND} -E env REACT_APP_VERSION=${PROJECT_VERSION_STRING} ${INSTALLER} "${INSTALLER_ARGS}" run build
++                    COMMAND ${CMAKE_COMMAND} -E env REACT_APP_VERSION=${PROJECT_VERSION_STRING} ${INSTALLER} --offline run build
+                     COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/bundle.stamp
+                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+-                    DEPENDS  ${CMAKE_CURRENT_BINARY_DIR}/node-modules.stamp
+-                             ${GSA_PKG_FILES}
++                    DEPENDS  ${GSA_PKG_FILES}
+                              ${GSA_STATIC_SRC_FILES}
+                              ${GSA_JS_SRC_FILES}
+                     COMMENT "Build gsa-ng install files")
+ add_custom_target (gsa-ng ALL
+-                   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/node-modules.stamp
+-                           ${CMAKE_CURRENT_BINARY_DIR}/bundle.stamp)
++                   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bundle.stamp)
+ set (GSA_STATIC_BUILD_FILES
+      ${GSA_BUILD_DIR}/index.html)
diff --git a/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-pid.patch b/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-pid.patch
new file mode 100644 (file)
index 0000000..a318c87
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -222,7 +222,7 @@ if (NOT DATADIR)
+ endif (NOT DATADIR)
+ if (NOT GSAD_PID_DIR)
+-  set (GSAD_PID_DIR "${LOCALSTATEDIR}/run")
++  set (GSAD_PID_DIR "/run")
+ endif (NOT GSAD_PID_DIR)
+ set (OPENVAS_STATE_DIR "${LOCALSTATEDIR}/lib/openvas")
diff --git a/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-reactjs.patch b/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-reactjs.patch
new file mode 100644 (file)
index 0000000..19a4731
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/gsa/package.json 2019-07-17 16:45:39.000000000 +0300
++++ b/gsa/package.json 2019-07-17 22:40:31.371899489 +0300
+@@ -66,12 +66,12 @@
+     "x2js": "^3.2.6"
+   },
+   "scripts": {
+-    "test": "react-scripts test",
+-    "test:coverage": "react-scripts test --coverage --maxWorkers 2",
++    "test": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js test",
++    "test:coverage": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js test --coverage --maxWorkers 2",
+     "lint": "eslint --max-warnings 0 src",
+-    "start": "react-scripts start",
+-    "build": "react-scripts build",
+-    "eject": "react-scripts eject"
++    "start": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js start",
++    "build": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js build",
++    "eject": "NODE_ENV=production node_modules/react-scripts/bin/react-scripts.js eject"
+   },
+   "devDependencies": {
+     "@types/jest": "^24.0.12",
diff --git a/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-sbin.patch b/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-sbin.patch
new file mode 100644 (file)
index 0000000..c1825ba
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/gsad/src/CMakeLists.txt  2019-07-21 23:07:38.375683800 +0300
++++ a/gsad/src/CMakeLists.txt  2019-07-21 23:08:17.301651451 +0300
+@@ -175,7 +175,7 @@
+ ## Install
+ install (TARGETS gsad
+-         RUNTIME DESTINATION ${SBINDIR}
++         RUNTIME DESTINATION ${BINDIR}
+          LIBRARY DESTINATION ${LIBDIR}
+          ARCHIVE DESTINATION ${LIBDIR}/static)
+
diff --git a/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-uninstall-snippet.patch b/net-analyzer/greenbone-security-assistant/files/greenbone-security-assistant-8.0.1-uninstall-snippet.patch
new file mode 100644 (file)
index 0000000..3b07595
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/gsa/CMakeLists.txt       2019-07-18 23:14:04.639202986 +0300
++++ b/gsa/CMakeLists.txt       2019-07-18 23:21:54.568052589 +0300
+@@ -1116,9 +1116,6 @@
+ install (FILES public/robots.txt
+          DESTINATION ${GSA_DEST_DIR})
+-# remove old generated files
+-install (CODE "file(REMOVE_RECURSE ${GSA_DEST_DIR}/static)")
+-
+ install (DIRECTORY
+          ${GSA_BUILD_DIR}/static
+          ${GSA_BUILD_DIR}/img
diff --git a/net-analyzer/greenbone-security-assistant/files/gsad-daemon.conf b/net-analyzer/greenbone-security-assistant/files/gsad-daemon.conf
new file mode 100644 (file)
index 0000000..f7c7ee5
--- /dev/null
@@ -0,0 +1,19 @@
+# Greenbone Security Assistant command args
+
+# e.g. --foreground | e.g. --no-redirect
+GSAD_OPTIONS="--no-redirect"
+
+# GSAD listen adress
+GSAD_LISTEN_ADDRESS="--listen=127.0.0.1"
+
+# GSAD listen port  
+GSAD_LISTEN_PORT="--port=9392"
+
+# GVMD listen address
+GVMD_LISTEN_ADDRESS="--mlisten=127.0.0.1"
+
+# GVMD listen port
+GVMD_LISTEN_PORT="--mport=9390"
+
+# TLS Settings
+GSAD_GNUTLS_PRIORITIES="--gnutls-priorities=NORMAL"
diff --git a/net-analyzer/greenbone-security-assistant/files/gsad.init b/net-analyzer/greenbone-security-assistant/files/gsad.init
new file mode 100644 (file)
index 0000000..6d431bd
--- /dev/null
@@ -0,0 +1,20 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+: ${GSAD_USER:=gvm}
+: ${GSAD_GROUP:=gvm}
+: ${GSAD_TIMEOUT:=30}
+
+name="Greenbone Security Assistant (GSA)"
+command="/usr/bin/gsad"
+command_args="${GSAD_OPTIONS} ${GSAD_LISTEN_ADDRESS} ${GSAD_LISTEN_PORT} ${GVMD_LISTEN_ADDRESS} ${GVMD_LISTEN_PORT} ${GSAD_GNUTLS_PRIORITIES}"
+command_background="true"
+command_user="${GSAD_USER}:${GSAD_GROUP}"
+pidfile="/run/gsad.pid"
+retry="${GSAD_TIMEOUT}"
+
+depend() {
+       after bootmisc
+       need localmount net gvmd
+}
diff --git a/net-analyzer/greenbone-security-assistant/files/gsad.logrotate b/net-analyzer/greenbone-security-assistant/files/gsad.logrotate
new file mode 100644 (file)
index 0000000..f80bba8
--- /dev/null
@@ -0,0 +1,13 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+# Daemon ignore HUP so we use 'copytruncate' instead of 'create' 
+# with safe file size to prevent losing log entries.
+
+/var/log/gvm/gsad.log {
+       compress
+       missingok
+       notifempty
+       sharedscripts
+       copytruncate
+       maxsize 10M
+}
diff --git a/net-analyzer/greenbone-security-assistant/files/gsad.service b/net-analyzer/greenbone-security-assistant/files/gsad.service
new file mode 100644 (file)
index 0000000..91e7918
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=Greenbone Security Assistant
+After=network.target
+After=openvassd.service
+After=gvmd.service
+Wants=gvmd.service
+
+[Service]
+Type=forking
+User=gvm
+Group=gvm
+EnvironmentFile=-/etc/gvm/sysconfig/gsad-daemon.conf
+ExecStart=/usr/bin/gsad $GSAD_OPTIONS $GSAD_LISTEN_ADDRESS $GSAD_LISTEN_PORT $GVMD_LISTEN_ADDRESS $GVMD_LISTEN_PORT $GSAD_GNUTLS_PRIORITIES
+Restart=always
+RestartSec=10
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-analyzer/greenbone-security-assistant/greenbone-security-assistant-8.0.1.ebuild b/net-analyzer/greenbone-security-assistant/greenbone-security-assistant-8.0.1.ebuild
new file mode 100644 (file)
index 0000000..6177f8f
--- /dev/null
@@ -0,0 +1,127 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_MAKEFILE_GENERATOR="emake"
+inherit cmake-utils flag-o-matic systemd toolchain-funcs
+
+MY_PN="gsa"
+MY_DN="gsad"
+MY_NODE_N="node_modules"
+
+DESCRIPTION="Greenbone Security Assistant"
+HOMEPAGE="https://www.greenbone.net/en/"
+SRC_URI="https://github.com/greenbone/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+        https://github.com/greenbone/gsa/releases/download/v8.0.1/gsa-node-modules-8.0.1.tar.gz -> ${P}-${MY_NODE_N}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2+"
+KEYWORDS="~amd64 ~x86"
+IUSE="extras"
+
+DEPEND="
+       dev-libs/libgcrypt:0=
+       dev-libs/libxslt
+       >=net-analyzer/gvm-libs-10.0.1
+       net-libs/gnutls:=
+       net-libs/libmicrohttpd[messages]"
+
+RDEPEND="
+       ${DEPEND}
+       !~net-analyzer/greenbone-security-assistant-7.0.3
+       ~net-analyzer/openvas-scanner-6.0.1
+       >=net-analyzer/gvmd-8.0.1"
+
+BDEPEND="
+       >=net-libs/nodejs-8.12.0
+       >=sys-apps/yarn-1.15.2
+       virtual/pkgconfig
+       extras? ( app-doc/doxygen[dot]
+                 app-doc/xmltoman
+                 app-text/htmldoc
+                 dev-python/polib
+                 sys-devel/gettext
+       )"
+
+BUILD_DIR="${WORKDIR}/${MY_PN}-${PV}_build"
+S="${WORKDIR}/${MY_PN}-${PV}"
+MY_NODE_DIR="${S}/${MY_PN}/"
+
+PATCHES=(
+       # QA fix for 8.0.0.
+       "${FILESDIR}/${P}-pid.patch"
+       # Disable yarn-fetch during compile.
+       "${FILESDIR}/${P}-node.patch"
+       # Fix react-env path for react.js.
+       "${FILESDIR}/${P}-reactjs.patch"
+       # Remove ugly uninstall-snippet that causes failing re-emerge.
+       "${FILESDIR}/${P}-uninstall-snippet.patch"
+       # Remove unnecessary install paths/files.
+       "${FILESDIR}/${P}-cmakelist.patch"
+       # Install exec. to /usr/bin instead of /usr/sbin
+       "${FILESDIR}/${P}-sbin.patch"
+)
+
+src_prepare() {
+       cmake-utils_src_prepare
+       # We will use pre-generated npm stuff.
+       mv "${WORKDIR}/${MY_NODE_N}" "${MY_NODE_DIR}" || die "couldn't move node_modules"
+       # Update .yarnrc accordingly.
+       echo "--modules-folder ${MY_NODE_DIR}" >> "${S}/${MY_PN}/.yarnrc" || die "echo failed"
+       # QA-Fix | Remove !CLANG doxygen warnings for 8.0.1
+       if use extras; then
+               if ! tc-is-clang; then
+                  local f
+                  for f in gsad/doc/*.in
+                  do
+                       sed -i \
+                               -e "s*CLANG_ASSISTED_PARSING = NO*#CLANG_ASSISTED_PARSING = NO*g" \
+                               -e "s*CLANG_OPTIONS*#CLANG_OPTIONS*g" \
+                               "${f}" || die "couldn't disable CLANG parsing"
+                  done
+               fi
+       fi
+}
+
+src_configure() {
+       local mycmakeargs=(
+               "-DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr"
+               "-DLOCALSTATEDIR=${EPREFIX}/var"
+               "-DSYSCONFDIR=${EPREFIX}/etc"
+       )
+       # Add release hardening flags for 8.0.1
+       append-cflags -D_FORTIFY_SOURCE=2 -fstack-protector
+       append-ldflags -Wl,-z,relro -Wl,-z,now
+       cmake-utils_src_configure
+}
+
+src_compile() {
+       cmake-utils_src_compile
+       if use extras; then
+               cmake-utils_src_make -C "${BUILD_DIR}" doc
+               cmake-utils_src_make doc-full -C "${BUILD_DIR}" doc
+               HTML_DOCS=( "${BUILD_DIR}/${MY_DN}/doc/generated/html/." )
+       fi
+       cmake-utils_src_make rebuild_cache
+}
+
+src_install() {
+       cmake-utils_src_install
+
+       insinto /etc/gvm/sysconfig
+       doins "${FILESDIR}/${MY_DN}-daemon.conf"
+
+       dodir /etc/gvm/reverse-proxy
+       insinto /etc/gvm/reverse-proxy
+       doins "${FILESDIR}/${MY_PN}.nginx.reverse.proxy.example"
+       fowners -R gvm:gvm /etc/gvm
+
+       newinitd "${FILESDIR}/${MY_DN}.init" "${MY_DN}"
+       newconfd "${FILESDIR}/${MY_DN}-daemon.conf" "${MY_DN}"
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}/${MY_DN}.logrotate" "${MY_DN}"
+
+       systemd_dounit "${FILESDIR}/${MY_DN}.service"
+}
index 6a3196eff3b2ec149da7477806ada79a888eff30..5a350f963a3c09cbc13b6ecf627628a478189d54 100644 (file)
        <use>
                <flag name="extras">Pdf results, extra fonts, html docs support</flag>
        </use>
+       <longdescription lang="en">
+       The Greenbone Security Assistant is the web interface developed for the Greenbone Security Manager appliances.
+       It connects to the Greenbone Vulnerability Manager GVM to provide a full-featured user interface for vulnerability management.
+       Greenbone Security Assistant consists of GSA - The webpage written in React and 
+       GSAD - The HTTP server talking to the GVM daemon.
+       </longdescription>
+       <upstream>
+               <remote-id type="github">greenbone/gsa</remote-id>
+       </upstream>
 </pkgmetadata>