File fingerprintls.spec of Package fingerprintls
#
# spec file for package fingerprintls
#
# Copyright (c) 2016, 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 fingerprintls_user fingerprintls
%define fingerprintls_group fingerprintls
%define fingerprintls_logdir %{_localstatedir}/log/fingerprintls
Name: fingerprintls
Version: 1.0.1.git1469943167.06b770d
Release: 0
Summary: TLS Fingerprinting
License: GPL-3.0+
Group: Productivity/Networking/Other
Url: https://github.com/LeeBrotherston/tls-fingerprinting
Source: %{name}-%{version}.tar.xz
Source1: fingerprintls.service
Source2: fingerprintls.sysconfig
Source3: fingerprintls.logrotate
Source4: usr.bin.fingerprintls
BuildRequires: libpcap-devel
BuildRequires: apparmor-profiles
Recommends: logrotate
%description
FingerprinTLS is designed to rapidly identify known TLS connections and to
fingerprint unknown TLS connections. Input is taken either via live network
sniffing or reading a PCAP file.
Output for recognized connections is (currently) in human readable form and for
unknown fingerprints in the JSON format used for the fingerprint definitions.
Fingerprints which are generated can be exported as a C struct by Fingerprintout
and compiled back into FingerprinTLS to enable detecting in future instances.
%prep
%setup -q
%build
export CFLAGS="%{optflags}"
cd fingerprintls
make VERBOSE=1 %{?_smp_mflags}
%install
install -dm0755 %{buildroot}/var/adm/fillup-templates
install -dm0750 %{buildroot}%{_localstatedir}/log/fingerprintls
install -Dpm0644 %{SOURCE2} "%{buildroot}/var/adm/fillup-templates/sysconfig.fingerprintls"
install -Dpm0644 fingerprintls/tlsfp.db %{buildroot}/%{_sysconfdir}/fingerprintls/tlsfp.db
install -Dpm0755 fingerprintls/fingerprintls %{buildroot}%{_bindir}/fingerprintls
install -Dpm0755 scripts/fingerprintout.py %{buildroot}%{_bindir}/fingerprintout
install -Dpm0755 scripts/parselog.py %{buildroot}%{_bindir}/fingerprintls-parselog
install -Dpm0644 %{SOURCE1} "%{buildroot}%{_unitdir}/fingerprintls.service"
install -Dpm0644 %{SOURCE3} "%{buildroot}%{_sysconfdir}/logrotate.d/fingerprintls"
install -dm0755 %{buildroot}/%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcfingerprintls
install -Dpm0644 %{SOURCE4} %{buildroot}/etc/apparmor.d/usr.bin.fingerprintls
%pre
getent group %{fingerprintls_group} >/dev/null || %{_sbindir}/groupadd -r %{fingerprintls_group} 2> /dev/null || :
getent passwd %{fingerprintls_user} >/dev/null || %{_sbindir}/useradd -r -g %{fingerprintls_group} -s %{_bindir}/false \
-c "Passive TLS Fingerprinting" \
-d %{fingerprintls_logdir} %{fingerprintls_user} 2> /dev/null || :
%service_add_pre fingerprintls.service
%post
%service_add_post fingerprintls.service
%{fillup_only}
%preun
%service_del_preun fingerprintls.service
%postun
%service_del_postun fingerprintls.service
%files
%defattr(-,root,root)
%doc LICENCE README.md
%{_bindir}/fingerprintls
%{_bindir}/fingerprintout
%{_bindir}/fingerprintls-parselog
%dir %{_sysconfdir}/fingerprintls
%config %{_sysconfdir}/fingerprintls/tlsfp.db
%config(noreplace) %{_sysconfdir}/logrotate.d/fingerprintls
%{_unitdir}/fingerprintls.service
%{_sbindir}/rcfingerprintls
%{_localstatedir}/log/fingerprintls
/var/adm/fillup-templates/sysconfig.fingerprintls
%config(noreplace) /etc/apparmor.d/usr.bin.fingerprintls
%changelog