Репозиторий Sisyphus
Последнее обновление: 21 октября 2019 | Пакетов: 17510 | Посещений: 15372698
en ru br
Репозитории ALT
5.1: 2.1.4-alt0.M51.1
4.1: 2.0.9-alt1
4.0: 2.0.3-alt1
3.0: 1.6.2-alt2

Группа :: Система/Ядро и оборудование
Пакет: syslog-ng

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

# chroot support
# improve modules packaging (add config examples)

%define _unpackaged_files_terminate_build 1

%def_enable geoip
%def_enable smtp
%def_enable json
%def_disable amqp
%def_enable mongodb
%def_enable curl
%def_enable systemd

# https://lists.altlinux.org/pipermail/devel/2019-March/207208.html

%def_disable unit_tests

Name: syslog-ng
Version: 3.20.1
Release: alt4

Summary: syslog-ng daemon
Group: System/Kernel and hardware
License: %gpllgpl2only
URL: https://www.syslog-ng.com

Provides: syslogd-daemon
Requires(pre): syslog-common
Conflicts: klogd < 1.4.1-alt7

Provides: libeventlog = %EVR
Obsoletes: libeventlog < %EVR

Source: %name-%version.tar.gz
# VCS git

Patch1: %name-%version-%release.patch

BuildRequires: rpm-build-licenses

# Automatically added by buildreq on Fri Apr 19 2013 (-bi)

# optimized out: elfutils libcom_err-devel libkrb5-devel pkg-config python-base python-modules
# base config:
# + PCRE
# + SQL
BuildRequires: flex autoconf-archive glib2-devel libcap-devel libdbi-devel
BuildRequires: libnet2-devel libpcre-devel libpopt-devel
BuildRequires: libssl-devel libuuid-devel libivykis-devel
BuildRequires: xsltproc docbook-style-xsl python-devel

%{?_enable_geoip:BuildRequires: libGeoIP-devel}
%{?_enable_json:BuildRequires: libjson-c-devel}
%{?_enable_smtp:BuildRequires: libesmtp-devel}
%{?_enable_amqp:BuildRequires: librabbitmq-c-devel}
%{?_enable_mongodb:BuildRequires: libmongoc-devel}
%{?_enable_curl:BuildRequires: libcurl-devel}
%{?_enable_systemd:BuildRequires: libsystemd-devel}

%if_enabled unit_tests
BuildRequires: libcriterion-devel
BuildRequires: CUnit-devel
BuildRequires: valgrind-devel

syslog-ng, as the name shows, is a syslogd replacement, but with new
functionality for the new generation. The original syslogd allows
messages only to be sorted based on priority/facility pairs; syslog-ng
adds the possibility to filter based on message contents using regular
expressions. The new configuration scheme is intuitive and powerful.
Forwarding logs over TCP and remembering all forwarding hops makes it
ideal for firewalled environments.

%package scl
Summary: SCL plugins for syslog-ng
Group: System/Libraries
BuildArch: noarch
Requires: %name = %version-%release

%description scl
Source Configuration Library plugins for syslog-ng configuration files

%package debun
Summary: DEBUg buNdle generator for syslog-ng
Group: System/Kernel and hardware
BuildArch: noarch

%description debun
The syslog-ng-debun tool collects and saves information about your
installation, making troubleshooting easier, especially if you ask
help about your related problem.

It packaged separately because it have many requirements but used
not often

%package libdbi
Summary: libdbi support for %{name}
Group: System/Libraries

%description libdbi
This module supports a large number of database systems via libdbi.

%package geoip
Summary: GeoIP support for %{name}
Group: System/Libraries

%description geoip
This module provides a function to get GeoIP info from an IPv4 address.

%package smtp
Summary: SMTP destination support for %{name}
Group: System/Libraries

%description smtp
This module provides SMTP destination support for %{name}.

%package json
Summary: JSON support for %{name}
Group: System/Libraries

%description json
This module provides JSON parsing & formatting support for %{name}.

