%global delete_static 1 %undefine _hardened_build Name: gnat_util Version: 2017 Release: 1%{?dist} Summary: Gnat library wrapper License: GPLv3+ URL: http://libre.adacore.com ## direct download is not available Source0: %{name}-gpl-%{version}-src.tar.gz Patch0: %{name}-project_library_dirs.patch Patch1: %{name}-library_version.patch ## Not in fedora Patch2: gnat_util-%{version}-ravenscar_edf.patch Patch3: gnat_util-2017-libsubdir.patch BuildRequires: gprbuild gcc-gnat fedora-gnat-project-common %description Gnat_Util is a library uniting a number of GNAT sources that are used by different tools. At the moment Gnat_Util provides GNAT sources needed by ASIS, GNATCOLL and Gprbuild. Its main purpose is allowing to simultaneously use tools like ASIS and GNATCOLL (and other ones based on GNAT sources, if they are to come), which would normally cause name conflicts between the same GNAT sources that they use. Building both of them using same set of sources that is Gnat_Util solves this problem. %package devel Summary: Devel package for %{name} License: GPLv3+ Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary} %prep %setup -n %{name}-gpl-%{version}-src %patch1 -p1 -b .libver ## SPARK specific rm restrict.adb -f %patch2 -p1 -b .ravenscar %patch3 -p1 -b .libdir sed "s/@FEDORA_LIBRARY_VERSION@/lib%{name}.so.%{version}/" -i %{name}.gpr %build sed 's/Makefile.gnat_util/Makefile/' -i MANIFEST.gnat_util mkdir build cp $(cat MANIFEST.gnat_util) build cd build BUILDER="gprbuild -f %GPRbuild_optflags" %make_build ENABLE_SHARED=yes BUILD_TYPE=Debug BUILDER="${BUILDER}" %install export I_LIB=%{buildroot}/%{_libdir} export I_PRJ=%{buildroot}/%{_GNAT_project_dir} cd build %make_install prefix=%{buildroot}/%{_prefix} libdir=${I_LIB} gprdir=${I_PRJ} \ ENABLE_SHARED=yes BUILD_TYPE=Debug INSTALLER="gprinstall --link-lib-subdir=${I_LIB} -v" ## We don't need manifests rm -rf %{buildroot}/%{_GNAT_project_dir}/manifests %if %{delete_static} rm -rf %{buildroot}/%{_libdir}/%{name}/static* %endif ## Create unversioned libraries cd %{buildroot}/%{libdir} && ln -s lib%{name}.so.%{version} lib%{name}.so cd %{buildroot}/%{name}/relocatable/%{libdir} && ln -s lib%{name}.so.%{version} lib%{name}.so %files %license COPYING3 %doc README.gnat_util %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/relocatable %{_libdir}/lib%{name}.so.%{version} %{_libdir}/%{name}/relocatable/lib%{name}.so.%{version} %files devel %{_libdir}/%{name}/relocatable/*.ali %{_includedir}/%{name} %{_GNAT_project_dir}/%{name}.gpr %{_libdir}/lib%{name}.so %{_libdir}/%{name}/relocatable/lib%{name}.so %changelog * Thu Jul 20 2017 Pavel Zhukov - 2017-1 - New version 2017