Gentoo Archives: gentoo-commits

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libprelude/files/, dev-libs/libprelude/
Date: Fri, 05 Aug 2016 01:13:44
Message-Id: 1470359412.a390b6011ea0586d18850c8e7f4a03f5285247eb.gokturk@gentoo
1 commit: a390b6011ea0586d18850c8e7f4a03f5285247eb
2 Author: Thomas Andrejak <thomas.andrejak <AT> gmail <DOT> com>
3 AuthorDate: Sun Jul 17 13:09:29 2016 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 5 01:10:12 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a390b601
7
8 dev-libs/libprelude: New package
9
10 Libprelude is a library that guarantees secure connections between all
11 sensors and the Prelude Manager.
12
13 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=583126
14
15 dev-libs/libprelude/Manifest | 1 +
16 .../files/libprelude-3.0.0-perl-hardening.patch | 14 ++++
17 .../files/libprelude-3.0.0-ruby-configure.patch | 14 ++++
18 .../files/libprelude-3.0.0-ruby-m4.patch | 20 +++++
19 dev-libs/libprelude/libprelude-3.0.0.ebuild | 85 ++++++++++++++++++++++
20 dev-libs/libprelude/metadata.xml | 20 +++++
21 6 files changed, 154 insertions(+)
22
23 diff --git a/dev-libs/libprelude/Manifest b/dev-libs/libprelude/Manifest
24 new file mode 100644
25 index 0000000..8cbf82a
26 --- /dev/null
27 +++ b/dev-libs/libprelude/Manifest
28 @@ -0,0 +1 @@
29 +DIST libprelude-3.0.0.tar.gz 2900153 SHA256 8dd1acdd49ec42b3c54642c33987c574ced43b92feb9a523998e07317434cec2 SHA512 a1fd51aa3bb1b68759a00dd1636cb96379f0e954a66f4e39887ab20a5b4c191a0455dd6bd5f41b20ad94d06fff59af7f89b258f42e1c0dd4cfc99185a77d1797 WHIRLPOOL 5ee5a90d0448c8079977dbf84a5c3650bc00aff8c6fe4355a7926313b2364824281d2fea898d92e80bc8b7cb17190c6f7e36b2c9de2ebc62f8b4411417541d58
30
31 diff --git a/dev-libs/libprelude/files/libprelude-3.0.0-perl-hardening.patch b/dev-libs/libprelude/files/libprelude-3.0.0-perl-hardening.patch
32 new file mode 100644
33 index 0000000..df77899
34 --- /dev/null
35 +++ b/dev-libs/libprelude/files/libprelude-3.0.0-perl-hardening.patch
36 @@ -0,0 +1,14 @@
37 +When : when building perl bindings. Without this patch, it does not take care of LDFLAGS.
38 +Why : It is required if you want to customize your own LDFLAGS, example : for hardening
39 +Upstream : https://www.prelude-siem.org/issues/761 It should be added in the next version of Prelude.
40 +--- a/bindings/perl/Makefile.PL.in
41 ++++ b/bindings/perl/Makefile.PL.in
42 +@@ -27,7 +27,7 @@
43 + my %attributs = (NAME => 'Prelude',
44 + INC => '-I@top_builddir@ -I@top_builddir@/src/include -I@top_srcdir@/src/include -I@top_builddir@/src/libprelude-error -I@top_srcdir@/bindings/c++/include',
45 + LIBS => ["-L@top_builddir@/src/.libs -lprelude -L@top_builddir@/bindings/c++/.libs -lpreludecpp", "-L$ENV{LIBDIR} -lprelude @LIBPRELUDE_LIBS@ @LIBADD_DL@ @LTLIBTHREAD@" ],
46 +- LDDLFLAGS => "-L@top_builddir@/src/.libs $Config{lddlflags}");
47 ++ LDDLFLAGS => "-L@top_builddir@/src/.libs $Config{lddlflags} @LDFLAGS@,-rpath");
48 +
49 + if ( abs_path("@top_srcdir@") ne abs_path("@top_builddir@") ) {
50 + foreach my $filename ( qw/Prelude.cxx Prelude.pm/ ) {
51
52 diff --git a/dev-libs/libprelude/files/libprelude-3.0.0-ruby-configure.patch b/dev-libs/libprelude/files/libprelude-3.0.0-ruby-configure.patch
53 new file mode 100644
54 index 0000000..fc09bea
55 --- /dev/null
56 +++ b/dev-libs/libprelude/files/libprelude-3.0.0-ruby-configure.patch
57 @@ -0,0 +1,14 @@
58 +--- a/configure.in
59 ++++ b/configure.in
60 +@@ -525,9 +525,9 @@
61 + dnl * Ruby support *
62 + dnl **************************************************
63 +
64 +-
65 +-AM_PATH_RUBY(,with_ruby=yes, with_ruby=no)
66 ++AC_ARG_WITH(ruby, AC_HELP_STRING(--with-ruby@<:@=PATH@:>@, Enable support for ruby binding @<:@default=auto@:>@),,with_ruby=no)
67 + if test x$with_ruby != xno; then
68 ++ AM_PATH_RUBY(,with_ruby=yes, with_ruby=no)
69 + RUBY_ARCHDIR=`$RUBY -e 'require "rbconfig.rb"; puts RbConfig::expand("\$(archdir)")'`
70 + RUBY_LIBRUBYARG=`$RUBY -e 'require "rbconfig.rb"; puts RbConfig::expand("\$(LIBRUBYARG)")'`
71 +
72
73 diff --git a/dev-libs/libprelude/files/libprelude-3.0.0-ruby-m4.patch b/dev-libs/libprelude/files/libprelude-3.0.0-ruby-m4.patch
74 new file mode 100644
75 index 0000000..b02555a
76 --- /dev/null
77 +++ b/dev-libs/libprelude/files/libprelude-3.0.0-ruby-m4.patch
78 @@ -0,0 +1,20 @@
79 +When : when building ruby bindings, it can not find ruby versin so configure will never enable ruby support
80 +Why : It is required if you want to use libprelude with ruby
81 +Upstream : https://www.prelude-siem.org/issues/759 It should be added in the next version of Prelude.
82 +--- a/m4/am_path_ruby.m4
83 ++++ b/m4/am_path_ruby.m4
84 +@@ -96,11 +96,11 @@
85 + dnl (shared libraries)
86 + AC_CACHE_CHECK([for $am_display_RUBY extension module directory],
87 + [am_cv_ruby_rbexecdir],
88 +- [am_cv_ruby_rbexecdir=`$RUBY -rrbconfig -e "drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/; prefix = Regexp.new('\\A' + Regexp.quote(RbConfig::CONFIG[['prefix']])); \\$prefix = RbConfig::CONFIG[['prefix']].sub(drive, ''); \\$sitearchdir = RbConfig::CONFIG[['sitearchdir']].sub(prefix, '\\$(prefix)').sub(drive, ''); print \\$sitearchdir;" 2>/dev/null || echo "${RUBY_EXEC_PREFIX}/local/lib/site_ruby/${RUBY_VERSION}/${RUBY_PLATFORM}"`])
89 ++ [am_cv_ruby_rbexecdir=`$RUBY -r rbconfig -e "print RbConfig::CONFIG[['vendorarchdir']]"`])
90 + AC_SUBST([rbexecdir], [$am_cv_ruby_rbexecdir])
91 +
92 +- RUBY_INCLUDES=`$RUBY -r rbconfig -e 'if RbConfig::CONFIG[["archdir"]] then print " -I" + RbConfig::CONFIG[["archdir"]] end
93 +- if RbConfig::CONFIG[["rubyhdrdir"]] then print " -I" + RbConfig::CONFIG[["rubyhdrdir"]] end'`
94 ++ RUBY_VER=`$RUBY -rrbconfig -e "print RbConfig::CONFIG[['ruby_pc']]" | sed 's/.pc//g'`
95 ++ RUBY_INCLUDES=`pkg-config $RUBY_VER --cflags`
96 + AC_SUBST([RUBY_INCLUDES])
97 +
98 + dnl pkgrbexecdir -- $(rbexecdir)/$(PACKAGE)
99
100 diff --git a/dev-libs/libprelude/libprelude-3.0.0.ebuild b/dev-libs/libprelude/libprelude-3.0.0.ebuild
101 new file mode 100644
102 index 0000000..149d06d
103 --- /dev/null
104 +++ b/dev-libs/libprelude/libprelude-3.0.0.ebuild
105 @@ -0,0 +1,85 @@
106 +# Copyright 1999-2016 Gentoo Foundation
107 +# Distributed under the terms of the GNU General Public License v2
108 +# $Id$
109 +
110 +EAPI=6
111 +
112 +PYTHON_COMPAT=( python{2_7,3_{3,4,5}} )
113 +
114 +USE_RUBY="ruby21"
115 +
116 +inherit autotools eutils python-r1 ruby-single
117 +
118 +DESCRIPTION="Prelude-SIEM Framework Library"
119 +HOMEPAGE="https://www.prelude-siem.org"
120 +SRC_URI="https://www.prelude-siem.org/pkg/src/3.0.0/${P}.tar.gz"
121 +
122 +LICENSE="GPL-2+"
123 +SLOT="0"
124 +KEYWORDS="~amd64 ~x86"
125 +IUSE="doc lua python ruby perl"
126 +
127 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
128 +
129 +RDEPEND="dev-libs/libgcrypt:0=
130 + net-libs/gnutls
131 + perl? ( dev-lang/perl virtual/perl-ExtUtils-MakeMaker )
132 + lua? ( dev-lang/lua:* )
133 + ruby? ( ${RUBY_DEPS} )
134 + python? ( ${PYTHON_DEPS} )"
135 +
136 +DEPEND="${RDEPEND}
137 + doc? ( dev-util/gtk-doc )
138 + sys-devel/flex
139 + virtual/yacc
140 + >=dev-lang/swig-3.0.7
141 + virtual/pkgconfig"
142 +
143 +PATCHES=(
144 + "${FILESDIR}/${P}-perl-hardening.patch"
145 + "${FILESDIR}/${P}-ruby-m4.patch"
146 + "${FILESDIR}/${P}-ruby-configure.patch"
147 +)
148 +
149 +src_prepare() {
150 + default_src_prepare
151 +
152 + # Avoid null runpaths in Perl bindings.
153 + sed -e 's/ LD_RUN_PATH=""//' -i "${S}/bindings/Makefile.am" || die "sed failed"
154 +
155 + mv "${S}/configure.in" "${S}/configure.ac" || die "mv failed"
156 +
157 + eautoreconf
158 +}
159 +
160 +src_configure() {
161 + local python2_configure=--without-python2
162 + local python3_configure=--without-python3
163 +
164 + chk_python() {
165 + if [[ ${EPYTHON} == python2* ]]; then
166 + python2_configure=--with-python2
167 + elif [[ ${EPYTHON} == python3* ]]; then
168 + python3_configure=--with-python3
169 + fi
170 + }
171 +
172 + if use python; then
173 + python_foreach_impl chk_python
174 + fi
175 +
176 + econf \
177 + --enable-easy-bindings \
178 + --with-swig \
179 + $(use_with perl) \
180 + $(use_enable doc gtk-doc) \
181 + $(use_with lua) \
182 + $(use_with ruby) \
183 + ${python2_configure} \
184 + ${python3_configure}
185 +}
186 +
187 +src_install() {
188 + default_src_install
189 + prune_libtool_files --modules
190 +}
191
192 diff --git a/dev-libs/libprelude/metadata.xml b/dev-libs/libprelude/metadata.xml
193 new file mode 100644
194 index 0000000..1870d87
195 --- /dev/null
196 +++ b/dev-libs/libprelude/metadata.xml
197 @@ -0,0 +1,20 @@
198 +<?xml version="1.0" encoding="UTF-8"?>
199 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
200 +<pkgmetadata>
201 + <maintainer type="person">
202 + <email>thomas.andrejak@×××××.com</email>
203 + <name>Thomas Andrejak</name>
204 + </maintainer>
205 + <maintainer type="project">
206 + <email>proxy-maint@g.o</email>
207 + <name>Proxy Maintainers</name>
208 + </maintainer>
209 + <longdescription lang="en">
210 + Libprelude is a library that guarantees secure connections between all sensors
211 + and the Prelude Manager. Libprelude provides an Application Programming Interface
212 + (API) for the communication with Prelude sub-systems, it supplies the necessary
213 + functionality for generating and emitting IDMEF events with Prelude and automates
214 + the saving and re-transmission of data in times of temporary interruption of one
215 + of the components of the system.
216 + </longdescription>
217 +</pkgmetadata>