%package amqp
Summary: AMQP support for %{name}
Group: System/Libraries

%description amqp
This module provides AMQP destination support for %{name}.

%package mongodb
Summary: mongodb support for %{name}
Group: System/Libraries

%description mongodb
This module supports the mongodb database via libmongoc

%package http
Summary: http support for %{name}
Group: System/Libraries
Provides: %name-curl = %EVR
Obsoletes: %name-curl < %EVR

%description http
The http destination can send the log as HTTP requests to an HTTP server.
It supports setting url, method, headers, user\_agent, authentication
and body. Only PUT and POST method is supported so far. If the method is
not set, POST will be used.

%package journal
Summary: Systemd journal support for %{name}
Group: System/Libraries

%description journal
This module provides JSON parsing & formatting support for %{name}.

%package python
Summary: Python destination support for syslog-ng
Requires: %name = %version-%release
Group: System/Libraries

%description python
This package provides python destination support for syslog-ng

%package -n python-module-%name-debuggercli
Summary: Debug bundle generator script
Requires: %name-python = %version-%release
Group: System/Libraries
BuildArch: noarch

%description -n python-module-%name-debuggercli
This package provides debug bundle generator script for
collecting debug related information.

%package devel
Summary: Development files for %name
Group: Development/C
Requires: %name = %version-%release  libivykis-devel
Provides: libeventlog-devel = %EVR
Obsoletes: libeventlog-devel < %EVR

%description devel
The %name-devel package contains libraries and header files for
developing applications that use %name.

%setup -q
%patch1 -p1
patch -p1 < altlinux/syslog-ng-3.19.1-README-build-config.patch

%if_enabled amqp
pushd modules/afamqp/rabbitmq-c
tar -xf ../../../altlinux/rabbitmq-c-v0.3.0-80-gc9f6312.tar.gz
autoreconf -i

# copied from "syslog-ng-3.6.1/autogen.sh"

libtoolize --force --copy
aclocal -I m4 --install
#sed -i -e 's/PKG_PROG_PKG_CONFIG(\[0\.16\])/PKG_PROG_PKG_CONFIG([0.14])/g' aclocal.m4
automake --foreign --add-missing --copy

# fix perl path

%{__sed} -i 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl

skip_submodules=1 ./autogen.sh
#add_optflags -levtlog -livykis -lgmodule-2.0 -lglib-2.0 -lpcre

# configure is searching libmongoc instead of libmongoc-1.0 via pkg-config

#export LIBMONGO_CFLAGS="-I%_includedir/libmongoc-1.0 -I%_includedir/libbson-1.0"
#export LIBMONGO_LIBS="-lsasl2 -lssl -lcrypto -lrt -lmongoc-1.0 -lbson-1.0"

%configure \
--sbindir=/sbin \
--sysconfdir=%_sysconfdir/%name \
--localstatedir=/var/lib/syslog-ng \
--datadir=%_datadir \
--mandir=%_mandir \
--with-ivykis=system \
--with-pidfile-dir=/var/run \
--with-module-dir=%_libdir/%name \
--with-systemdsystemunitdir=%_unitdir \
--enable-ipv6 \
--enable-dynamic-linking \
--enable-spoof-source \
--with-embedded-crypto \
--enable-manpages \
--disable-java \
--disable-java-modules \
%{subst_enable geoip} \
%{subst_enable smtp} \
%{subst_enable json} \
%{subst_enable amqp} \
%{subst_enable systemd} \
%if_enabled unit_tests
--enable-valgrind \
%if_enabled mongodb
%{subst_enable mongodb} \
--with-mongoc=system \


# disabled while auto* from autogen.sh is used
## fixed libraries path in RPATH
#sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
#sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

%make_build XSL_STYLESHEET=/usr/share/xml/docbook/xsl-stylesheets/manpages/docbook.xsl

%if_enabled unit_tests
make check

mkdir -p %buildroot%_initdir
make DESTDIR=%buildroot sbindir=/sbin sysconfdir=%_sysconfdir/%name \
 mandir=%_mandir prefix=%prefix install

