[syslog-ng] - update to syslog-ng-3.2.2 - cleanup spec-file

Matthias Runge mrunge at fedoraproject.org
Wed Apr 20 08:57:08 UTC 2011


commit c66f6330e1b3a12c7a9250a82e20488fc749bf11
Author: Matthias Runge <matthias.rugne at uni-oldenburg.de>
Date:   Wed Apr 20 10:56:11 2011 +0200

    - update to syslog-ng-3.2.2
    - cleanup spec-file

 .gitignore                             |    1 +
 rsyslog-3.14.1-logrotate.d-rsyslog.log |    6 -
 rsyslog-syslog-ng.sysconfig            |    3 -
 sources                                |    2 +-
 syslog-ng.conf                         |    2 +-
 syslog-ng.service                      |   11 ++
 syslog-ng.spec                         |  159 +++++++++++++++++++++-----------
 7 files changed, 119 insertions(+), 65 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ea49e64..0279e38 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 syslog-ng_3.1.1.tar.gz
+/syslog-ng-3.2.2.tar.bz2
diff --git a/sources b/sources
index 7544aa7..891d4c3 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-4fdc64ff0ad964dc811a746228609412  syslog-ng_3.1.1.tar.gz
+29604c4157328f0a9b32c0f85e7b43e0  syslog-ng-3.2.2.tar.bz2
diff --git a/syslog-ng.conf b/syslog-ng.conf
index 11bc10a..28cbe68 100644
--- a/syslog-ng.conf
+++ b/syslog-ng.conf
@@ -1,4 +1,4 @@
- at version:3.0
+ at version:3.2
 
 # syslog-ng configuration file.
 #
diff --git a/syslog-ng.service b/syslog-ng.service
new file mode 100644
index 0000000..3bb2054
--- /dev/null
+++ b/syslog-ng.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Syslog-ng System Logging Service
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/syslog-ng
+ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service
+ExecStart=/sbin/syslog-ng $SYSLOGNG_OPTIONS
+Sockets=syslog-ng.socket
+
+[Install]
+WantedBy=multi-user.target
diff --git a/syslog-ng.spec b/syslog-ng.spec
index 5d87341..bb05d89 100644
--- a/syslog-ng.spec
+++ b/syslog-ng.spec
@@ -1,57 +1,56 @@
 %{?_with_spoofsource:%define spoofsource 1}
-%define evtlog_ver 0.2.7-2
+%define evtlog_ver 0.2.12-1
 
 %define _sbindir /sbin
 %define _localstatedir /var/lib/syslog-ng
+%define _libdir /%{_lib}
 
 Name: syslog-ng
-Version: 3.1.1
+Version: 3.2.2
 Release: 2%{?dist}
 Summary: Next-generation syslog server
 
 Group: System Environment/Daemons
 License: GPLv2+
 Url: http://www.balabit.com/products/syslog_ng/
-Source0: http://www.balabit.com/downloads/files/syslog-ng/sources/3.1.1/src/%{name}_%{version}.tar.gz
+
+# git clone git://git.balabit.hu/bazsi/syslog-ng-3.2.git/
+# cd syslog-ng-3.2/
+# git archive --format=tar --prefix="syslog-ng-3.2.2/" HEAD . | bzip2 > ../syslog-ng-3.2.2.tar.bz2
+#Source0: http://www.balabit.com/downloads/files/%{name}/open-source-edition/%{version}/source/%{name}_%{version}.tar.gz
+Source0: %{name}-%{version}.tar.bz2
 Source1: syslog-ng.conf
 Source2: syslog-ng.init.d
+Source3: syslog-ng.service
 Source10: sysklogd-syslog-ng.sysconfig
-Source11: sysklogd-1.4.1-logrotate.d-syslog.log
 Source12: sysklogd-1.4.1-44-logrotate.d-syslog.log
