# The test suite is normally run. It can be disabled with "--without=check". %bcond_without check # To harden the AWS executables, we need to perform a staged build during which # we first build the library and then the executables. Unfortunately, this is # harder than it seems due to the complicated Makefile. Hence, for now, we skip # hardening for this package. %undefine _hardened_build # Upstream source information. %global upstream_owner AdaCore %global upstream_name templates-parser %global upstream_version 24.0.0 %global upstream_gittag v%{upstream_version} Name: templates_parser Epoch: 2 Version: %{upstream_version} Release: 1%{?dist} Summary: The Ada web server template engine License: GPL-3.0-or-later WITH GCC-exception-3.1 AND GPL-3.0-or-later WITH GNAT-exception # The license is GPLv3+ with both the GCC and the GNAT runtime exception. # # OPEN ISSUE: What are the licenses of the manpages? Can't find a "Debian # contributors license" (or alike). URL: https://github.com/%{upstream_owner}/%{upstream_name} Source0: %{url}/archive/%{upstream_gittag}/%{upstream_name}-%{upstream_version}.tar.gz # Manpages from Debian package Source1: templates2ada.1 Source2: templatespp.1 # [Fedora-specific] Fix the library soname (Library_Version). Patch: %{name}-set-library-so-version.patch # [Fedora-specific] Don't build a static PIC library. Patch: %{name}-no-static-pic-library.patch # [Fedora-specific] Assume XML/Ada is installed. Patch: %{name}-assume-xmlada-is-installed.patch # [Fedora-specific] Use Python 3. Patch: %{name}-shebang-use-python3.patch # [Fedora-specific] Show test errors and abort if too many error. Patch: %{name}-change-test-runner-options.patch BuildRequires: gcc-gnat gprbuild make sed # A fedora-gnat-project-common that contains GPRbuild_flags is needed. BuildRequires: fedora-gnat-project-common >= 3.17 BuildRequires: xmlada-devel %if %{with check} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-e3-testsuite %endif BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme BuildRequires: python3-sphinx-latex BuildRequires: latexmk # Build only on architectures where GPRbuild is available. ExclusiveArch: %{GPRbuild_arches} %global common_description_en \ The templates parser package has been designed to parse files and to replace \ some specific tags into these files by some specified values. %description %{common_description_en} ################# ## Subpackages ## ################# %package devel Summary: Development files for the Ada web server template engine Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} Requires: fedora-gnat-project-common Requires: xmlada-devel Recommends: %{name}-doc Recommends: %{name}-tools %description devel %{common_description_en} This package contains source code and linking information for developing applications that use the Ada web server template engine. %package doc Summary: Documentation for the AWS templates engine BuildArch: noarch License: AdaCore-doc AND MIT AND BSD-2-Clause # License for the documentation is AdaCore-doc. The Javascript and CSS files # that Sphinx includes with the documentation are BSD 2-Clause and MIT-licensed. %description doc %{common_description_en} This package contains the documentation in HTML and PDF. %package tools Summary: Tools for the Ada web server template engine License: GPL-3.0-or-later %description tools %{common_description_en} This package contains the tools templates2ada and templatespp. ############# ## Prepare ## ############# %prep %autosetup -n %{upstream_name}-%{upstream_version} -p1 ########### ## Build ## ########### %build %{make_build} build GPROPTS='%{GPRbuild_flags}' VERSION='%{version}' \ DEFAULT_LIBRARY_TYPE='relocatable' ENABLE_STATIC='false' ENABLE_SHARED='true' \ VERBOSE_MAKE='true' # Make the documentation. make -C docs html latexpdf ############# ## Install ## ############# %install %{make_install} GPRINST_OPTS='--prefix=%{buildroot}%{_prefix} %{GPRinstall_flags}' \ VERBOSE_MAKE='true' # Fix up some things that GPRinstall does wrong. ln --symbolic --force lib%{name}.so.%{version} %{buildroot}%{_libdir}/lib%{name}.so # Install the man pages. mkdir --parents %{buildroot}%{_mandir}/man1 for manpage in "%SOURCE1" "%SOURCE2"; do gzip --to-stdout $manpage >> %{buildroot}%{_mandir}/man1/${manpage##*/}.gz done # Before making the project files architecture-independent, copy the buildroot # into a separate directory for later testing. The testsuite fails if applied to # the buildroot after making the project files architecture-independent because # of the hardcoded paths in `directories.gpr`. %if %{with check} %global checkroot %{_builddir}/%{upstream_name}-%{upstream_version}/checkroot mkdir %{checkroot} cp --recursive %{buildroot}/* %{checkroot}/ %endif # Make the generated usage project file architecture-independent. sed --regexp-extended --in-place \ '--expression=1i with "directories";' \ '--expression=/^-- This project has been generated/d' \ '--expression=s|^( *for +Source_Dirs +use +).*;$|\1(Directories.Includedir \& "/%{name}");|i' \ '--expression=s|^( *for +Library_Dir +use +).*;$|\1Directories.Libdir;|i' \ '--expression=s|^( *for +Library_ALI_Dir +use +).*;$|\1Directories.Libdir \& "/%{name}";|i' \ %{buildroot}%{_GNAT_project_dir}/%{name}.gpr # The Sed commands are: # 1: Insert a with clause before the first line to import the directories # project. # 2: Delete a comment that mentions the architecture. # 3: Replace the value of Source_Dirs with a pathname based on # Directories.Includedir. # 4: Replace the value of Library_Dir with Directories.Libdir. # 5: Replace the value of Library_ALI_Dir with a pathname based on # Directories.Libdir. ########### ## Check ## ########### %if %{with check} %check # Disable test that cannot be run on Fedora. cat << EOF > regtests/tests/0109_check_mem/test.yaml control: - [XFAIL, "True", "Fedora-specific: GNATmem not available on Fedora."] EOF # Make the files of this packages visible to the test runner. export PATH=%{checkroot}%{_bindir}:$PATH export LD_LIBRARY_PATH=%{checkroot}%{_libdir}:$LD_LIBRARY_PATH export GPR_PROJECT_PATH=%{checkroot}%{_GNAT_project_dir}:$GPR_PROJECT_PATH # Build the executables that are part of the test runner. %{make_build} -C regtests VERBOSE_MAKE='true' # Add the path to these executables. TARGET=$(gcc -dumpmachine) export PATH=%{_builddir}/%{upstream_name}-%{upstream_version}/.build/rbin/$TARGET/release/relocatable:$PATH # Run the actual tests. make -C regtests test VERBOSE_MAKE='true' %endif ########### ## Files ## ########### %files %license COPYING3 COPYING.RUNTIME %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 %files doc %dir %{_pkgdocdir} %{_pkgdocdir}/html %{_pkgdocdir}/pdf # Exclude Sphinx-generated files that aren't needed in the package. %exclude %{_pkgdocdir}/html/.buildinfo %exclude %{_pkgdocdir}/html/objects.inv %files tools %{_bindir}/templates2ada %{_bindir}/templatespp %attr(644,-,-) %{_mandir}/man1/*.1.gz ############### ## Changelog ## ############### %changelog * Sat May 18 2024 Dennis van Raaij - 2:24.0.0-1 - Updated to v24.0.0. - Generated HTML-documentation now uses the 'Read the Docs' Sphinx theme. - Removed patch templates_parser-no-silent-makefile.patch; use new VERBOSE_MAKE variable instead. * Sat May 18 2024 Dennis van Raaij - 2:23.0.0-1 - Updated to v23.0.0. - Included support for XML templates. * Sat May 18 2024 Dennis van Raaij - 2:22.0.0-1 - Updated to v22.0.0. - Changed the epoch to mark the new upstream version scheme. - Changed the epoch to 2 instead of 1 for consistency with the GNATcoll packages. - Dropped minimum required version for fedora-gnat-project-common. - Added build dependencies for building the documentation with Sphinx and LaTeX. - Updated the license to GPLv3+ with GCC and GNAT runtime exceptions. - License fields now contain SPDX license expressions. - Removed rpath removal step; it's no longer needed. - Updated all summaries and descriptions. - Moved the documentation into a seperate package. - Fix up the symbolic links for the shared libraries. - Made the generated project files architecture-independent. - Man pages are now packed and their attributes are set after installation. - Improved spec file readability. * Sun Feb 11 2024 Björn Persson - 11.8.0-38 - Rebuilt with XMLada 24. * Sat Jan 27 2024 Fedora Release Engineering - 11.8.0-37 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Jan 16 2024 Björn Persson - 11.8.0-36 - Rebuilt with GCC 14 prerelease. * Sat Jul 22 2023 Fedora Release Engineering - 11.8.0-35 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Mar 15 2023 Björn Persson - 11.8.0-34 - Rebuilt with XMLada 23. * Sat Jan 21 2023 Fedora Release Engineering - 11.8.0-33 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Tue Jan 17 2023 Björn Persson - 11.8.0-32 - Rebuilt with GCC 13. * Sat Jul 23 2022 Fedora Release Engineering - 11.8.0-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue May 03 2022 Mamoru TASAKA - 11.8.0-30 - Rebuild for new gnat * Sat Jan 22 2022 Fedora Release Engineering - 11.8.0-29 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Jul 23 2021 Fedora Release Engineering - 11.8.0-28 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Apr 02 2021 Björn Persson - 11.8.0-27 - rebuilt with gcc-11.0.1-0.3 * Wed Jan 27 2021 Fedora Release Engineering - 11.8.0-26 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Tue Dec 8 2020 Pavel Zhukov - 11.8.0-25 - rebuild with new gnat * Wed Jul 29 2020 Fedora Release Engineering - 11.8.0-23 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Fri Jan 31 2020 Fedora Release Engineering - 11.8.0-22 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Sat Jul 27 2019 Fedora Release Engineering - 11.8.0-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sun Feb 03 2019 Fedora Release Engineering - 11.8.0-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Sat Jul 14 2018 Fedora Release Engineering - 11.8.0-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Tue Feb 06 2018 Pavel Zhukov - 11.8.0-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 11.8.0-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Jul 15 2017 Pavel Zhukov - 11.8.0-15 - Build on GPRbuild_arches only * Mon Jul 10 2017 Pavel Zhukov - 11.8.0-14 - Rebuild with new gnat * Mon Feb 13 2017 Pavel Zhukov - 11.8.0-13 - Disable doc build as a workaround * Sat Feb 11 2017 Fedora Release Engineering - 11.8.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Fri Aug 12 2016 Björn Persson - 11.8.0-11 - Rebuilt to let it be built on new architectures. * Tue Feb 02 2016 Björn Persson - 11.8.0-10 - Rebuilt with GCC 6 prerelease. * Thu Jun 25 2015 Pavel Zhukov - 11.8.0-9 - Rebuild with new xmlada - Build on arm * Fri Jun 19 2015 Fedora Release Engineering - 11.8.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Mon May 4 2015 Peter Robinson 11.8.0-6 - Don't build ADA hardened * Sun Feb 15 2015 Pavel Zhukov - 11.8.0-5 - Rebuild with gnat-5.0 * Mon Aug 18 2014 Fedora Release Engineering - 11.8.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Jun 14 2014 julian@vgai.de - 11.8.0-3 - add temporary fix for gprbuild using wrong target * Sun Jun 08 2014 Fedora Release Engineering - 11.8.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed May 07 2014 Julian Leyh - 11.8.0-1 - Update to 11.8.0 and rebuild for gcc * Sun Aug 04 2013 Fedora Release Engineering - 11.6.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Wed Mar 6 2013 Tomáš Mráz - 11.6.0-6 - Rebuild (#918586) * Sat Jan 26 2013 Kevin Fenzi - 11.6.0-5 - Rebuild for new gnat * Mon Aug 06 2012 Julian Leyh - 11.6.0-3 - add manpages for the tools * Fri Jun 29 2012 Julian Leyh - 11.6.0-2 - build documentation - use other URL - smaller source tarball with --exclude-vcs - correct soname - adjust path to gpr files - add tools subpackage - add ldconfig call * Wed Jun 27 2012 Julian Leyh - 11.6.0-1 - Initial Package