# The test suite isn't normally run as some of the test data must be downloaded # separately. It can be enabled with "--with=check". %bcond_with check # Upstream source information. %global upstream_owner AdaCore %global upstream_name vss-text %global upstream_version 26.0.0 %global upstream_commit 01c9adfef0efda9589fa544115628e28e26767b3 Name: vss-text Version: %{upstream_version} Release: %autorelease Summary: High level string and text processing library License: Apache-2.0 WITH LLVM-Exception AND Unicode-DFS-2016 # VSS itself is licensed under Apache 2.0 with a runtime exception. The Unicode # license is mentioned as Unicode data files were used as an input for # generating some of VSS' source code. URL: https://github.com/%{upstream_owner}/%{upstream_name} Source0: %{url}/archive/%{upstream_commit}.tar.gz#/%{upstream_name}-%{upstream_version}.tar.gz # Test data. See "data/README.md" on how to create. # # +--------------------------------------------------------+-------------+ # | Contents | License | # +--------------------------------------------------------+-------------+ # | https://www.unicode.org/Public/15.1.0/ucd/UCD.zip | Unicode-3.0 | # | https://www.unicode.org/Public/emoji/15.1/* | Unicode-3.0 | # | https://github.com/nigeltao/parse-number-fxx-test-data | Apache-2.0 | # | https://github.com/json5/json5-tests.git | MIT | # +--------------------------------------------------------+-------------+ # %if %{with check} # Open-issue: Source file cannot be found during build when using # --with=check. Works only when `bcond_without check`. Source1: vss-tests-data.tar.bz2 %endif # [Fedora-specific] Set the library so version. Patch: %{name}-set-library-so-version.patch BuildRequires: gcc-gnat gprbuild make sed # A fedora-gnat-project-common that contains the new GPRinstall macro. BuildRequires: fedora-gnat-project-common >= 3.21 %if %{with check} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-e3-testsuite %endif # Build only on architectures where GPRbuild is available. ExclusiveArch: %{GPRbuild_arches} # The implementation of packages # # - Ada.Strings.Unbounded.VSS_Aux # VSS source: source/text/gnat/a-suvsau.adb # - Ada.Strings.Wide_Wide_Unbounded.VSS_Aux # VSS source: source/text/gnat/a-szuvau.adb # # expects the unbounded string packages to implement the # "copy-on-modification" strategy, # # - Ada.Strings.Unbounded # GCC source: gcc/ada/libgnat/a-strunb__shared.ad[sb] # - Ada.Strings.Wide_Wide_Unbounded # GCC source: gcc/ada/libgnat/a-stzunb__shared.ad[sb] # # These implementations are availabe when atomic counters are available via # package System.Atomic_Counters (GCC source: gcc/ada/libgnat/s-atocou.ads), # which isn't the case for s390x. Hence VSS cannot build on s390x. ExcludeArch: s390x %global common_description_en \ The VSS-Text (as an abbreviation for Virtual String Subsystem Text) library is \ designed to provide advanced string and text processing capabilities. It \ offers a convenient and robust API that allows developers to work with \ Unicode text, regardless of its internal representation. %description %{common_description_en} ################# ## Subpackages ## ################# %package devel Summary: Development files for the VSS-Text library 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 the VSS-Text library. ############# ## Prepare ## ############# %prep %autosetup -C -p1 # Scenario variables for GRPbuild project. %global scn_vars %{shrink: -XVERSION=%{version} \ -XVSS_BUILD_PROFILE=release \ -XVSS_LIBRARY_TYPE=relocatable \ -XVSS_MAX_SUPPORTED_INTEGER_SIZE=128 \ -XVSS_OS=unix } ########### ## Build ## ########### %build gprbuild %{GPRbuild_flags} %{scn_vars} -P gnat/vss_gnat.gpr gprbuild %{GPRbuild_flags} %{scn_vars} -P gnat/vss_text.gpr ############# ## Install ## ############# %install %{GPRinstall} %{scn_vars} --no-build-var -P gnat/vss_gnat.gpr %{GPRinstall} %{scn_vars} --no-build-var -P gnat/vss_text.gpr find %{buildroot} -exec stat --format "%A %n" {} \; ls -l %{buildroot}%{_libdir} ########### ## Check ## ########### %if %{with check} %check # Unpack test data. pushd ./data tar --extract --bzip2 --file %{SOURCE1} popd # Make the files installed in the buildroot visible to the testsuite. export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH export GPR_PROJECT_PATH=%{buildroot}%{_GNAT_project_dir}:$GPR_PROJECT_PATH # Build the tests. gprbuild %{GPRbuild_flags} %{scn_vars} -cargs -fPIE -gargs \ -P gnat/tests/vss_text_tests.gpr gprbuild %{GPRbuild_flags} %{scn_vars} -cargs -fPIE -gargs \ -P gnat/tests/vss_stream_tests.gpr gprbuild %{GPRbuild_flags} %{scn_vars} -cargs -fPIE -gargs \ -P gnat/tests/vss_text_performance.gpr # NOTE: All tests are built using the libraries' build profile (i.e., # `release'). This is necessary because GCC may optimize away elaboration # routines that are expected by non-optimized build of clients. # # Example when compiling the tests with build profile `validate': # # .objs/validation/tests/test_converters: symbol lookup error: # .objs/validation/tests/test_converters: undefined symbol: vss__characters__latin___elabs # Show detailed information for failed tests. export VERBOSE_TEST_REPORT= # Run the tests. sed --in-place \ --expression 's,.objs/validation/tests,.objs/release/tests,' \ Makefile make check_text %endif ########### ## Files ## ########### %files %license LICENSE.txt %doc README* %{_libdir}/libvss-gnat.so.%{version} %{_libdir}/libvss-text.so.%{version} %files devel %{_GNAT_project_dir}/vss_gnat.gpr %{_GNAT_project_dir}/vss_text.gpr %{_includedir}/%{name} %dir %{_libdir}/%{name} %attr(444,-,-) %{_libdir}/%{name}/*.ali %{_libdir}/libvss-gnat.so %{_libdir}/libvss-text.so