File bro.spec of Package bro

#
# spec file for package Bro
#
# Copyright (c) 1995-2014 The Regents of the University of California
# through the Lawrence Berkeley National Laboratory and the
# International Computer Science Institute. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# (1) Redistributions of source code must retain the above copyright
#     notice, this list of conditions and the following disclaimer.
#
# (2) Redistributions in binary form must reproduce the above copyright
#     notice, this list of conditions and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
#
# (3) Neither the name of the University of California, Lawrence Berkeley
#     National Laboratory, U.S. Dept. of Energy, International Computer
#     Science Institute, nor the names of contributors may be used to endorse
#     or promote products derived from this software without specific prior
#     written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Note that some files in the distribution may carry their own copyright
# notices.
Name:           bro
Version:        2.6.4
Release:        0
Summary:        Bro is a powerful framework for network analysis and security monitoring
Group:          Productivity/Networking/Diagnostic

License:        BSD-3-Clause
URL:            http://bro.org
Source0:        http://www.bro.org/downloads/bro-2.6.4.tar.gz
Patch0:         install-symlink-old-cmake.patch
%if 0%{?centos_version} == 600 || 0%{?scientificlinux_version} == 600 || 0%{?rhel_version} == 505
Patch1:         cmake-2.6.patch
%endif
%if 0%{?fedora_version} == 30
Patch1:         python3-patch.patch
%endif
Requires:       bro-core = %{version}
Requires:       broctl = %{version}
Requires(pre):  /usr/sbin/groupadd, /usr/bin/getent

