snort/snort.spec

changeset 550
b663cfca750a
parent 549
00e5f0537340
     1.1 --- a/snort/snort.spec	Tue Aug 28 18:31:50 2012 +0200
     1.2 +++ b/snort/snort.spec	Tue Aug 28 18:32:00 2012 +0200
     1.3 @@ -22,9 +22,10 @@
     1.4  ##
     1.5  
     1.6  #   package version
     1.7 -%define       V_snort      2.8.6
     1.8 +%define       V_snort      2.9.3.1
     1.9  %define       V_rules      2.4
    1.10  %define       V_oinkmaster 2.0
    1.11 +%define       V_pulledpork 0.6.1
    1.12  
    1.13  #   package information
    1.14  Name:         snort
    1.15 @@ -37,7 +38,7 @@
    1.16  Group:        Monitoring
    1.17  License:      GPL
    1.18  Version:      %{V_snort}
    1.19 -Release:      20100427
    1.20 +Release:      20120800
    1.21  
    1.22  #   package options
    1.23  %option       with_fsl    yes
    1.24 @@ -48,17 +49,17 @@
    1.25  Source0:      http://dl.snort.org/snort-current/snort-%{V_snort}.tar.gz
    1.26  Source1:      http://www.snort.org/pub-bin/downloads.cgi/Download/vrt_pr/snortrules-pr-%{V_rules}.tar.gz
    1.27  Source2:      http://switch.dl.sourceforge.net/sourceforge/oinkmaster/oinkmaster-%{V_oinkmaster}.tar.gz
    1.28 -Source3:      snort.conf
    1.29 -Source4:      rc.snort
    1.30 -Source5:      fsl.snort
    1.31 -Source6:      snort-update.sh
    1.32 -Patch0:       snort.patch
    1.33 +Source3:      http://pulledpork.googlecode.com/files/pulledpork-%{V_pulledpork}.tar.gz
    1.34 +Source4:      snort.conf
    1.35 +Source5:      rc.snort
    1.36 +Source6:      fsl.snort
    1.37 +Source7:      snort-update.sh
    1.38  
    1.39  #   build information
    1.40  BuildPreReq:  OpenPKG, openpkg >= 20100101, make, gcc
    1.41  PreReq:       OpenPKG, openpkg >= 20100101, perl, perl-www, perl-sys, perl-comp
    1.42 -BuildPreReq:  libpcap, libnet, pcre
    1.43 -PreReq:       libpcap, libnet, pcre
    1.44 +BuildPreReq:  daq, libdnet, pcre
    1.45 +PreReq:       daq, libdnet, pcre
    1.46  %if "%{with_fsl}" == "yes"
    1.47  BuildPreReq:  fsl
    1.48  PreReq:       fsl
    1.49 @@ -101,13 +102,24 @@
    1.50          url       = http://sourceforge.net/projects/oinkmaster/files/
    1.51          regex     = oinkmaster-(__VER__)\.tar\.gz
    1.52      }
    1.53 +    prog snort:pulledpork = {
    1.54 +        version   = %{V_pulledpork}
    1.55 +        url       = http://sourceforge.net/projects/oinkmaster/files/
    1.56 +        url       = http://pulledpork.googlecode.com/files/
    1.57 +        regex     = pulledpork-(__VER__)\.tar\.gz
    1.58 +    }
    1.59  
    1.60  %prep
    1.61      %setup -q
    1.62      %setup -q -D -T -a 2
    1.63 -    %patch -p0
    1.64 -    %{l_shtool} subst %{l_value -s -a} \
    1.65 +    %setup -q -D -T -a 3
    1.66 +    %{l_shtool} subst \
    1.67 +        -e 's;\(# define.*\)/var/log/snort;\1%{l_prefix}/var/snort;' \
    1.68          src/snort.h
    1.69 +    %{l_shtool} subst \
    1.70 +        -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
    1.71 +        src/dynamic-plugins/sf_engine/sf_snort_plugin_rc4.c \
    1.72 +        src/sfutil/sf_ip.h
    1.73  
    1.74  %build
    1.75      #   configure program
    1.76 @@ -126,6 +138,8 @@
    1.77      ./configure \
    1.78          --prefix=%{l_prefix} \
    1.79          --sysconfdir=%{l_prefix}/etc/snort \
    1.80 +        --without-odbc \
    1.81 +        --without-oracle \
    1.82  %if "%{with_mysql}" == "yes"
    1.83          --with-mysql=%{l_prefix} \
    1.84  %else
    1.85 @@ -136,20 +150,17 @@
    1.86  %else
    1.87          --without-postgresql \
    1.88  %endif
    1.89 -        --with-libpcap-includes=%{l_prefix}/include \
    1.90 -        --with-libpcap-libraries=%{l_prefix}/lib \
    1.91 -        --with-libnet-includes=%{l_prefix}/include \
    1.92 -        --with-libnet-libraries=%{l_prefix}/lib \
    1.93 +        --with-daq-includes=%{l_prefix}/include \
    1.94 +        --with-daq-libraries=%{l_prefix}/lib \
    1.95          --with-libpcre-includes=%{l_prefix}/include \
    1.96          --with-libpcre-libraries=%{l_prefix}/lib \
    1.97          --enable-perfmonitor
    1.98  
    1.99      #   build program
   1.100 -    %{l_make} %{l_mflags}
   1.101 +    %{l_make} %{l_mflags -O}
   1.102  
   1.103  %install
   1.104      #   create installation hierarchy
   1.105 -    rm -rf $RPM_BUILD_ROOT
   1.106      %{l_shtool} mkdir -f -p -m 755 \
   1.107          $RPM_BUILD_ROOT%{l_prefix}/sbin \
   1.108          $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
   1.109 @@ -198,7 +209,7 @@
   1.110      #   install oinkmaster utility
   1.111      ( cd oinkmaster-%{V_oinkmaster}
   1.112        %{l_shtool} install -c -m 755 \
   1.113 -          -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;g' \
   1.114 +          -e 's;#!/usr/bin/perl;#! %{l_prefix}/bin/perl;g' \
   1.115            -e 's;/etc/oinkmaster\.conf;%{l_prefix}/etc/snort/oinkmaster.conf;' \
   1.116            oinkmaster.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/oinkmaster
   1.117        %{l_shtool} install -c -m 644 \
   1.118 @@ -211,6 +222,17 @@
   1.119            oinkmaster.conf $RPM_BUILD_ROOT%{l_prefix}/etc/snort/
   1.120      ) || exit $?
   1.121  
   1.122 +    #   install pulledpork utility
   1.123 +    ( cd pulledpork-%{V_pulledpork}
   1.124 +      %{l_shtool} install -c -m 755 \
   1.125 +          -e 's;/usr/local;%{l_prefix};g' \
   1.126 +          -e 's;#!/usr/bin/perl;#! %{l_prefix}/bin/perl;g' \
   1.127 +          pulledpork.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/pulledpork
   1.128 +      %{l_shtool} install -c -m 644 \
   1.129 +          -e 's;\(temp_path\) *=.*;\1 = %{l_prefix}/var/snort/tmp;' \
   1.130 +          etc/*.conf $RPM_BUILD_ROOT%{l_prefix}/etc/snort/
   1.131 +    ) || exit $?
   1.132 +
   1.133      #   install rule update utility
   1.134      %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.135          -e 's;@V_rules@;%{V_rules};g' \

mercurial