install -m755 -D -p altlinux/%name.init %buildroot%_initdir/%name

#install -m640 -D -p altlinux/%name.conf %buildroot%_sysconfdir/%name/%name.conf

mkdir -p %buildroot%_sysconfdir/%name
VER=`echo %version | sed "s/^\([0-9]\+\.[0-9]\+\).*/\1/"`
sed "s/ at ver at /$VER/" < altlinux/%name.conf > %buildroot%_sysconfdir/%name/%name.conf
sed "s/ at ver at /$VER/" -i altlinux/conf.d.example/*.conf

# exit with 1 if "scl/*/*.conf" not found

sed '/scl\/\*\/\*.conf/{s||%_datadir/%name/include/scl/*/*.conf|;h};${x;/./{x;q0};x;q1}' -i %buildroot%_sysconfdir/%name/scl.conf

install -m640 -D -p altlinux/%name.sysconfig %buildroot%_sysconfdir/sysconfig/%name
install -m644 -D -p altlinux/%name.service %buildroot%_unitdir/%name.service
rm -f %buildroot%_unitdir/%{name} at .service

install -m644 -p config.h %buildroot%_includedir/%name

mkdir -p %buildroot%_localstatedir/%name
mkdir -p %buildroot%_sysconfdir/%name/conf.d

# installation of xsd  broken in 3.6.3

install -c -m 644 doc/xsd/patterndb-1.xsd doc/xsd/patterndb-2.xsd doc/xsd/patterndb-3.xsd doc/xsd/patterndb-4.xsd \

find %buildroot -name "*.la" -exec rm -f {} +

%post_service %name
if [ $1 = 1 ]; then
   [ -x /sbin/syslogd ] && /sbin/chkconfig --level 2345 syslogd off ||:
   [ -x /sbin/klogd ] && /sbin/chkconfig --level 2345 klogd off ||:

%triggerpostun -- %name <= 3.0.10-alt1
if [ -f %_sysconfdir/%name.conf.rpmsave ]; then
echo "legacy configuration detected, new config moved to %_sysconfdir/%name"
echo "please review and apply local changes from %_sysconfdir/%name.conf.rpmsave config!"

%preun_service %name
if [ $1 = 0 ]; then
   [ -x /sbin/syslogd ] && /sbin/chkconfig --level 2345 syslogd on ||:
   [ -x /sbin/klogd ] && /sbin/chkconfig --level 2345 klogd on ||:

%doc doc/security/*.txt
%doc contrib/{syslog2ng,syslog-ng.vim,relogger.pl,syslog-ng.conf.doc,README.syslog-ng-debun}
%doc altlinux/conf.d.example

%dir %_sysconfdir/%name
%dir %_sysconfdir/%name/patterndb.d
%dir %_sysconfdir/%name/conf.d
%config(noreplace) %_sysconfdir/%name/%name.conf
%config(noreplace) %_sysconfdir/sysconfig/%name



%dir %_libdir/%name
# basic plugin set
# added in 3.8
# added in 3.12
# added in 3.13
# added in 3.18
%dir %_libdir/%name/loggen


%dir %_datadir/%name
%dir %_datadir/%name/include
%dir %_datadir/%name/xsd

%exclude %_man1dir/%name-debun*

%dir %_localstatedir/%name

%files scl
%config(noreplace) %_sysconfdir/%name/scl.conf

%files debun

%files libdbi

%if_enabled geoip
%files geoip

%if_enabled smtp
%files smtp

%if_enabled json
%files json

%if_enabled amqp
%files amqp

%if_enabled mongodb
%files mongodb

%if_enabled curl
%files http

%if_enabled systemd
%files journal

%files python

%files -n python-module-%name-debuggercli
%dir %python_sitelibdir_noarch/syslogng/

%dir %python_sitelibdir_noarch/syslogng/debuggercli

%files devel
%dir %_includedir/%name

%dir %_datadir/%name/tools





Полный changelog можно просмотреть здесь

дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin