File yaf.spec of Package yaf

#
# spec file for package yaf
#
# Copyright (c) 2014-2025, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define soname -2_17_1-4
Name:           yaf
Version:        2.17.1
Release:        0
Summary:        Yet Another Flow Sensor
License:        GPL-2.0-only AND LGPL-2.0-only
Group:          System/Libraries
URL:            https://tools.netsa.cert.org/yaf
Source:         http://tools.netsa.cert.org/releases/%{name}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  glib2-devel >= 2.34
BuildRequires:  libp0f-devel
BuildRequires:  libpcap-devel
#BuildRequires:  pcre-devel
#[    9s] checking for libpcre >= 7.3... no
#[    9s] configure: WARNING: The application labeler engine requires the PCRE library >= 7.3 to operate, you can set the PKG_CONFIG_PATH variable to help find it. (Do you need to install pcre-devel?)
BuildRequires:  openssl-devel >= 1.0.2
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libfixbuf) >= 2.3.0
#BuildRequires:  pkgconfig(libndpi)
#BuildRequires:  pkgconfig(zlib)

%description
YAF is Yet Another Flow sensor. It processes packet data from pcap(3) dumpfiles
as generated by tcpdump(1) or via live capture from an interface using pcap(3)
or an Endace DAG card into bidirectional flows, then exports those flows to
IPFIX Collecting Processes or in an IPFIX-based file format. YAF's output can
be used with the SiLK tools, yafscii, and super_mediator.

%package -n libairframe%{soname}
Summary:        YAF Airframe Application Utility Library
License:        LGPL-2.0-only
Group:          Development/Libraries/C and C++

%description -n libairframe%{soname}
Airframe is an application utility library designed to ease the creation of
command-line applications written in C that process data from a variety of
input sources to a variety of output sources.

%package -n libyaf%{soname}
Summary:        YAF Core Library and Fragment Reassembler
License:        GPL-2.0-only
Group:          Development/Libraries/C and C++

%description -n libyaf%{soname}
The YAF Core Library (libyaf) provides YAF file and stream I/O primitives for
reading and writing YAF bidirectional flow data.
These routines are split out into a separately installed library to allow other
applications to read and write YAF IPFIX files.

%package devel
Summary:        Development files for YAF libraries
License:        GPL-2.0-only
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
YAF is Yet Another Flow sensor. It processes packet data from pcap(3) dumpfiles
as generated by tcpdump(1) or via live capture from an interface using pcap(3)
or an Endace DAG card into bidirectional flows, then exports those flows to
IPFIX Collecting Processes or in an IPFIX-based file format. YAF's output can
be used with the SiLK tools, yafscii, and super_mediator.

This subpackage contains libraries and header files for developing
applications that want to make use of libyaf/libairframe.

%package docs
Summary:        Documentation for YAF
License:        GPL-2.0-only

%description docs
YAF is Yet Another Flow sensor. It processes packet data from pcap(3) dumpfiles
as generated by tcpdump(1) or via live capture from an interface using pcap(3)
or an Endace DAG card into bidirectional flows, then exports those flows to
IPFIX Collecting Processes or in an IPFIX-based file format. YAF's output can
be used with the SiLK tools, yafscii, and super_mediator.

This subpackage contains documentation for YAF.

%prep
%autosetup

%build
#autoreconf -fiv
#    --enable-applabel
%configure
%make_build


%install
%make_install
mkdir -p %{buildroot}/%{_sysconfdir}/init.d/
#install -m0755 etc/init.d/yaf %{buildroot}/%{_sysconfdir}/init.d
install -m0644 etc/yaf.conf %{buildroot}/%{_sysconfdir}
%fdupes -s doc/html
find %{buildroot} -type f -name "*.la" -delete -print
# FIXME - better handling of p0f signatures
#rm %{buildroot}/%{_sysconfdir}/p0f.fp

%ldconfig_scriptlets -n libairframe%{soname}
%ldconfig_scriptlets -n libyaf%{soname}

%files
%license LICENSE.txt
%doc AUTHORS NEWS README
%{_bindir}/yaf
%{_bindir}/yafscii
%{_bindir}/yafcollect
%{_bindir}/airdaemon
%{_bindir}/filedaemon
%{_bindir}/getFlowKeyHash
%{_bindir}/yafMeta2Pcap
%{_mandir}/man1/*
#%{_sysconfdir}/init.d/yaf
#%%config(noreplace) %{_sysconfdir}/yafApplabelRules.conf
%config(noreplace) %{_sysconfdir}/yaf.conf
#%config(noreplace) %{_sysconfdir}/yafDPIRules.conf
#%config(noreplace) %{_sysconfdir}/dhcp_fingerprints.conf
#%config(noreplace) %{_sysconfdir}/p0f.fp
%dir %{_datadir}/yaf
%{_datadir}/yaf/yaf.init

%files -n libairframe%{soname}
%{_libdir}/libairframe-*.so.*

%files -n libyaf%{soname}
%{_libdir}/libyaf-*.so.*
#%%dir %{_libdir}/yaf/
#%%{_libdir}/yaf/*.so.*
#%%{_libdir}/yaf/*.so

%files devel
%dir %{_includedir}/airframe
%dir %{_includedir}/yaf
%{_includedir}/airframe/*.h
%{_includedir}/yaf/*.h
%{_libdir}/pkgconfig/libairframe.pc
%{_libdir}/pkgconfig/libyaf.pc
%{_libdir}/libyaf.so
%{_libdir}/libairframe.so

%files docs
%doc doc/html

%changelog
openSUSE Build Service is sponsored by