From 35f6543531896da9ada6bc0072f4824cbdf36ad3 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Thu, 20 Jul 2023 00:22:13 +0200 Subject: [PATCH] - added java and python modules, seems ok, release 1 --- syslog-ng.spec | 82 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 13 deletions(-) diff --git a/syslog-ng.spec b/syslog-ng.spec index e9b64ae..3677c9a 100644 --- a/syslog-ng.spec +++ b/syslog-ng.spec @@ -36,7 +36,7 @@ Summary(pl.UTF-8): Syslog-ng - systemowy demon logujący nowej generacji Summary(pt_BR.UTF-8): Daemon de log nova geração Name: syslog-ng Version: 4.2.0 -Release: 0.1 +Release: 1 License: GPL v2+ with OpenSSL exception Group: Daemons Source0: https://github.com/balabit/syslog-ng/archive/%{name}-%{version}.tar.gz @@ -66,8 +66,10 @@ BuildRequires: docbook-style-xsl %{?with_tests:BuildRequires: findutils} BuildRequires: flex BuildRequires: glib2-devel >= %{glib2_ver} -%{?with_redis:BuildRequires: hiredis-devel} +%{?with_redis:BuildRequires: hiredis-devel >= 0.11.0} +%{?with_java:BuildRequires: jdk >= 1.8} %{?with_json:BuildRequires: json-c-devel >= 0.13} +%{?with_java:BuildRequires: gradle >= 3.4} %{?with_mongodb:BuildRequires: libbson-devel} BuildRequires: libcap-devel %{?with_sql:BuildRequires: libdbi-devel >= 0.9.0} @@ -76,6 +78,7 @@ BuildRequires: libcap-devel %{?with_mongodb:BuildRequires: mongo-c-driver-devel} %{?with_geoip2:BuildRequires: libmaxminddb-devel} BuildRequires: libnet-devel >= 1:1.1.2.1-3 +%{?with_java:BuildRequires: librdkafka-devel >= 1.1.0} BuildRequires: libtool >= 2:2.0 BuildRequires: libwrap-devel BuildRequires: libxslt-progs @@ -220,6 +223,20 @@ HTTP destination support module for syslog-ng (via libcurl). %description module-http -l pl.UTF-8 Moduł sysloga-ng do obsługi zapisu logów poprzez HTTP (via libcurl). +%package module-java +Summary: Java destination support module for syslog-ng +Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów przy pomocy Java +Group: Libraries +Requires: %{name} = %{version}-%{release} +Requires: librdkafka >= 1.1.0 +Requires: %{name}-module-json-plugin = %{version}-%{release} + +%description module-java +Java destination support module for syslog-ng + +%description module-java -l pl.UTF-8 +Moduł sysloga-ng do obsługi zapisu logów przy pomocy Java + %package module-json-plugin Summary: JSON formatting template function for syslog-ng Summary(pl.UTF-8): Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON @@ -234,6 +251,19 @@ JSON formatting template function for syslog-ng. %description module-json-plugin -l pl.UTF-8 Moduł sysloga-ng do obsługi szablonów z formatowaniem JSON. +%package module-python +Summary: Python destination support module for syslog-ng +Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów przy pomocy pythona +Group: Libraries +Requires: %{name} = %{version}-%{release} +Requires: python3 + +%description module-python +Python destination support module for syslog-ng + +%description module-python -l pl.UTF-8 +Moduł sysloga-ng do obsługi zapisu logów przy pomocy pythona + %package module-redis Summary: Redis destination support module for syslog-ng Summary(pl.UTF-8): Moduł sysloga-ng do obsługi zapisu logów w bazie Redis @@ -341,11 +371,13 @@ cp -p %{SOURCE5} contrib/syslog-ng.conf.simple --with-module-dir=%{moduledir} \ --with-pidfile-dir=/var/run \ --with-timezone-dir=%{_datadir}/zoneinfo \ + --with-python-packages=none \ %{__enable_disable amqp} \ %{__enable_disable geoip2} \ --enable-http%{!?with_http:=no} \ --enable-ipv6 \ --enable-json%{!?with_json:=no} \ + %{__enable_disable java kafka} \ --enable-linux-caps \ --enable-manpages \ --enable-pacct \ @@ -355,7 +387,7 @@ cp -p %{SOURCE5} contrib/syslog-ng.conf.simple --enable-smtp%{!?with_smtp:=no} \ --enable-spoof-source \ --enable-ssl \ - --enable-systemd=no \ + --disable-systemd \ --enable-tcp-wrapper \ %if %{with sql} --enable-sql \ @@ -368,7 +400,6 @@ cp -p %{SOURCE5} contrib/syslog-ng.conf.simple %{__make} - %if %{with tests} LD_LIBRARY_PATH=$(find $PWD -name '*.so*' -printf "%h:") PYTHONPATH=$(pwd)/tests/functional @@ -420,6 +451,16 @@ ln -s "%{name}" $RPM_BUILD_ROOT/etc/sysconfig/%{name}@default %{__rm} $RPM_BUILD_ROOT%{moduledir}/*.la %{__rm} $RPM_BUILD_ROOT%{moduledir}/loggen/*.la +%if %{with python} +%{__rm} -rf $RPM_BUILD_ROOT%{_sysconfdir}/syslog-ng/python +%else +%{__rm} $RPM_BUILD_ROOT%{_bindir}/syslog-ng-update-virtualenv +%endif + +%if !%{with java} +%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/syslog-ng/include/scl/{elasticsearch,hdfs,kafka} +%endif + %clean rm -rf $RPM_BUILD_ROOT @@ -504,7 +545,6 @@ exit 0 %attr(755,root,root) %{moduledir}/libgeoip2-plugin.so %endif %attr(755,root,root) %{moduledir}/libgraphite.so -%attr(755,root,root) %{moduledir}/libkafka.so %attr(755,root,root) %{moduledir}/libhook-commands.so %attr(755,root,root) %{moduledir}/libkvformat.so %attr(755,root,root) %{moduledir}/liblinux-kmsg-format.so @@ -535,22 +575,19 @@ exit 0 %attr(755,root,root) %{_bindir}/slogkey %attr(755,root,root) %{_bindir}/slogverify %attr(755,root,root) %{_bindir}/update-patterndb +%if %{with python} %attr(755,root,root) %{_bindir}/syslog-ng-update-virtualenv +%endif %dir %{_datadir}/syslog-ng/include %dir %{_datadir}/syslog-ng/include/scl %{_datadir}/syslog-ng/include/scl/apache %{_datadir}/syslog-ng/include/scl/checkpoint -%{_datadir}/syslog-ng/include/scl/cee %{_datadir}/syslog-ng/include/scl/cisco %{_datadir}/syslog-ng/include/scl/collectd %{_datadir}/syslog-ng/include/scl/default-network-drivers -%{_datadir}/syslog-ng/include/scl/discord %{_datadir}/syslog-ng/include/scl/fortigate %{_datadir}/syslog-ng/include/scl/graphite -%{_datadir}/syslog-ng/include/scl/hdfs -%{_datadir}/syslog-ng/include/scl/kafka -#%{_datadir}/syslog-ng/include/scl/kubernetes %{_datadir}/syslog-ng/include/scl/iptables %{_datadir}/syslog-ng/include/scl/junos %{_datadir}/syslog-ng/include/scl/linux-audit @@ -569,9 +606,7 @@ exit 0 %{_datadir}/syslog-ng/include/scl/rewrite %{_datadir}/syslog-ng/include/scl/snmptrap %{_datadir}/syslog-ng/include/scl/solaris -%{_datadir}/syslog-ng/include/scl/splunk %{_datadir}/syslog-ng/include/scl/sudo -%{_datadir}/syslog-ng/include/scl/sumologic %{_datadir}/syslog-ng/include/scl/websense %{_datadir}/syslog-ng/include/scl/windowseventlog %dir %{_datadir}/syslog-ng/include/scl/syslogconf @@ -635,18 +670,39 @@ exit 0 %{_datadir}/syslog-ng/include/scl/telegram %endif +%if %{with java} +%files module-java +%defattr(644,root,root,755) +%attr(755,root,root) %{moduledir}/libkafka.so +%attr(755,root,root) %{moduledir}/libmod-java.so +%{moduledir}/java-modules +%{_datadir}/syslog-ng/include/scl/elasticsearch +%{_datadir}/syslog-ng/include/scl/hdfs +%{_datadir}/syslog-ng/include/scl/kafka +%endif + %if %{with json} %files module-json-plugin %defattr(644,root,root,755) %attr(755,root,root) %{moduledir}/libjson-plugin.so +%{_datadir}/syslog-ng/include/scl/cee %{_datadir}/syslog-ng/include/scl/cim -%{_datadir}/syslog-ng/include/scl/elasticsearch +%{_datadir}/syslog-ng/include/scl/discord %{_datadir}/syslog-ng/include/scl/ewmm %{_datadir}/syslog-ng/include/scl/graylog2 %{_datadir}/syslog-ng/include/scl/loggly %{_datadir}/syslog-ng/include/scl/logmatic %{_datadir}/syslog-ng/include/scl/netskope %{_datadir}/syslog-ng/include/scl/slack +%{_datadir}/syslog-ng/include/scl/splunk +%{_datadir}/syslog-ng/include/scl/sumologic +%endif + +%if %{with python} +%files module-python +%defattr(644,root,root,755) +%attr(755,root,root) %{moduledir}/libmod-python.so +%{moduledir}/python %endif %if %{with redis} -- 2.46.0