-Source20: rsyslog-syslog-ng.sysconfig
-Source21: rsyslog-3.14.1-logrotate.d-rsyslog.log
 Source30: rsyslog-syslog-ng-fc10.sysconfig
 Source31: rsyslog-3.21.9-logrotate.d-rsyslog.log
 
-Patch0: syslog-ng-2.1.4-libnet.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires: eventlog-devel >= %{evtlog_ver}
 BuildRequires: pkgconfig
-BuildRequires: glib2-devel
-BuildRequires: pcre-devel
-%if 0%{?fedora}
-BuildRequires: glib2-static
-%endif
-%if 0%{?rhel}
-BuildRequires: tcp_wrappers
-BuildRequires: eventlog-static >= %{evtlog_ver}
+BuildRequires: glib2-devel >= 2.10.1
+BuildRequires: pcre-devel >= 7.3
+BuildRequires: openssl-devel
+BuildRequires: libdbi-devel
+
+BuildRequires: libtool
 BuildRequires: automake
-%else
+BuildRequires: autoconf
+BuildRequires: bison
+BuildRequires: flex
+BuildRequires: eventlog-devel
 BuildRequires: tcp_wrappers-devel
-%endif
 BuildRequires: libnet-devel
 Requires: logrotate
 Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/chkconfig
 Requires(preun): /sbin/service
 Requires(postun): /sbin/service
-Provides: syslog
-%if 0%{?rhel} == 4
-# makes vixie-cron and initscripts happy
-Provides: sysklogd = 1.3.33-6
-%endif
+
 # merge separate syslog-vim package into one
 Provides: syslog-ng-vim = %{version}-%{release}
 Obsoletes: syslog-ng-vim < 2.0.8-1
@@ -66,58 +65,58 @@ 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 devel
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel 
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
 
-%prep
-%if 0%{?rhel}
-%patch0 -p1 -b .libnet
-%endif
 
+%prep
 %setup -q
 
+./autogen.sh
+
 # fix perl path
 %{__sed} -i 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl
 
-# force regeneration to avoid broken paths from upstream (#265221)
-touch src/cfg-grammar.c src/cfg-lex.c
 
-%define logrotated_dst syslog
+%define logrotated_dst syslog-ng
 %if 0%{?rhel}
-	%if 0%{?rhel} <= 4
-		%define sysconfig_src %{SOURCE10}
-		%define logrotated_src %{SOURCE11}
-	%endif
 	%if 0%{?rhel} >= 5
 		%define sysconfig_src %{SOURCE10}
 		%define logrotated_src %{SOURCE12}
 	%endif
 %endif
 %if 0%{?fedora}
-	%if 0%{?fedora} <= 9
-		%define sysconfig_src %{SOURCE20}
-		%define logrotated_src %{SOURCE21}
-	%endif
-	%if 0%{?fedora} >= 10
-		%define sysconfig_src %{SOURCE30}
-		%define logrotated_src %{SOURCE31}
-	%endif
+	%define sysconfig_src %{SOURCE30}
+	%define logrotated_src %{SOURCE31}
 %endif
 
 
 %build
 %configure \
+	--prefix=/ \
+	--libdir=/%{_lib} \
+	--includedir=%{_includedir} \
 	--enable-ipv6 \
 	--sysconfdir=%{_sysconfdir}/%{name} \
 	--enable-tcp-wrapper \
 	--enable-pcre \
-%if 0%{?spoofsource}
+	--enable-shared \
+	--disable-static \
+	--enable-sql \
+	--enable-ssl \
+	--with-module-dir=/%{_lib}/%{name} \
 	--enable-spoof-source \
-%endif
-%if 0%{?rhel}
-	--enable-mixed-linking
-%else
 	--enable-dynamic-linking
-%endif
 
+# remove 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 %{_smp_mflags}
 
@@ -129,9 +128,15 @@ make DESTDIR=%{buildroot} install
 %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/%{name}
 %{__install} -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/syslog-ng.conf
 
+# install init script for fedora <=14
+%if 0%{?fedora} < 15
 %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/init.d
 %{__install} -p -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/%{name}
