Blame afl.spec

Bernhard M. Wiedemann 0f905e
#
Bernhard M. Wiedemann 0f905e
# spec file for package afl
Bernhard M. Wiedemann 0f905e
#
1085f1
# Copyright (c) 2023 SUSE LLC
Bernhard M. Wiedemann 0f905e
#
Bernhard M. Wiedemann 0f905e
# All modifications and additions to the file contributed by third parties
Bernhard M. Wiedemann 0f905e
# remain the property of their copyright owners, unless otherwise agreed
Bernhard M. Wiedemann 0f905e
# upon. The license for this file, and modifications and additions to the
Bernhard M. Wiedemann 0f905e
# file, is the same license as for the pristine package itself (unless the
Bernhard M. Wiedemann 0f905e
# license for the pristine package is not an Open Source License, in which
Bernhard M. Wiedemann 0f905e
# case the license is the MIT License). An "Open Source License" is a
Bernhard M. Wiedemann 0f905e
# license that conforms to the Open Source Definition (Version 1.9)
Bernhard M. Wiedemann 0f905e
# published by the Open Source Initiative.
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 084487
# Please submit bugfixes or comments via https://bugs.opensuse.org/
Bernhard M. Wiedemann 0f905e
#
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
9a19a0
%define afl_rt compiler-rt,llvm-rt,llvm-rt-lto
9a19a0
9a19a0
%ifarch %{arm} %ix86 s390x x86_64
9a19a0
%define afl_32 1
9a19a0
%endif
9a19a0
%ifarch ppc64le
9a19a0
%if %{pkg_vcmp clang < 12}
9a19a0
%define afl_32 1
9a19a0
%endif
9a19a0
%endif
9a19a0
9a19a0
%ifarch aarch64 ppc64 ppc64le riscv64 s390x x86_64
9a19a0
%define afl_64 1
9a19a0
%endif
9a19a0
Bernhard M. Wiedemann 0f905e
Name:           afl
1085f1
Version:        4.05c
Bernhard M. Wiedemann 0f905e
Release:        0
Bernhard M. Wiedemann 0f905e
Summary:        American fuzzy lop is a security-oriented fuzzer
10fc62
#URL:            https://lcamtuf.coredump.cx/afl/
Bernhard M. Wiedemann 0f905e
License:        Apache-2.0
10fc62
URL:            https://github.com/AFLplusplus/AFLplusplus
ab8fb8
Source:         https://github.com/AFLplusplus/AFLplusplus/archive/%{version}.tar.gz
Bernhard M. Wiedemann 0f905e
Source1:        afl-rpmlintrc
837015
Patch1:         afl-3.0c-fix-paths.patch
ab8fb8
BuildRequires:  clang
Bernhard M. Wiedemann 0f905e
BuildRequires:  gcc-c++
397132
%ifarch x86_64
397132
BuildRequires:  gcc-32bit
397132
%endif
397132
%if %?suse_version >= 1550
397132
BuildRequires:  gcc-devel
397132
%endif
ab8fb8
BuildRequires:  lld
ab8fb8
BuildRequires:  llvm-devel >= 11.0.0
837015
BuildRequires:  python3-devel
ab8fb8
Requires:       lld
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
%description
Bernhard M. Wiedemann 0f905e
American fuzzy lop is a security-oriented fuzzer that employs a novel type
Bernhard M. Wiedemann 0f905e
of compile-time instrumentation and genetic algorithms to automatically
Bernhard M. Wiedemann 0f905e
discover clean, interesting test cases that trigger new internal states in
Bernhard M. Wiedemann 0f905e
the targeted binary. This substantially improves the functional coverage
Bernhard M. Wiedemann 0f905e
for the fuzzed code. The compact synthesized corpora produced by the tool
Bernhard M. Wiedemann 0f905e
are also useful for seeding other, more labor- or resource-intensive
Bernhard M. Wiedemann 0f905e
testing regimes down the road.
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
Compared to other instrumented fuzzers, afl-fuzz is designed to be
Bernhard M. Wiedemann 0f905e
practical: it has modest performance overhead, uses a variety of highly
Bernhard M. Wiedemann 0f905e
effective fuzzing strategies and effort minimization tricks, requires
Bernhard M. Wiedemann 0f905e
essentially no configuration, and seamlessly handles complex, real-world
Bernhard M. Wiedemann 0f905e
use cases - say, common image parsing or file compression libraries.
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
%prep
Bernhard M. Wiedemann 0f905e
%setup -q -n AFLplusplus-%version
Bernhard M. Wiedemann 0f905e
%patch1 -p1
ab8fb8
sed -i 's|#!/usr/bin/env sh|#!/bin/sh|g' afl-cmin
ab8fb8
sed -i 's|#!/usr/bin/env bash|#!/bin/bash|g' afl-cmin.bash
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
%build
ab8fb8
export CFLAGS="$CFLAGS %{optflags} -fno-lto"
Bernhard M. Wiedemann 0f905e
%ifnarch %{ix86} x86_64
Bernhard M. Wiedemann 0f905e
export AFL_NO_X86=1
Bernhard M. Wiedemann 0f905e
%endif
ab8fb8
make %{?_smp_mflags} PREFIX=%{_prefix} LIBEXEC_DIR=%{_libexecdir} DOC_DIR=%{_docdir}
Bernhard M. Wiedemann 9364c0
# make radamsa
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
%install
Bernhard M. Wiedemann 0f905e
%ifnarch %{ix86} x86_64
Bernhard M. Wiedemann 0f905e
export AFL_NO_X86=1
Bernhard M. Wiedemann 0f905e
%endif
Bernhard M. Wiedemann e600a5
make %{?_smp_mflags} PREFIX=%{_prefix} LIBEXEC_DIR=%{_libexecdir} DOC_DIR=%{_docdir} MAN_PATH=%{_mandir}/man8 DESTDIR=%{buildroot} install
ab8fb8
chmod -x %{buildroot}/%{_libexecdir}/%{name}/*.o
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
%files
Bernhard M. Wiedemann 7dcbe3
%license docs/COPYING LICENSE
Bernhard M. Wiedemann 7dcbe3
%doc /usr/share/doc/packages/%name/
Bernhard M. Wiedemann 0f905e
%{_bindir}/%{name}-*
Bernhard M. Wiedemann 0f905e
%dir %{_libexecdir}/%{name}
Bernhard M. Wiedemann 0f905e
%{_libexecdir}/%{name}/%{name}-as
Bernhard M. Wiedemann 0f905e
%{_libexecdir}/%{name}/as
9a19a0
%if 0%{?afl_64}
9a19a0
%{_libexecdir}/%{name}/afl-{%{afl_rt}}-64.o
837015
%endif
9a19a0
%if 0%{?afl_32}
9a19a0
%{_libexecdir}/%{name}/afl-{%{afl_rt}}-32.o
ef8c28
%endif
9a19a0
%ifarch aarch64
ab8fb8
%{_libexecdir}/%{name}/afl-llvm-rt-lto-32.o
ab8fb8
%endif
9a19a0
%{_libexecdir}/%{name}/afl-{%{afl_rt}}.o
837015
%{_libexecdir}/%{name}/dynamic_list.txt
ab8fb8
%{_libexecdir}/%{name}/*.so
50f260
%{_libexecdir}/%{name}/*.a
Bernhard M. Wiedemann 0f905e
%dir %{_datadir}/%{name}
Bernhard M. Wiedemann 0f905e
%dir %{_datadir}/%{name}/testcases
Bernhard M. Wiedemann 0f905e
%{_datadir}/%{name}/testcases/*
Bernhard M. Wiedemann 0f905e
%dir %{_datadir}/afl/dictionaries/
Bernhard M. Wiedemann 0f905e
%{_datadir}/afl/dictionaries/*
Bernhard M. Wiedemann e600a5
%{_mandir}/man8/afl*.8*
Bernhard M. Wiedemann 0f905e
Bernhard M. Wiedemann 0f905e
%changelog