# Upstream source information. %global upstream_owner AdaCore %global upstream_name SPARKlib %global upstream_version 15 %global upstream_commit_date 20240110 %global upstream_commit b68d99beb8414e18abec224b8858477b5580b462 %global upstream_shortcommit %(c=%{upstream_commit}; echo ${c:0:7}) Name: sparklib Version: %{upstream_version} Release: %autorelease Summary: A collection of useful libraries in SPARK 2014 License: Apache-2.0 WITH LLVM-exception URL: https://github.com/%{upstream_owner}/%{upstream_name} Source0: %{url}/archive/%{upstream_commit}.tar.gz#/%{name}-%{upstream_shortcommit}.tar.gz # Project files to build a relocatable library. Source1: sparklib.gpr Source2: sparklib_light.gpr BuildRequires: gcc-gnat gprbuild # A fedora-gnat-project-common that contains the new GPRinstall macro. BuildRequires: fedora-gnat-project-common >= 3.21 Recommends: spark2014 >= 15 # Build only on architectures where GPRbuild is available. ExclusiveArch: %{GPRbuild_arches} %global common_description_en \ This package contains various libraries, such as a wide range of containers, \ as well as lemmas to use directly in user code. %description %{common_description_en} ################# ## Subpackages ## ################# %package devel Summary: Development files for SPARKlib Requires: %{name}%{?_isa} = %{version}-%{release} Requires: fedora-gnat-project-common %description devel %{common_description_en} This package contains source code and linking information for developing applications that use SPARKlib. ############# ## Prepare ## ############# %prep %autosetup -n %{upstream_name}-%{upstream_commit} -p1 # Make the "interal" projects that abstract such that `sparklib.gpr' and # `sparklib_light_internal.gpr` can extend them. sed --regexp-extended --in-place \ --expression '/^project/ { s,project,abstract project, ; t; q1 }' \ sparklib_internal.gpr \ sparklib_light_internal.gpr \ # Copy project files into the root of the source tree. cp --preserve=timestamps %{SOURCE1} sparklib.gpr cp --preserve=timestamps %{SOURCE2} sparklib_light.gpr # Preprocess all files. pushd . && cd src for f in *.ad{s,b}; do mv $f $f.in gnatprep -DSPARK_BODY_MODE=Off ${f}.in $f rm ${f}.in done popd # Scenario variables for GRPbuild project. %global scn_vars %{shrink: -XVERSION=%{version} \ -XSPARKLIB_INSTALLED=False \ -XSPARKLIB_BODY_MODE=Off } ########### ## Build ## ########### %build # Build the library. gprbuild %{GPRbuild_flags} %{scn_vars} -P sparklib.gpr ############# ## Install ## ############# %install # Install the library. %{GPRinstall} %{scn_vars} --no-build-var -P sparklib.gpr # Fix up the symbolic links to the shared libraries. ln --symbolic --force lib%{name}.so.%{version} %{buildroot}%{_libdir}/lib%{name}.so ########### ## Files ## ########### %files %license LICENSE %doc README* %{_libdir}/lib%{name}.so.%{version} %files devel %{_GNAT_project_dir}/%{name}*.gpr %{_includedir}/%{name} %dir %{_libdir}/%{name} %attr(444,-,-) %{_libdir}/%{name}/*.ali %{_libdir}/lib%{name}.so ############### ## Changelog ## ############### %changelog %autochangelog