| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- ##
- ## rsyslog.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package information
- Name: rsyslog
- Summary: Enhanced Logging Server
- URL: http://www.rsyslog.com/
- Vendor: R. Gerhards, M. Meckelein
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: Logfile
- License: GPL
- Version: 3.13.0
- Release: 20080326
- # package options
- %option with_kerberos no
- %option with_mysql no
- %option with_pgsql no
- # list of sources
- Source0: http://download.rsyslog.com/rsyslog/rsyslog-%{version}.tar.gz
- Source1: rsyslog.conf
- Source2: rc.rsyslog
- Patch0: rsyslog.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823
- PreReq: OpenPKG, openpkg >= 20060823
- BuildPreReq: zlib
- PreReq: zlib
- %if "%{with_kerberos}" == "yes"
- BuildPreReq: KERBEROS
- PreReq: KERBEROS
- %endif
- %if "%{with_mysql}" == "yes"
- BuildPreReq: mysql
- PreReq: mysql
- %endif
- %if "%{with_pgsql}" == "yes"
- BuildPreReq: postgresql, openssl
- PreReq: postgresql, openssl
- %endif
- AutoReq: no
- AutoReqProv: no
- %description
- Rsyslog is an enhanced multi-threaded syslogd(8) supporting, among
- others, RDBMS, syslog/tcp, RFC 3195, permitted sender lists,
- filtering on any message part, and fine grain output format control.
- It is quite compatible to stock syslogd(8) and can be used as a
- drop-in replacement. Its advanced features make it suitable for
- enterprise-class, encryption protected syslog relay chains while at
- the same time being very easy to setup for the novice user.
- %track
- prog rsyslog = {
- version = %{version}
- url = http://download.rsyslog.com/rsyslog/
- regex = rsyslog-(\d+\.\d+\.\d+)\.tar\.gz
- }
- %prep
- %setup -q
- %patch -p0
- %build
- # configure program
- %{l_shtool} subst \
- -e 's;/etc/rsyslog.conf;%{l_prefix}/etc/rsyslog.conf;' \
- -e 's;/etc/rsyslogd.pid;%{l_prefix}/var/rsyslog/run/rsyslog.pid;' \
- -e 's;/lib/rsyslog/;%{l_prefix}/lib/rsyslog/;' \
- syslogd.c
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- CPPFLAGS="%{l_cppflags}" \
- LDFLAGS="%{l_ldflags}" \
- %if "%{with_pgsql}" == "yes"
- LIBS="`pg_config --libs`" \
- %endif
- ./configure \
- --prefix=%{l_prefix} \
- --mandir=%{l_prefix}/man \
- --enable-regexp \
- --enable-zlib \
- %if "%{with_kerberos}" == "yes"
- --enable-gssapi-krb5 \
- %endif
- %if "%{with_mysql}" == "yes"
- --enable-mysql \
- %endif
- %if "%{with_pgsql}" == "yes"
- --enable-pgsql \
- %endif
- --disable-klog
- # build program
- %{l_make} %{l_mflags}
- %install
- rm -rf $RPM_BUILD_ROOT
- # install program
- %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
- # strip down installation
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/rsyslog/*.la >/dev/null 2>&1 || true
- rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/rfc3195d
- rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/rklogd
- rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/rfc3195d.8
- rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/rklogd.8
- # install default configuration
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rsyslog
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- %{SOURCE rsyslog.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/rsyslog/
- # install run-command script
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- %{SOURCE rc.rsyslog} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # create run-time directories
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/var/rsyslog/run \
- $RPM_BUILD_ROOT%{l_prefix}/var/rsyslog/log
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/rsyslog/*'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- # after upgrade, restart service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} rsyslog status 2>/dev/null`
- [ ".$rsyslog_active" = .yes ] && %{l_rc} rsyslog restart
- exit 0
- %preun
- # before erase, stop service and remove run-time files
- [ $1 -eq 0 ] || exit 0
- %{l_rc} rsyslog stop 2>/dev/null
- rm -f $RPM_INSTALL_PREFIX/var/rsyslog/log/* >/dev/null 2>&1 || true
- rm -f $RPM_INSTALL_PREFIX/var/rsyslog/run/* >/dev/null 2>&1 || true
- exit 0
|