%if %{defined rhel_version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%endif

%define _prefix /opt/bro
%define _sysconfdir %{_prefix}/etc
%define _libdir %{_prefix}/lib
%define _mandir %{_prefix}/share/man

%if 0%{?suse_version}
%define __cmake /usr/bin/cmake
%endif

%description
Bro is a powerful network analysis framework that is much different from the
typical IDS you may know.  While focusing on network security monitoring, Bro
provides a comprehensive platform for more general network traffic analysis as
well. Well grounded in more than 15 years of research, Bro has successfully
bridged the traditional gap between academia and operations since its
inception. Today, it is relied upon operationally in particular by many
scientific environments for securing their cyberinfrastructure. Bro's user
community includes major universities, research labs, supercomputing centers,
and open-science communities.

%package -n bro-core
Summary:        The core bro installation without broctl
Group:          Productivity/Networking/Diagnostic
BuildRequires: flex bison cmake openssl-devel zlib-devel python-devel swig gcc-c++
BuildRequires: libpcap-devel
%if 0%{?sle_version} >= 150000 || 0%{?suse_version} >= 1550
BuildRequires: python3
%endif

%description -n bro-core
Bro is a powerful network analysis framework that is much different from the
typical IDS you may know.  While focusing on network security monitoring, Bro
provides a comprehensive platform for more general network traffic analysis as
well. Well grounded in more than 15 years of research, Bro has successfully
bridged the traditional gap between academia and operations since its
inception. Today, it is relied upon operationally in particular by many
scientific environments for securing their cyberinfrastructure. Bro's user
community includes major universities, research labs, supercomputing centers,
and open-science communities.

%package -n bro-devel
Summary:        Development files for Bro
Group:          Productivity/Networking/Diagnostic
Requires:       bro-libcaf-devel = %{version}
Requires:       libbroker-devel = %{version}

%description -n bro-devel
Development files for Bro; these files are needed when building binary packages
for Bro.

%package -n bro-libcaf-devel
Summary:        C++ actor framework development files
Group:          System/Libraries

%description -n bro-libcaf-devel
CAF is an open source C++11 actor model implementation featuring lightweight &
fast actor implementations, pattern matching for messages, network transparent
messaging, and more.
This package bundles the library files and headers that were used during the Bro
build process; they may be needed when building packages for Bro.

%package -n libbroker-devel
Summary:        Development files for Bro's Messaging Library
Group:          System/Libraries

%description -n libbroker-devel
Broker library implements Bro's high-level communication patterns.
This package bundles the library files and headers that were used during the Bro
build process; they may be needed when building packages for Bro.

%package -n broctl
Summary:        Bro Control
Group:          Productivity/Networking/Diagnostic
%if 0%{?sle_version} == 150000
Requires: python3
%else
Requires:       python
%endif
Requires:       bro-core = %{version}
%if 0%{?suse_version}
Requires:       python-curses
%endif

%description -n broctl
BroControl is Bro's interactive shell for operating Bro installations.

%pre
/usr/bin/getent group bro >/dev/null || /usr/sbin/groupadd -r bro

%pre -n bro-core
/usr/bin/getent group bro >/dev/null || /usr/sbin/groupadd -r bro

%pre -n bro-devel
/usr/bin/getent group bro >/dev/null || /usr/sbin/groupadd -r bro

%pre -n broctl
/usr/bin/getent group bro >/dev/null || /usr/sbin/groupadd -r bro

%pre -n bro-libcaf-devel
/usr/bin/getent group bro >/dev/null || /usr/sbin/groupadd -r bro

%pre -n libbroker-devel
/usr/bin/getent group bro >/dev/null || /usr/sbin/groupadd -r bro

%prep
%setup -n bro-2.6.4 -q
# some platforms do in-source builds when using cmake. I don't really care, so just patch the error out.
find ./ -name "ProhibitInSourceBuild.cmake" | xargs -I file sh -c 'cat /dev/null > "file"'
%patch0 -p0
%if 0%{?centos_version} == 600 || 0%{?scientificlinux_version} == 600 || 0%{?rhel_version} == 505
%patch1 -p0
%endif
%if 0%{?fedora_version} == 30
%patch1 -p1
%endif

%build
./configure --prefix=%{_prefix} --binary-package --enable-static-broker
# make %{?_smp_mflags}
make

%install
rm -rf $RPM_BUILD_ROOT
%if %{defined rhel_version}
make install DESTDIR=$RPM_BUILD_ROOT
%else
%make_install
%endif
mkdir -p %{?buildroot}/opt/bro/spool/tmp
mkdir -p %{?buildroot}/opt/bro/logs
touch %{?buildroot}/opt/bro/spool/broctl-config.sh

%files

%files -n bro-core
%defattr(-,root,bro,0755)
%dir %{_prefix}
%dir %{_bindir}
%dir %{_datadir}
%dir %{_datadir}/bro
%dir %{_mandir}
%dir %{_mandir}/man1
%dir %{_mandir}/man8
%dir %{_libdir}
%dir %{_libdir}/bro
%dir %{_libdir}/bro/plugins
%{_bindir}/bro
%{_bindir}/bro-cut
%{_bindir}/bro-config
%{_bindir}/adtrace
%{_bindir}/rst
%{_datadir}/bro/base
%{_datadir}/bro/policy
%{_datadir}/bro/broxygen
%{_mandir}/man1/bro-cut.1
%{_mandir}/man8/bro.8
%defattr(0664,root,bro,2775)
%dir %{_datadir}/bro/site
%config %{_datadir}/bro/site/local.bro

%files -n broctl
%defattr(-,root,bro,0755)
%dir %{_prefix}
%dir %{_bindir}
%dir %{_datadir}
%dir %{_datadir}/bro
%dir %{_libdir}
%dir %{_libdir}/broctl
%dir %{_mandir}
%dir %{_mandir}/man1
%dir %{_mandir}/man8
%{_bindir}/broctl
%{_bindir}/capstats
%{_bindir}/trace-summary
%{_datadir}/broctl
%{_datadir}/bro/broctl
%{_libdir}/broctl/*.so
%{_libdir}/broctl/*.p*
%{_libdir}/broctl/plugins
%{_libdir}/broctl/broker
%{_libdir}/broctl/BroControl
%{_mandir}/man8/broctl.8
%{_mandir}/man1/trace-summary.1
%defattr(0664,root,bro,2775)
%dir %{_sysconfdir}
%config %{_sysconfdir}/broctl.cfg
%config %{_sysconfdir}/networks.cfg
%config %{_sysconfdir}/node.cfg
%defattr(0664,root,bro,2770)
%{_prefix}/spool
%{_prefix}/logs

%files -n bro-devel
%defattr(-,root,bro,0755)
%dir %{_prefix}
%dir %{_bindir}
%dir %{_includedir}
%dir %{_libdir}
%dir %{_datadir}
%dir %{_datadir}/bro
%{_bindir}/bifcl
%{_bindir}/binpac
%{_includedir}/binpac
%{_includedir}/bro
%{_libdir}/libbinpac.a
%{_datadir}/bro/cmake

%files -n libbroker-devel
%defattr(-,root,bro,0755)
%dir %{_prefix}
%dir %{_includedir}
%dir %{_libdir}
%{_includedir}/broker
%{_libdir}/libbroker.a

%files -n bro-libcaf-devel
%defattr(-,root,bro,0755)
%dir %{_prefix}
%dir %{_includedir}
%dir %{_libdir}
%{_includedir}/caf
%{_libdir}/libcaf_*.a

%doc CHANGES COPYING NEWS README VERSION

%changelog
* Mon Feb 09 2015 Johanna Amann <build@xxon.net> 2.6.4-0
Nightly build version specification
* Wed Jan 28 2015 Johanna Amann <build@xxon.net> 2.3.2
Update to Bro 2.3.2
* Wed Oct 29 2014 Johanna Amann <build@xxon.net> 2.3.1
Initial version
-
openSUSE Build Service is sponsored by