3 %bcond_without mysql # don't build support for MySQL
4 %bcond_without postgresql # don't build support for PostgreSQL
8 Summary: Snort Log Backend
11 Release: 0.%{subver}.%{rel}
14 Source0: https://github.com/firnsy/barnyard2/tarball/v2-%{version}-%{subver}/%{name}-%{version}.tar.gz
15 # Source0-md5: af417a3491c5a4e5605c8fbd529f2255
16 Source2: %{name}.config
18 URL: https://github.com/firnsy/barnyard2
19 BuildRequires: autoconf
20 BuildRequires: automake
21 BuildRequires: libtool
22 %{?with_mysql:BuildRequires: mysql-devel}
23 %{?with_postgresql:BuildRequires: postgresql-devel}
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 Barnyard has 3 modes of operation: One-shot, continual, continual w/
28 checkpoint. In one-shot mode, barnyard will process the specified file
29 and exit. In continual mode, barnyard will start with the specified
30 file and continue to process new data (and new spool files) as it
31 appears. Continual mode w/ checkpointing will also use a checkpoint
32 file (or waldo file in the snort world) to track where it is. In the
33 event the barnyard process ends while a waldo file is in use, barnyard
34 will resume processing at the last entry as listed in the waldo file.
36 %{?with_mysql:barnyard2 binary compiled with mysql support.}
37 %{?with_postgresql:barnyard2 binary compiled with postgresql support.}
41 mv firnsy-%{name}-*/* .
48 %{__automake} --force-missing
50 --sysconfdir=%{_sysconfdir}/snort \
51 %{?with_postgresql:--with-postgresql} \
52 %{?with_mysql:--with-mysql-libraries=%{_libdir}} \
58 rm -rf $RPM_BUILD_ROOT
60 DESTDIR=$RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sysconfdir}/snort}
63 cp -p etc/barnyard2.conf $RPM_BUILD_ROOT%{_sysconfdir}/snort
64 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/barnyard2
65 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/barnyard2
68 rm -rf $RPM_BUILD_ROOT
71 %defattr(644,root,root,755)
73 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/snort/barnyard2.conf
74 %attr(754,root,root) /etc/rc.d/init.d/barnyard2
75 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/barnyard2
76 %attr(755,root,root) %{_bindir}/barnyard2