| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- ##
- ## sec.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## 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 version
- %define V_dist 2.3.3
- %define V_opkg 2.3.3
- # package information
- Name: sec
- Summary: Simple Event Correlation
- URL: http://kodu.neti.ee/~risto/sec/
- Vendor: Risto Vaarandi
- Packager: OpenPKG
- Distribution: OpenPKG
- Class: PLUS
- Group: System
- License: Open Source
- Version: %{V_opkg}
- Release: 20060322
- # list of sources
- Source0: http://osdn.dl.sourceforge.net/simple-evcorr/sec-%{V_dist}.tar.gz
- Source1: rc.sec
- Source2: sec.conf
- Source3: sec.rule
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20040130
- PreReq: OpenPKG, openpkg >= 20040130, perl
- AutoReq: no
- AutoReqProv: no
- %description
- SEC is a tool that was designed to solve event correlation tasks
- in network and system management. Event correlation is a process
- where a stream of primitive events is processed in order to detect
- composite events that correspond to event patterns in the event
- stream. After startup SEC reads lines from files, named pipes,
- or standard input, matches the lines with regular expressions to
- recognize input events, and correlates events according to the rules
- that are specified in its configuration file. SEC can be configured
- to produce its output by executing user-specified shell commands,
- and by using utilities like snmptrap(1) or snmpnotify(1), SEC can
- generate network management events as output. Other options for
- producing output events are described further in this man page.
- %track
- prog sec = {
- version = %{V_dist}
- url = http://prdownloads.sourceforge.net/simple-evcorr/
- regex = sec-(__VER__)\.tar\.gz
- }
- %prep
- %setup -q -n sec-%{V_dist}
- %build
- %install
- # create installation hierarchy
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/bin \
- $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/etc/sec \
- $RPM_BUILD_ROOT%{l_prefix}/var/sec
- # install program and manual page
- %{l_shtool} install -c -m 755 \
- -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;' \
- sec.pl $RPM_BUILD_ROOT%{l_prefix}/bin/sec
- %{l_shtool} install -c -m 644 \
- sec.pl.man $RPM_BUILD_ROOT%{l_prefix}/man/man1/sec.1
- # install default configuration
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- %{SOURCE sec.conf} %{SOURCE sec.rule} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/sec/
- # install run-command script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.sec} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%config %{l_prefix}/etc/sec/*'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- # after upgrade, restart service
- [ $1 -eq 2 ] || exit 0
- eval `%{l_rc} sec status 2>/dev/null`
- [ ".$sec_active" = .yes ] && %{l_rc} sec restart
- exit 0
- %preun
- # before erase, stop service and remove log files
- [ $1 -eq 0 ] || exit 0
- %{l_rc} sec stop 2>/dev/null
- rm -f $RPM_INSTALL_PREFIX/var/sec/sec.* >/dev/null 2>&1 || true
- exit 0
|