Riccardo Schirone 8ee4cd7
Name:           rizin
Riccardo Schirone 8ee4cd7
Summary:        UNIX-like reverse engineering framework and command-line tool-set
Riccardo Schirone 4617338
Version:        0.2.0
Riccardo Schirone 8ee4cd7
URL:            https://rizin.re/
Riccardo Schirone 8ee4cd7
VCS:            https://github.com/rizinorg/rizin
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%global         gituser         rizinorg
Riccardo Schirone 8ee4cd7
%global         gitname         rizin
Riccardo Schirone 68815e1
%global         rel             2
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Release:        %{rel}%{?dist}
Riccardo Schirone 4617338
Source0:        https://github.com/%{gituser}/%{gitname}/releases/download/v%{version}/%{name}-src-v%{version}.tar.xz
Riccardo Schirone 8ee4cd7
Riccardo Schirone 330bd26
# This patch is required to avoid exporting symbols of subprojects
Riccardo Schirone 330bd26
# See https://github.com/rizinorg/rizin/pull/1050
Riccardo Schirone 330bd26
Patch1:         rizin-avoid-symbols-clashing.patch
Riccardo Schirone 330bd26
Riccardo Schirone 8ee4cd7
License:        LGPLv3+ and GPLv2+ and BSD and MIT and ASL 2.0 and MPLv2.0 and zlib
Riccardo Schirone 8ee4cd7
# Rizin as a package is targeting to be licensed/compiled as LGPLv3+
Riccardo Schirone 8ee4cd7
# however during build for Fedora the GPL code is not omitted so effectively it
Riccardo Schirone 8ee4cd7
# is GPLv2+.
Riccardo Schirone 8ee4cd7
#
Riccardo Schirone 8ee4cd7
# Some code has originally different license:
Riccardo Schirone 8ee4cd7
# librz/asm/arch/ - GPLv2+, MIT, GPLv3
Riccardo Schirone 8ee4cd7
# librz/bin/format/pe/dotnet - Apache License Version 2.0
Riccardo Schirone 8ee4cd7
# librz/util/qrcode.c - MIT
Riccardo Schirone 8ee4cd7
# shlr/java - Apache 2.0
Riccardo Schirone 8ee4cd7
# shlr/sdb/src - MIT
Riccardo Schirone 8ee4cd7
# shlr/lz4 - 3 clause BSD (system installed shared lz4 is used instead)
Riccardo Schirone 8ee4cd7
# shlr/spp - MIT
Riccardo Schirone 8ee4cd7
# shlr/tcc - LGPLv2+
Riccardo Schirone 8ee4cd7
# shlr/udis86 - 2 clause BSD
Riccardo Schirone 8ee4cd7
# shlr/spp - MIT
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
BuildRequires:  gcc
Riccardo Schirone 8ee4cd7
BuildRequires:  meson
Riccardo Schirone 8ee4cd7
BuildRequires:  ninja-build
Riccardo Schirone 8ee4cd7
BuildRequires:  file-devel
Riccardo Schirone 8ee4cd7
BuildRequires:  xxhash-devel
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig(bzip2)
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig(libzip)
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig(zlib)
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig(liblz4)
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig(capstone) >= 3.0.4
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig(libuv)
Riccardo Schirone 8ee4cd7
BuildRequires:  pkgconfig(openssl)
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Requires:       %{name}-common = %{version}-%{release}
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# Package contains several bundled libraries that are used in Fedora builds
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# ./shlr/spp/README.md
Riccardo Schirone 8ee4cd7
# SPP stands for Simple Pre-Processor, a templating language.
Riccardo Schirone 8ee4cd7
# https://github.com/rizinorg/spp
Riccardo Schirone 8ee4cd7
Provides:       bundled(spp) = 1.2.0
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# ./shlr/sdb/README.md
Riccardo Schirone 8ee4cd7
# sdb is a simple string key/value database based on djb's cdb
Riccardo Schirone 8ee4cd7
# https://github.com/rizinorg/sdb
Riccardo Schirone 4617338
Provides:       bundled(sdb) = 248f8950580ef344430603d408a08b4fd6664744
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# ./shlr/sdb/src/json/README
Riccardo Schirone 8ee4cd7
# https://github.com/quartzjer/js0n
Riccardo Schirone 8ee4cd7
# JSON support for sdb
Riccardo Schirone 8ee4cd7
Provides:       bundled(js0n)
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# librz/util/regex/README
Riccardo Schirone 8ee4cd7
# Modified OpenBSD regex to be portable
Riccardo Schirone 8ee4cd7
# cvs -qd anoncvs@anoncvs.ca.openbsd.org:/cvs get -P src/lib/libc/regex
Riccardo Schirone 8ee4cd7
# version from 2010/11/21 00:02:30, version of files ranges from v1.11 to v1.20
Riccardo Schirone 8ee4cd7
Provides:       bundled(openbsdregex) = 1.11
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# ./shlr/tcc/README.md
Riccardo Schirone 8ee4cd7
# This is a stripped down version of tcc without the code generators and heavily modified.
Riccardo Schirone 8ee4cd7
Provides:       bundled(tcc) = 0.9.26
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# ./librz/asm/arch/tricore/README.md
Riccardo Schirone 8ee4cd7
# Based on code from https://www.hightec-rt.com/en/downloads/sources/14-sources-for-tricore-v3-3-7-9-binutils-1.html
Riccardo Schirone 8ee4cd7
# part of binutils to read machine code for Tricore architecture
Riccardo Schirone 8ee4cd7
# ./librz/asm/arch/ppc/gnu/
Riccardo Schirone 8ee4cd7
# part of binutils to read machine code for ppc architecture
Riccardo Schirone 8ee4cd7
# ./librz/asm/arch/arm/gnu/
Riccardo Schirone 8ee4cd7
Provides:       bundled(binutils) = 2.13
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
# ./librz/asm/arch/avr/README
Riccardo Schirone 8ee4cd7
# * This code has been ripped from vavrdisasm 1.6
Riccardo Schirone 8ee4cd7
Provides:       bundled(vavrdisasm) = 1.6
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%description
Riccardo Schirone 8ee4cd7
Rizin is a free and open-source Reverse Engineering framework, providing a
Riccardo Schirone 8ee4cd7
complete binary analysis experience with features like Disassembler,
Riccardo Schirone 8ee4cd7
Hexadecimal editor, Emulation, Binary inspection, Debugger, and more.
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Rizin is a fork of radare2 with a focus on usability, working features and code
Riccardo Schirone 8ee4cd7
cleanliness.
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%package devel
Riccardo Schirone 8ee4cd7
Summary:        Development files for the rizin package
Riccardo Schirone 8ee4cd7
Requires:       %{name}%{?_isa} = %{version}-%{release}
Riccardo Schirone 8ee4cd7
Requires:       file-devel
Riccardo Schirone 8ee4cd7
Requires:       openssl-devel
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%description devel
Riccardo Schirone 8ee4cd7
Development files for the rizin package. See rizin package for more
Riccardo Schirone 8ee4cd7
information.
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%package common
Riccardo Schirone 8ee4cd7
Summary:        Arch-independent SDB files for the rizin package
Riccardo Schirone 8ee4cd7
BuildArch:      noarch
Riccardo Schirone 8ee4cd7
Requires:       %{name} = %{version}-%{release}
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%description common
Riccardo Schirone 8ee4cd7
Arch-independent SDB files used by rizin package. See rizin package for more
Riccardo Schirone 8ee4cd7
information
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%prep
Riccardo Schirone 8ee4cd7
# Build from git release version
Riccardo Schirone 4617338
%setup -n %{gitname}-v%{version}
Riccardo Schirone 330bd26
%patch1 -p1
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%build
Riccardo Schirone 8ee4cd7
# Whereever possible use the system-wide libraries instead of bundles
Riccardo Schirone 8ee4cd7
%meson \
Riccardo Schirone 4617338
    -Duse_sys_magic=enabled \
