From 8c6a40ec3cdbe9273106b8a11a09bcb1ccd84d63 Mon Sep 17 00:00:00 2001 From: Ulrik Haugen Date: Fri, 13 Jan 2017 18:09:29 +0100 Subject: [PATCH 1/5] rpm initscript: Remove pidfile comment. Systemd fails the Barnyard2 service because the specified pid file is never written. Barnyard2 as called doesn't write a pid file in that location and we can't know it will write only one pid file. --- rpm/barnyard2 | 1 - 1 file changed, 1 deletion(-) diff --git a/rpm/barnyard2 b/rpm/barnyard2 index dcbe1e7..87f3f98 100644 --- a/rpm/barnyard2 +++ b/rpm/barnyard2 @@ -9,7 +9,6 @@ # processname: barnyard2 # config: /etc/sysconfig/barnyard2 # config: /etc/snort/barnyard.conf -# pidfile: /var/lock/subsys/barnyard2.pid source /etc/rc.d/init.d/functions source /etc/sysconfig/network From 28e49be82d2e8e0ba7c38dfb7d72f8195f3b67df Mon Sep 17 00:00:00 2001 From: Ulrik Haugen Date: Mon, 16 Jan 2017 09:26:41 +0100 Subject: [PATCH 2/5] rpm spec: tune sub package requirements Wrap epoch macros in macro conditionals. Rpmbuild at least on el7 leaves the epoch macro unexpanded if not defined making rpm refuse to install sub packages because of failed dependencies. --- rpm/barnyard2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpm/barnyard2.spec b/rpm/barnyard2.spec index c8ff8c3..366c879 100644 --- a/rpm/barnyard2.spec +++ b/rpm/barnyard2.spec @@ -75,7 +75,7 @@ the last entry as listed in the waldo file. %package mysql Summary: barnyard2 with MySQL support Group: Applications/Internet -Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} %if %{mysql} Requires: mysql BuildRequires: mysql-devel @@ -86,7 +86,7 @@ barnyard2 binary compiled with mysql support. %package postgresql Summary: barnyard2 with PostgreSQL support Group: Applications/Internet -Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} %if %{postgresql} Requires: postgresql BuildRequires: postgresql-devel @@ -97,7 +97,7 @@ barnyard2 binary compiled with postgresql support. %package oracle Summary: barnyard2 with Oracle support Group: Applications/Internet -Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} %description oracle barnyard2 binary compiled with Oracle support. From e2cc2819201b27a455c74f014081df558f07f951 Mon Sep 17 00:00:00 2001 From: Ulrik Haugen Date: Mon, 16 Jan 2017 14:29:32 +0100 Subject: [PATCH 3/5] rpm spec: adjust spec file to Github Releases quirks. Replace source0 uri. Specify expected source directory name after unpacking. --- rpm/barnyard2.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpm/barnyard2.spec b/rpm/barnyard2.spec index 366c879..4dbff72 100644 --- a/rpm/barnyard2.spec +++ b/rpm/barnyard2.spec @@ -44,7 +44,7 @@ Summary: Snort Log Backend Name: barnyard2 Version: 1.14 -Source0: https://github.com/firnsy/barnyard2/archive/barnyard2-%{version}.tar.gz +Source0: https://github.com/firnsy/barnyard2/archive/v2-%{version}.tar.gz Release: 1%{?dist} License: GPL Group: Applications/Internet @@ -105,7 +105,7 @@ EXPERIMENTAL!! I don't have a way to test this, so let me know if it works! ORACLE_HOME=%{OracleHome} %prep -%setup -q +%setup -q -n %{name}-2-%{version} %build From 9a42f35bf73eca9f45d82278a53908aa0685a762 Mon Sep 17 00:00:00 2001 From: Ulrik Haugen Date: Mon, 16 Jan 2017 14:38:00 +0100 Subject: [PATCH 4/5] rpm spec: tune comments and oracle sub package description. --- rpm/barnyard2.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rpm/barnyard2.spec b/rpm/barnyard2.spec index 4dbff72..108bcb3 100644 --- a/rpm/barnyard2.spec +++ b/rpm/barnyard2.spec @@ -1,5 +1,4 @@ -# $Id$ -# Snort.org's SPEC file for Snort +# Rpm build instructions for Barnyard2 ################################################################ # rpmbuild Package Options @@ -101,7 +100,7 @@ Requires: %{name} = %{?epoch:%{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! +EXPERIMENTAL!! I do not have a way to test this, so let me know if it works! ORACLE_HOME=%{OracleHome} %prep From 135e357ee220f54a00f1c5aa8c7c1dc3f094db6d Mon Sep 17 00:00:00 2001 From: Ulrik Haugen Date: Wed, 24 Jul 2019 17:50:28 +0200 Subject: [PATCH 5/5] Document buildrequires daq-devel --- rpm/barnyard2.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/rpm/barnyard2.spec b/rpm/barnyard2.spec index 108bcb3..76bd6eb 100644 --- a/rpm/barnyard2.spec +++ b/rpm/barnyard2.spec @@ -57,6 +57,7 @@ BuildRequires: libpcap1-devel BuildRequires: libpcap-devel %endif BuildRequires: libdnet-devel +BuildRequires: daq-devel %description