Search
j0ke.net Open Build Service
>
Projects
>
ha
:
firewall
>
barnyard2
> barnyard2.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File barnyard2.spec of Package barnyard2
# $Id$ # Snort.org's SPEC file for Snort ################################################################ # rpmbuild Package Options # ======================== # --with mysql # Builds a binary/package with support for MySQL. # # --with postgresql # Builds a binary/package with support for PostgreSQL. # # --with oracle # Builds a binary/package with support for Oracle. # # See pg 399 of _Red_Hat_RPM_Guide_ for rpmbuild --with and --without options. ################################################################ # Other useful bits %define OracleHome /opt/oracle/OraHome1 %define SnortRulesDir %{_sysconfdir}/snort/rules %define noShell /bin/false # Default of no MySQL, but --with mysql will enable it %define mysql 0 %{?_with_mysql:%define mysql 1} # Default of no PostgreSQL, but --with postgresql will enable it %define postgresql 0 %{?_with_postgresql:%define postgresql 1} # Default of no Oracle, but --with oracle will enable it %define oracle 0 %{?_with_oracle:%define oracle 1} # build git version or stable release %define git 0 %{?_with_git:%define git 1} %define realname barnyard2 %if 0%{?opensuse_bs} %define vendor Linux-Adminstrator Networks %define for_distro RPMs for (open)SuSE(Enterprise)/CentOS/RHEL/Fedora Linux %define mysql 1 %define postgresql 1 %define release 1 %define git 0 %endif Summary: Snort Log Backend Name: barnyard2 %if %{git} Version: 1.10.0.1 %else Version: 1.13 %endif Release: 1%{?dist} License: GPL Group: Applications/Internet %if %{git} Source0: %{name}-git.tar.bz2 %else Source0: %{name}-%{version}.tar.bz2 %endif Source2: %{name}.sysconfig %if 0%{?suse_version} Source3: %{name}-suse.init %else Source3: %{name}-rh.init %endif Patch0: %{name}-config.patch Patch1: %{name}-syslog-full.patch Patch2: %{name}-etc-Makefile.patch Url: http://www.securixlive.com/barnyard2/ BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: libpcap-devel %if %{git} BuildRequires: libtool BuildRequires: autoconf automake %if (0%{?centos_version} >= 5 && 0%{?centos_version} < 6) || (0%{?rhel_version} >= 500 && 0%{?rhel_version} < 600) BuildRequires: which %endif %if 0%{?suse_version} BuildRequires: util-linux %endif %endif %description Barnyard has 3 modes of operation: One-shot, continual, continual w/ checkpoint. In one-shot mode, barnyard will process the specified file and exit. In continual mode, barnyard will start with the specified file and continue to process new data (and new spool files) as it appears. Continual mode w/ checkpointing will also use a checkpoint file (or waldo file in the snort world) to track where it is. In the event the barnyard process ends while a waldo file is in use, barnyard will resume processing at the last entry as listed in the waldo file. %package mysql Summary: barnyard2 with MySQL support Group: Applications/Internet Requires: %{name} = %{epoch}:%{version}-%{release} %if %{mysql} Requires: mysql BuildRequires: mysql-devel %endif %description mysql barnyard2 binary compiled with mysql support. %package postgresql Summary: barnyard2 with PostgreSQL support Group: Applications/Internet Requires: %{name} = %{epoch}:%{version}-%{release} %if %{postgresql} Requires: postgresql BuildRequires: postgresql-devel >= 9.1 %endif %description postgresql barnyard2 binary compiled with postgresql support. %package oracle Summary: barnyard2 with Oracle support Group: Applications/Internet Requires: %{name} = %{epoch}:%{version}-%{release} %description oracle barnyard2 binary compiled with Oracle support. EXPERIMENTAL!! I don't have a way to test this, so let me know if it works! ORACLE_HOME=%{OracleHome} %prep %if %{git} %setup -q -n %{name} %patch1 %patch2 %else %setup -q -n %{name}-%{version} %endif %patch0 %build [ ! -f configure ] && ./autogen.sh %configure --sysconfdir=%{_sysconfdir}/snort \ --enable-ipv6 \ --enable-gre \ --enable-mpls \ %if %{postgresql} --with-postgresql \ %endif %if %{oracle} --with-oracle \ %endif %if %{mysql} --with-mysql-libraries=/usr/%{_lib} \ %endif %__make %install %__make DESTDIR=%{buildroot} install %{__install} -d -p $RPM_BUILD_ROOT%{_sysconfdir}/snort %{__install} -d -p $RPM_BUILD_ROOT%{_mandir}/man8 %{__install} -m 644 etc/barnyard2.conf $RPM_BUILD_ROOT%{_sysconfdir}/snort/ %if 0%{?suse_version} %{__install} -d -p $RPM_BUILD_ROOT%{_sbindir} %{__install} -D -m 644 %{S:2} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name} %{__install} -D -m 755 %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/%{name} ln -sf ../../etc/init.d/%{name} $RPM_BUILD_ROOT%{_sbindir}/rc%{name} %else %{__install} -D -m 644 %{S:2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name} %{__install} -D -m 755 %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name} %endif %{__install} -d -m 755 $RPM_BUILD_ROOT/var/log/%{name} %clean if [ -d $RPM_BUILD_ROOT ] && [ "$RPM_BUILD_ROOT" != "/" ] ; then rm -rf $RPM_BUILD_ROOT fi %post %if 0%{?suse_version} %fillup_and_insserv %endif %preun %if 0%{?suse_version} %stop_on_removal %endif %postun %if 0%{?suse_version} %insserv_cleanup %endif %files %defattr(-,root,root) %doc LICENSE doc/README* schemas/create* %attr(755,root,root) %{_bindir}/barnyard2 %dir %{_sysconfdir}/snort %dir /var/log/%{name} %attr(640,root,root) %config(noreplace) %{_sysconfdir}/snort/barnyard2.conf %if 0%{?suse_version} %attr(755,root,root) %config %{_sysconfdir}/init.d/barnyard2 %attr(644,root,root) /var/adm/fillup-templates/sysconfig.barnyard2 %attr(755,root,root) %{_sbindir}/rc%{name} %else %attr(755,root,root) %config %{_sysconfdir}/rc.d/init.d/barnyard2 %attr(644,root,root) %config %{_sysconfdir}/sysconfig/barnyard2 %endif %changelog