dev-qt/qtx11extras: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / net-analyzer / gvm-libs / gvm-libs-10.0.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 CMAKE_MAKEFILE_GENERATOR="emake"
7 inherit cmake flag-o-matic toolchain-funcs user
8
9 DESCRIPTION="Greenbone vulnerability management libraries, previously named openvas-libraries"
10 HOMEPAGE="https://www.greenbone.net/en/"
11 SRC_URI="https://github.com/greenbone/gvm-libs/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12
13 SLOT="0"
14 LICENSE="GPL-2+"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="extras ldap radius"
17
18 DEPEND="
19         app-crypt/gpgme:=
20         dev-libs/hiredis
21         dev-libs/libgcrypt:=
22         dev-perl/UUID
23         net-libs/gnutls:=
24         net-libs/libssh:=
25         sys-libs/zlib
26         ldap? ( net-nds/openldap )
27         radius? ( net-dialup/freeradius-client )"
28
29 RDEPEND="
30         ${DEPEND}"
31
32 BDEPEND="
33         sys-devel/bison
34         sys-devel/flex
35         virtual/pkgconfig
36         extras? ( app-doc/doxygen[dot]
37                   app-doc/xmltoman
38                   app-text/htmldoc
39                   dev-perl/CGI
40                   dev-perl/SQL-Translator
41         )"
42
43 PATCHES=(
44         # Creating pid on build time instead of relying daemon!
45         # QA fix for 10.0.1.
46         "${FILESDIR}/${P}-pid.patch"
47 )
48
49 pkg_setup() {
50         enewgroup gvm 495
51         enewuser gvm 495 -1 /var/lib/gvm gvm
52 }
53
54 src_prepare() {
55         cmake_src_prepare
56         # QA-Fix | Remove doxygen warnings for !CLANG
57         if use extras; then
58                 if ! tc-is-clang; then
59                    local f
60                    for f in doc/*.in
61                    do
62                         sed -i \
63                                 -e "s*CLANG_ASSISTED_PARSING = NO*#CLANG_ASSISTED_PARSING = NO*g" \
64                                 -e "s*CLANG_OPTIONS*#CLANG_OPTIONS*g" \
65                                 "${f}" || die "couldn't disable CLANG parsing"
66                    done
67                 fi
68         fi
69 }
70
71 src_configure() {
72         local mycmakeargs=(
73                 "-DLOCALSTATEDIR=${EPREFIX}/var"
74                 "-DSYSCONFDIR=${EPREFIX}/etc"
75                 $(usex ldap -DBUILD_WITHOUT_LDAP=0 -DBUILD_WITHOUT_LDAP=1)
76                 $(usex radius -DBUILD_WITHOUT_RADIUS=0 -DBUILD_WITHOUT_RADIUS=1)
77         )
78         # Add release hardening flags for 10.0.1
79         append-cflags -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector
80         append-ldflags -Wl,-z,relro -Wl,-z,now
81         cmake_src_configure
82 }
83
84 src_compile() {
85         cmake_src_compile
86         if use extras; then
87                 cmake_build -C "${BUILD_DIR}" doc
88                 cmake_build doc-full -C "${BUILD_DIR}" doc
89                 HTML_DOCS=( "${BUILD_DIR}"/doc/generated/html/. )
90         fi
91         cmake_build rebuild_cache
92 }
93
94 src_install() {
95         cmake_src_install
96
97         # Set proper permissions on required files/directories
98         keepdir /var/lib/gvm
99         fowners -R gvm:gvm /var/lib/gvm
100 }