Skip to content
Browse files

Update spec file (see Feb 2 2012 spec changelog)

  • Loading branch information...
1 parent 6820076 commit 68e6369cd9b2e3034338716c7d836528159b49b6 Brent Woodruff committed with
Showing with 43 additions and 21 deletions.
  1. +43 −21 rpm/barnyard2.spec
View
64 rpm/barnyard2.spec
@@ -13,17 +13,19 @@
# --with oracle
# Builds a binary/package with support for Oracle.
#
+# --with libpcap1
+# Uses Vincent Cojot's libpcap1-devel rpm instead of libpcap-devel
+#
# 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}
@@ -32,7 +34,11 @@
%define oracle 0
%{?_with_oracle:%define oracle 1}
-%define realname barnyard2
+# Build with libpcap1 from Vincent Cojot's snort packages
+# Default to standard libpcap, but --with libpcap1 will enable libpcap1
+# http://vscojot.free.fr/dist/snort/
+%define libpcap1 0
+%{?_with_libpcap1:%define libpcap1 1}
Summary: Snort Log Backend
@@ -42,10 +48,13 @@ Release: 1%{?dist}
License: GPL
Group: Applications/Internet
Source0: http://www.securixlive.com/download/barnyard2/%{name}-%{version}.tar.gz
-Source2: %{name}.config
-Source3: %{name}
Url: http://www.securixlive.com/barnyard2/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
+%if %{libpcap1}
+BuildRequires: libpcap1-devel
+%else
+BuildRequires: libpcap-devel
+%endif
%description
@@ -93,52 +102,65 @@ EXPERIMENTAL!! I don't have a way to test this, so let me know if it works!
ORACLE_HOME=%{OracleHome}
%prep
-%setup -q -n barnyard2-%{version}
+%setup -q
%build
-%configure --sysconfdir=%{_sysconfdir}/snort \
+%configure \
+ %if %{libpcap1}
+ --with-libpcap-includes=/usr/libpcap1/include \
+ --with-libpcap-libraries=/usr/%{_lib}/libpcap1/%{_lib} \
+ %endif
%if %{postgresql}
- --with-postgresql \
+ --with-postgresql \
%endif
%if %{oracle}
- --with-oracle \
+ --with-oracle \
%endif
%if %{mysql}
- --with-mysql-libraries=/usr/%{_lib} \
+ --with-mysql-libraries=/usr/%{_lib} \
%endif
+
make
%install
%makeinstall
%{__install} -d -p $RPM_BUILD_ROOT%{_sysconfdir}/{sysconfig,rc.d/init.d,snort}
-%{__install} -d -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/contrib
-%{__install} -d -p $RPM_BUILD_ROOT%{_mandir}/man8
-%{__install} -d -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/doc
-%{__install} -m 644 etc/barnyard2.conf $RPM_BUILD_ROOT%{_sysconfdir}/snort/
-%{__install} -m 644 $RPM_SOURCE_DIR/barnyard2.config $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/barnyard2
-%{__install} -m 755 $RPM_SOURCE_DIR/barnyard2 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/barnyard2
-%{__install} -m 644 doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/doc/
+%{__install} -m 644 rpm/barnyard2.config $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/barnyard2
+%{__install} -m 755 rpm/barnyard2 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/barnyard2
+%{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/barnyard2.conf $RPM_BUILD_ROOT%{_sysconfdir}/snort/
-#clean up file that isn't where it should be
-rm -f $RPM_BUILD_ROOT%{_sysconfdir}/barnyard2.conf
%clean
if [ -d $RPM_BUILD_ROOT ] && [ "$RPM_BUILD_ROOT" != "/" ] ; then
- rm -rf $RPM_BUILD_ROOT
+ rm -rf $RPM_BUILD_ROOT
fi
%files
%defattr(-,root,root)
-%doc LICENSE doc/
+%doc LICENSE doc/INSTALL doc/README.*
%attr(755,root,root) %{_bindir}/barnyard2
%attr(640,root,root) %config %{_sysconfdir}/snort/barnyard2.conf
%attr(755,root,root) %config %{_sysconfdir}/rc.d/init.d/barnyard2
%attr(644,root,root) %config %{_sysconfdir}/sysconfig/barnyard2
%changelog
+* Thu Feb 02 2012 Brent Woodruff <brent@fprimex.com>
+- Removed Source2 and Source3
+- Removed unused realname variable
+- Removed unused noShell variable
+- Removed unused SnortRulesDir variable
+- Added BuildRequires: libpcap-devel
+- Added --with libpcap1 option
+- Removed unneeded -n barnyard2-%{version} from setup
+- Removed empty directories created by install
+- Removed duplicate barnyard2.conf from install command
+- Add mv command to put barnyard2.conf installed by %makeinstall in /etc/snort
+ (mv instead of rm, doesn't really matter either way)
+- Changed doc/* to doc/INSTALL doc/README.*
+
* Mon Jan 10 2011 Jason Haar <jhaar@sf.net>
- updated spec file

0 comments on commit 68e6369

Please sign in to comment.
Something went wrong with that request. Please try again.