Summary: SME server SNORT %define name smeserver-snort Name: %{name} %define version 2.7.0.1 %define release 1 Version: %{version} Release: %{release}%{?dist} License: Freely distributable Group: Networking/Daemons Source: %{name}-%{version}.tar.gz #Patch0: %{name}-%{version}.patch.yyyymmddnn BuildRoot: /var/tmp/e-smith-buildroot BuildRequires: e-smith-devtools Requires: smeserver-release >= 7 AutoReqProv: no %changelog * Mon Aug 06 2007 Michel Van hees - Upgrade to version 2.7.0.1 - Add possibility to deactivate some rules file * Thu May 24 2007 Michel Van hees - Upgrade to version 2.6.1.5 - Should correct problem with serveronly mode * Wed Feb 21 2007 Michel Van hees - Upgrade to version 2.6.1.3 - Correct logrotate that consume to mutch time * Fri Jan 19 2007 Michel Van hees - upgrade snort to version 2.6.12 - increase rpm integration * Mon Jul 17 2006 Michel Van hees - upgrade snort version to 2.6.0 * Sun May 07 2006 Michel Van hees - Integration of snort 2.4.4 from www.adrome.org, Thanks to him * Wed Mar 22 2006 Michel Van hees - bug correction * Sat Feb 14 2006 Michel Van hees - initial release %description SME server - SNORT customization %prep %setup #%patch0 -p1 #%patch1 -p1 %build perl createlinks %install rm -rf $RPM_BUILD_ROOT (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist echo "%doc COPYING" >> %{name}-%{version}-filelist %clean rm -rf $RPM_BUILD_ROOT %pre # Don't do all this stuff if we are upgrading if [ $1 = 1 ] ; then groupadd snort 2> /dev/null || true useradd -M -d /var/log/snort -s /bin/false -c "Snort" -g snort snort 2>/dev/null || true fi # Action to be done only we upgrade if [ $1 -ge 2 ] ; then /sbin/e-smith/service snortd stop 1>/dev/null 2>/dev/null fi %preun %post # General action chown -R snort:snort /var/log/snort chown -R smelog:smelog /var/log/snortd # Action to be done only we install if [ $1 = 1 ] ; then echo ======================= Activate sme snort ================================ /sbin/e-smith/db configuration set snortd service status enabled mysql enabled HttpInspect enabled echo ======================= Creating snort_log database ======================= mysqladmin create snort_log echo ======================= Creating snort_archive database =================== mysqladmin create snort_archive echo ======================= Creating tables in snort_log ====================== mysql snort_log < /usr/share/doc/snort-2.7.0.1/contrib/create_mysql echo ======================= Creating tables in snort_archive ================== mysql snort_archive < /usr/share/doc/snort-2.7.0.1/contrib/snort_archive.sql fi # Action to be done only we upgrade /sbin/e-smith/service snortd start echo BEWARE no rules have been installed!! Install some rules in /etc/snort/rules echo or install oinkmaster %postun # Action to be done only we remove if [ $1 = 0 ] ; then if [ -L /usr/sbin/snort ]; then rm -f /usr/sbin/snort; fi /usr/sbin/userdel snort 2>/dev/null echo ========================================================================= echo == BEWARE Mysql database was not dropped ! echo == You have to drop it manually ! echo ========================================================================= rm -Rf /var/service/snortd echo ========================================================================= echo == BEWARE log directory was not erase ! echo == You have to erase it manually ! echo ========================================================================= fi # Try and restart, but don't bail if it fails if [ $1 -ge 1 ] ; then /sbin/e-smith/service snortd restart 1>/dev/null 2>/dev/null || : fi %files -f %{name}-%{version}-filelist %defattr(-,root,root)