[PATCH RSB 3/4] source-builder: Add capstone

Chris Johns chrisj at rtems.org
Tue Apr 14 04:30:17 UTC 2020


What is the use case for this package?

Chris

On 10/4/20 6:21 am, Vijay Kumar Banerjee wrote:
> ---
>   bare/config/devel/capstone-4.0.1-1.cfg | 27 +++++++++++
>   bare/config/devel/capstone.bset        |  7 +++
>   source-builder/config/capstone-1-1.cfg | 62 ++++++++++++++++++++++++++
>   3 files changed, 96 insertions(+)
>   create mode 100644 bare/config/devel/capstone-4.0.1-1.cfg
>   create mode 100644 bare/config/devel/capstone.bset
>   create mode 100644 source-builder/config/capstone-1-1.cfg
> 
> diff --git a/bare/config/devel/capstone-4.0.1-1.cfg b/bare/config/devel/capstone-4.0.1-1.cfg
> new file mode 100644
> index 0000000..9f3627c
> --- /dev/null
> +++ b/bare/config/devel/capstone-4.0.1-1.cfg
> @@ -0,0 +1,27 @@
> +#
> +# Capstone from Git
> +#
> +
> +%if %{release} == %{nil}
> + %define release 1
> +%endif
> +
> +%include %{_configdir}/base.cfg
> +
> +%include %{_configdir}/bare-config.cfg
> +
> +#
> +# Capstone Version.
> +#
> +%define capstone_version 4.0.1
> +
> +#
> +# Set source from github.
> +#
> +%source set capstone --rsb-file=capstone-%{capstone_version}.tar.gz https://github.com/aquynh/capstone/archive/%{capstone_version}.tar.gz
> +%hash sha512 capstone-%{capstone_version}.tar.gz 43c52024065b41b45eff9423341db3f3d5163fa7aa01b360faa30437786740c8f2c34c36faa04dced5308e09d8bd78df3bad0ab9c06f98612169edb176f83c36
> +
> +#
> +# The build instructions.
> +#
> +%include %{_configdir}/capstone-1-1.cfg
> diff --git a/bare/config/devel/capstone.bset b/bare/config/devel/capstone.bset
> new file mode 100644
> index 0000000..d56406d
> --- /dev/null
> +++ b/bare/config/devel/capstone.bset
> @@ -0,0 +1,7 @@
> +#
> +# Build set for Capstone Disassembler
> +#
> +
> +%define release 1
> +
> +devel/capstone-4.0.1-1
> diff --git a/source-builder/config/capstone-1-1.cfg b/source-builder/config/capstone-1-1.cfg
> new file mode 100644
> index 0000000..703fd54
> --- /dev/null
> +++ b/source-builder/config/capstone-1-1.cfg
> @@ -0,0 +1,62 @@
> +#
> +#
> +# This configuration file configure's, make's and install's CAPSTONE.
> +#
> +
> +%if %{release} == %{nil}
> +%define release 1
> +%endif
> +
> +#
> +# Select Snapshot Macro Maps
> +#
> +%select capstone-snapshot
> +
> +#
> +# The description.
> +#
> +Name:      capstone-%{capstone_version}-%{_host}-%{release}
> +Summary:   Capstone is light-weight multiplatform disassembler.
> +Version:   %{capstone_version}
> +Release:   %{release}
> +URL: 	   http://www.capstone-engine.org/
> +
> +#
> +# Source
> +#
> +%source set capstone https://github.com/aquynh/capstone/archive/capstone-%{capstone_version}.tar.gz
> +%hash sha512 capstone-%{capstone_version}.tar.gz 43c52024065b41b45eff9423341db3f3d5163fa7aa01b360faa30437786740c8f2c34c36faa04dced5308e09d8bd78df3bad0ab9c06f98612169edb176f83c36
> +
> +#
> +# Prepare the source code.
> +#
> +%prep
> +  build_top=$(pwd)
> +
> +  source_dir_capstone="capstone-%{capstone_version}"
> +  %source setup capstone -q -n capstone-%{capstone_version}
> +  %patch setup capstone -p1
> +
> +  cd ${build_top}
> +
> +%build
> +  build_top=$(pwd)
> +
> +  %{build_directory}
> +
> +  cd ${source_dir_capstone}
> +
> +  %{__make} PREFIX=%{_prefix}
> +
> +  cd ${build_top}
> +
> +%install
> +  build_top=$(pwd)
> +
> +  %{__rmdir} ${SB_BUILD_ROOT}
> +
> +  cd ${source_dir_capstone}
> +
> +  %{__make} DESTDIR=$SB_BUILD_ROOT PREFIX=%{_prefix} install
> +
> +  cd ${build_top}
> 


More information about the devel mailing list