# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346171520 -7200 # Node ID b663cfca750a11895f6dc33fd4f74e968a36fa8d # Parent 00e5f0537340618943b180b9b8518606e58d3c04 Update version, introduce new required daq dependency, integrated pulled pork utility, improve build portability, and correct nonportable u_int types. diff -r 00e5f0537340 -r b663cfca750a snort/snort.spec --- a/snort/snort.spec Tue Aug 28 18:31:50 2012 +0200 +++ b/snort/snort.spec Tue Aug 28 18:32:00 2012 +0200 @@ -22,9 +22,10 @@ ## # package version -%define V_snort 2.8.6 +%define V_snort 2.9.3.1 %define V_rules 2.4 %define V_oinkmaster 2.0 +%define V_pulledpork 0.6.1 # package information Name: snort @@ -37,7 +38,7 @@ Group: Monitoring License: GPL Version: %{V_snort} -Release: 20100427 +Release: 20120800 # package options %option with_fsl yes @@ -48,17 +49,17 @@ Source0: http://dl.snort.org/snort-current/snort-%{V_snort}.tar.gz Source1: http://www.snort.org/pub-bin/downloads.cgi/Download/vrt_pr/snortrules-pr-%{V_rules}.tar.gz Source2: http://switch.dl.sourceforge.net/sourceforge/oinkmaster/oinkmaster-%{V_oinkmaster}.tar.gz -Source3: snort.conf -Source4: rc.snort -Source5: fsl.snort -Source6: snort-update.sh -Patch0: snort.patch +Source3: http://pulledpork.googlecode.com/files/pulledpork-%{V_pulledpork}.tar.gz +Source4: snort.conf +Source5: rc.snort +Source6: fsl.snort +Source7: snort-update.sh # build information BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc PreReq: OpenPKG, openpkg >= 20100101, perl, perl-www, perl-sys, perl-comp -BuildPreReq: libpcap, libnet, pcre -PreReq: libpcap, libnet, pcre +BuildPreReq: daq, libdnet, pcre +PreReq: daq, libdnet, pcre %if "%{with_fsl}" == "yes" BuildPreReq: fsl PreReq: fsl @@ -101,13 +102,24 @@ url = http://sourceforge.net/projects/oinkmaster/files/ regex = oinkmaster-(__VER__)\.tar\.gz } + prog snort:pulledpork = { + version = %{V_pulledpork} + url = http://sourceforge.net/projects/oinkmaster/files/ + url = http://pulledpork.googlecode.com/files/ + regex = pulledpork-(__VER__)\.tar\.gz + } %prep %setup -q %setup -q -D -T -a 2 - %patch -p0 - %{l_shtool} subst %{l_value -s -a} \ + %setup -q -D -T -a 3 + %{l_shtool} subst \ + -e 's;\(# define.*\)/var/log/snort;\1%{l_prefix}/var/snort;' \ src/snort.h + %{l_shtool} subst \ + -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \ + src/dynamic-plugins/sf_engine/sf_snort_plugin_rc4.c \ + src/sfutil/sf_ip.h %build # configure program @@ -126,6 +138,8 @@ ./configure \ --prefix=%{l_prefix} \ --sysconfdir=%{l_prefix}/etc/snort \ + --without-odbc \ + --without-oracle \ %if "%{with_mysql}" == "yes" --with-mysql=%{l_prefix} \ %else @@ -136,20 +150,17 @@ %else --without-postgresql \ %endif - --with-libpcap-includes=%{l_prefix}/include \ - --with-libpcap-libraries=%{l_prefix}/lib \ - --with-libnet-includes=%{l_prefix}/include \ - --with-libnet-libraries=%{l_prefix}/lib \ + --with-daq-includes=%{l_prefix}/include \ + --with-daq-libraries=%{l_prefix}/lib \ --with-libpcre-includes=%{l_prefix}/include \ --with-libpcre-libraries=%{l_prefix}/lib \ --enable-perfmonitor # build program - %{l_make} %{l_mflags} + %{l_make} %{l_mflags -O} %install # create installation hierarchy - rm -rf $RPM_BUILD_ROOT %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/sbin \ $RPM_BUILD_ROOT%{l_prefix}/man/man8 \ @@ -198,7 +209,7 @@ # install oinkmaster utility ( cd oinkmaster-%{V_oinkmaster} %{l_shtool} install -c -m 755 \ - -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;g' \ + -e 's;#!/usr/bin/perl;#! %{l_prefix}/bin/perl;g' \ -e 's;/etc/oinkmaster\.conf;%{l_prefix}/etc/snort/oinkmaster.conf;' \ oinkmaster.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/oinkmaster %{l_shtool} install -c -m 644 \ @@ -211,6 +222,17 @@ oinkmaster.conf $RPM_BUILD_ROOT%{l_prefix}/etc/snort/ ) || exit $? + # install pulledpork utility + ( cd pulledpork-%{V_pulledpork} + %{l_shtool} install -c -m 755 \ + -e 's;/usr/local;%{l_prefix};g' \ + -e 's;#!/usr/bin/perl;#! %{l_prefix}/bin/perl;g' \ + pulledpork.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/pulledpork + %{l_shtool} install -c -m 644 \ + -e 's;\(temp_path\) *=.*;\1 = %{l_prefix}/var/snort/tmp;' \ + etc/*.conf $RPM_BUILD_ROOT%{l_prefix}/etc/snort/ + ) || exit $? + # install rule update utility %{l_shtool} install -c -m 755 %{l_value -s -a} \ -e 's;@V_rules@;%{V_rules};g' \