%bcond_without test %global forgeurl https://github.com/ntop/nDPI %global tag %{version} %forgemeta Name: ndpi Version: 4.4 Release: 1%{?dist} Summary: Open Source Deep Packet Inspection Software Toolkit License: LGPLv3 URL: %{forgeurl} Source0: %{forgesource} Patch0: %{forgeurl}/pull/1708.patch # Cannot build docs because python-exhale and sphinxcontrib.swaggerdoc # are not packaged for Fedora. In this way at least the man page can # be generated Patch1: makedoc.patch BuildRequires: gcc BuildRequires: autoconf automake libtool BuildRequires: libpcap-devel # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} %description nDPI is an open source LGPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. %package devel Summary: Header files and development libraries for %{name} Requires: %{name} = %{version}-%{release} %description devel nDPI is an open source LGPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. This package contains the header files and development libraries for %{name}. If you like to develop programs using %{name}, you will need to install %{name}-devel. %package static Summary: Development files for %{name} Requires: %{name}-devel = %{version}-%{release} %description static nDPI is an open source LGPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. This package contains the static library. %package doc Summary: Documentation for %{name} BuildRequires: python3-sphinx python3-sphinx_rtd_theme python3-breathe Requires: %{name} = %{version}-%{release} %description doc This package contains the documentation for %{name}. %package -n python3-ndpi Summary: nDPI Python%{python3_version} modules BuildRequires: python3-devel python3-wheel BuildRequires: python3-pip python3-cffi BuildRequires: %{py3_dist setuptools} Requires: %{name} = %{version}-%{release} %description -n python3-ndpi nDPI Python%{python3_version} modules %prep %forgesetup %patch0 -p1 %patch1 -p1 rm -rf python/ndpi.egg-info %build sh autogen.sh %configure %make_build pushd doc make man popd %install %make_install install -D -m 0644 -vp packages/etc/ld.so.conf.d/ndpi.conf \ %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf install -m 755 -d %{buildroot}%{_libexecdir}/%{name}/utils install -m 755 -d %{buildroot}%{_datadir}/%{name}/examples install -m 755 -d %{buildroot}%{_datadir}/%{name}/fuzz install -m 755 -d %{buildroot}%{_datadir}/%{name}/influxdb install -m 755 -d %{buildroot}%{_datadir}/%{name}/wireshark install -D -m0644 -vp utils/* %{buildroot}%{_libexecdir}/%{name}/utils/ install -D -m0644 -vp example/*.{csv,txt,py} %{buildroot}%{_datadir}/%{name}/examples/ install -D -m0644 -vp fuzz/* %{buildroot}%{_datadir}/%{name}/fuzz/ install -D -m0644 -vp influxdb/* %{buildroot}%{_datadir}/%{name}/influxdb/ cp -rp wireshark/* %{buildroot}%{_datadir}/%{name}/wireshark/ install -D -m644 doc/_build/man/nDPI.1 %{buildroot}%{_mandir}/man1/ndpi.1 install -m 755 -d %{buildroot}%{_docdir}/%{name} install -D -m0644 -vp doc/guide/nDPI_QuickStartGuide.pdf %{buildroot}%{_docdir}/%{name}/ install -D -m0644 -vp doc/what_is_ndpi.rst %{buildroot}%{_docdir}/%{name}/ pushd python %py3_build %py3_install popd %check %if %{with tests} ./tests/do.sh # Generate and check for diff's in PCAP files ./tests/do-unit.sh # Run unit tests ./tests/do-dga.sh # Run DGA detection test %endif %files %license COPYING %doc README.md CONTRIBUTING.md CHANGELOG.md %{_bindir}/ndpiReader %{_libdir}/libndpi.so.4 %{_libdir}/libndpi.so.4.4.0 %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf %{_mandir}/man1/* %files devel %{_libexecdir}/%{name} %{_libdir}/libndpi.so %{_includedir}/%{name} %{_libdir}/pkgconfig/libndpi.pc %{_datadir}/%{name} %files static %{_libdir}/libndpi.a %files doc %{_docdir}/%{name} %files -n python3-ndpi %{python3_sitearch}/_ndpi.abi3.so %{python3_sitearch}/ndpi* %changelog * Fri Aug 19 2022 Alessio - 4.4-1 - Initial release