Riccardo Schirone 4617338
    -Duse_sys_libzip=enabled \
Riccardo Schirone 4617338
    -Duse_sys_zlib=enabled \
Riccardo Schirone 4617338
    -Duse_sys_lz4=enabled \
Riccardo Schirone 4617338
    -Duse_sys_xxhash=enabled \
Riccardo Schirone 4617338
    -Duse_sys_openssl=enabled \
Riccardo Schirone 4617338
    -Duse_sys_libuv=enabled \
Riccardo Schirone 4617338
    -Duse_sys_capstone=enabled \
Riccardo Schirone 8ee4cd7
%ifarch s390x
Riccardo Schirone 8ee4cd7
    -Ddebugger=false \
Riccardo Schirone 8ee4cd7
%endif
Riccardo Schirone 8ee4cd7
    -Denable_tests=false \
Riccardo Schirone 8ee4cd7
    -Denable_rz_test=false \
Riccardo Schirone 4617338
    -Dlocal=disabled \
Riccardo Schirone 4617338
    -Dpackager="Fedora" \
Riccardo Schirone 4617338
    -Dpackager_version="%{version}-%{release}"
Riccardo Schirone 8ee4cd7
%meson_build
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%install
Riccardo Schirone 8ee4cd7
%meson_install
Riccardo Schirone 8ee4cd7
%ldconfig_scriptlets
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%check
Riccardo Schirone 8ee4cd7
# Do not run the unit testsuite yet - it pulls another big repository
Riccardo Schirone 8ee4cd7
# https://github.com/rizinorg/rizin-testbins from github
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%files
Riccardo Schirone 8ee4cd7
%doc CONTRIBUTING.md DEVELOPERS.md README.md SECURITY.md BUILDING.md
Riccardo Schirone 8ee4cd7
%license COPYING COPYING.LESSER
Riccardo Schirone 8ee4cd7
%{_bindir}/r*
Riccardo Schirone 8ee4cd7
%{_libdir}/librz_*.so.%{version}*
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/fortunes/fortunes.*
Riccardo Schirone 8ee4cd7
%{_mandir}/man1/rizin.1.*
Riccardo Schirone 8ee4cd7
%{_mandir}/man1/rz*.1.*
Riccardo Schirone 8ee4cd7
%{_mandir}/man7/rz-esil.7.*
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%files devel
Riccardo Schirone 8ee4cd7
%{_includedir}/librz
Riccardo Schirone 8ee4cd7
%{_libdir}/librz*.so
Riccardo Schirone 8ee4cd7
%{_libdir}/pkgconfig/*.pc
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%files common
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/cons
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/fcnsign
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/flag
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/format
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/hud
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/magic
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/opcodes
Riccardo Schirone 8ee4cd7
%{_datadir}/%{name}/%{version}/syscall
Riccardo Schirone 8ee4cd7
%dir %{_datadir}/%{name}
Riccardo Schirone 8ee4cd7
%dir %{_datadir}/doc/%{name}
Riccardo Schirone 8ee4cd7
%dir %{_datadir}/%{name}/%{version}
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
Riccardo Schirone 8ee4cd7
%changelog
Riccardo Schirone 68815e1
* Tue Apr 20 2021 Riccardo Schirone <rschirone91@gmail.com> - 0.2.0-2
Riccardo Schirone 68815e1
- Apply patch to avoid symbols collision
Riccardo Schirone 68815e1
Riccardo Schirone 4617338
* Mon Apr 12 2021 Riccardo Schirone <rschirone91@gmail.com> - 0.2.0-1
Riccardo Schirone 4617338
- Rebase to upstream version 0.2.0
Riccardo Schirone 4617338
Riccardo Schirone 8ee4cd7
* Tue Mar 30 2021 Riccardo Schirone <rschirone91@gmail.com> - 0.1.2-1
Riccardo Schirone 8ee4cd7
- Initial SPEC file