+%else
+# install systemd native file
 
+%{__install} -p -D -m 755 %{SOURCE3} %{buildroot}/%{_lib}/systemd/system/%{name}.service
+%endif
 %{__install} -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
 %{__install} -p -m 644 %{sysconfig_src} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
 
@@ -163,23 +168,36 @@ for vimver in 63 64 70 71 ; do
 	cd -
 done
 
+ldconfig -N -n %{buildroot}/%{_lib}
+
+find %{buildroot} -name *.la -exec rm -f '{}' \;
 
 %clean
 rm -rf %{buildroot}
 
 
 %post
-/sbin/chkconfig --add %{name}
-
+/sbin/ldconfig
+%if 0%{?fedora} < 15
+	/sbin/chkconfig --add %{name}
+%else
+	/bin/systemctl enable %{name}.service
+%endif
 
 %preun
 if [ "$1" = 0 ]; then
-	/sbin/service %{name} stop > /dev/null 2>&1
-	/sbin/chkconfig --del %{name}
+	%if 0%{?fedora} < 15
+		/sbin/service %{name} stop > /dev/null 2>&1
+		/sbin/chkconfig --del %{name}
+	%else
+		/bin/systemctl stop %{name}.service
+		/bin/systemctl disable %{name}.service
+	%endif
 fi
 
 
 %postun
+/sbin/ldconfig
 if [ "$1" -ge 1 ]; then
 	/sbin/service %{name} condrestart >/dev/null 2>&1
 fi
@@ -206,7 +224,6 @@ if [ $1 = 1 ]; then
 fi
 
 
-
 %files
 %defattr(-,root,root)
 %doc AUTHORS COPYING README ChangeLog NEWS
@@ -215,24 +232,58 @@ fi
 %doc contrib/{relogger.pl,syslog2ng,syslog-ng.conf.doc}
 %dir %{_sysconfdir}/%{name}
 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
+%config(noreplace) %{_sysconfdir}/%{name}/modules.conf
+%config(noreplace) %{_sysconfdir}/%{name}/scl.conf
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{logrotated_dst}
+%if 0%{?fedora} < 15
 %{_sysconfdir}/init.d/%{name}
+%else
+%{_libdir}/systemd/system/%{name}.service
+%endif
+
 %dir %{_localstatedir}
 %{_sbindir}/%{name}
 %{_sbindir}/syslog-ng-ctl
 %{_bindir}/loggen
 %{_bindir}/pdbtool
+%{_bindir}/update-patterndb
+%{_libdir}/lib%{name}.so.*
+%{_libdir}/%{name}/*.so
 %{_datadir}/%{name}
+
+# uhm, some better places for those?
+%{_datadir}/xsd
+
 %{_mandir}/man1/*
 %{_mandir}/man5/*
 %{_mandir}/man8/*
 %ghost %{_datadir}/vim/
 
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/libsyslog-ng.so
+%{_datadir}/include/scl
+
 
 %changelog
-* Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.1.1-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+* Wed Apr 20 2011 Matthias Runge <mrunge at matthias-runge.de> - 3.2.2-2
+- spec cleanup
+
+* Wed Apr 13 2011 Matthias Runge <mrunge at matthias-runge.de> - 3.2.2-1
+- update to 3.2.2
+- built from git snapshot
+
+* Wed Apr 06 2011 Matthias Runge <mrunge at matthias-runge.de> - 3.2.1-3
+- install to /sbin
+- native systemd start script
+
+* Thu Mar 17 2011 Matthias Runge <mrunge at matthias-runge.de> - 3.2.1-2
+- finally move libs to correct place
+- split out -devel subpackage
+
+* Fri Mar 04 2011 Matthias Runge <mrunge at fedoraproject.org> - 3.2.1-1
+- update to syslog-ng 3.2.1
 
 * Sat Jul 24 2010 Doug Warner <silfreed at fedoraproject.org> - 3.1.1-1
 - update for syslog-ng 3.1.1


More information about the scm-commits mailing list