Blame gnatcoll-bindings.spec

Björn Persson 98058fe
Name:           gnatcoll-bindings
012dae5
Epoch:          2
012dae5
Version:        21.0.0
1275179
Release:        8%{?dist}
Björn Persson 98058fe
Summary:        The GNAT Components Collection – bindings
Björn Persson 98058fe
Summary(sv):    GNAT Components Collection – bindningar
Björn Persson 98058fe
Björn Persson ce0fa77
License:        GPLv3+ and GPLv3+ with exceptions
Björn Persson ce0fa77
# The subpackages have different licenses. This is the aggregation of those.
Björn Persson ce0fa77
Björn Persson 98058fe
URL:            https://github.com/AdaCore/gnatcoll-bindings
012dae5
Source:         https://github.com/AdaCore/gnatcoll-bindings/archive/v%{version}/%{name}-%{version}.tar.gz
012dae5
012dae5
BuildRequires:  gcc-gnat gprbuild sed dos2unix
012dae5
BuildRequires:  fedora-gnat-project-common >= 3.15
012dae5
BuildRequires:  gnatcoll-core-devel = %{epoch}:%{version}
Björn Persson 98058fe
# Although it's not explicitly stated, I guess it's best to keep all the parts
Björn Persson 98058fe
# of Gnatcoll on the same version number.
Björn Persson 98058fe
BuildRequires:  gmp-devel python3-devel readline-devel
Björn Persson 98058fe
# Build only on architectures where GPRbuild is available:
Björn Persson 98058fe
ExclusiveArch:  %{GPRbuild_arches}
Björn Persson 98058fe
Björn Persson 98058fe
# Gnatcoll.Python is excluded because of undefined symbols. It can be built by
Björn Persson 98058fe
# passing "--with python" to RPMbuild.
Björn Persson 98058fe
%bcond_with python
Björn Persson 98058fe
Björn Persson 98058fe
%global common_description_en \
Björn Persson 98058fe
This is the bindings module of the GNAT Components Collection. It provides \
Björn Persson 98058fe
bindings to GMP, Iconv, %{?with_python:Python, }Readline and Syslog. \
Björn Persson 98058fe
%{!?with_python:The Python binding is excluded until it works with Python 3.}
Björn Persson 98058fe
Björn Persson 98058fe
%global common_description_sv \
Björn Persson 98058fe
Detta är bindningsmodulen i GNAT Components Collection. Den tillhandahåller \
Björn Persson 98058fe
bindningar till GMP, Iconv, %{?with_python:Python, }Readline och Syslog. \
Björn Persson 98058fe
%{!?with_python:Pythonbindningen är utelämnad tills den fungerar med Python 3.}
Björn Persson 98058fe
Björn Persson 98058fe
%description %{common_description_en}
Björn Persson 98058fe
Björn Persson 98058fe
%description -l sv %{common_description_sv}
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%package -n gnatcoll-gmp
Björn Persson 98058fe
Summary:        The GNAT Components Collection – GMP binding
Björn Persson 98058fe
Summary(sv):    GNAT Components Collection – GMP-bindning
Björn Persson ce0fa77
License:        GPLv3+
Björn Persson ce0fa77
# The Ada files of gnatcoll-gmp are GPLv3+ with exceptions but the C files are
Björn Persson ce0fa77
# GPLv2+. These combine into GPLv3+ on the binary code.
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-gmp
Björn Persson 98058fe
This is the GMP component of the GNAT Components Collection. It is an interface
Björn Persson 98058fe
to the GNU Multiple Precision (GMP) arithmetic library.
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-gmp -l sv
Björn Persson 98058fe
Detta är GMP-komponenten i GNAT Components Collection. Den är ett gränssnitt
Björn Persson 98058fe
mot biblioteket GNU Multiple Precision (GMP) för godtyckligt precisa
Björn Persson 98058fe
beräkningar.
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%package -n gnatcoll-iconv
Björn Persson 98058fe
Summary:        The GNAT Components Collection – Iconv binding
Björn Persson 98058fe
Summary(sv):    GNAT Components Collection – Iconvbindning
Björn Persson ce0fa77
License:        GPLv3+ with exceptions
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-iconv
Björn Persson 98058fe
This is the Iconv component of the GNAT Components Collection. It is an
Björn Persson 98058fe
interface to libiconv for conversion between character encodings.
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-iconv -l sv
Björn Persson 98058fe
Detta är Iconv-komponenten i GNAT Components Collection. Den är ett gränssnitt
Björn Persson 98058fe
mot biblioteket Iconv för omvandling mellan teckenkodningar.
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%if %{with python}
Björn Persson 98058fe
%package -n gnatcoll-python
Björn Persson 98058fe
Summary:        The GNAT Components Collection – Python binding
Björn Persson 98058fe
Summary(sv):    GNAT Components Collection – Pythonbindning
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-python
Björn Persson 98058fe
This is the Python component of the GNAT Components Collection. It is an
Björn Persson 98058fe
interface to the Python interpreter.
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-python -l sv
Björn Persson 98058fe
Detta är Python-komponenten i GNAT Components Collection. Den är ett gränssnitt
Björn Persson 98058fe
mot pythontolken.
Björn Persson 98058fe
%endif
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%package -n gnatcoll-readline
Björn Persson 98058fe
Summary:        The GNAT Components Collection – Readline binding
Björn Persson 98058fe
Summary(sv):    GNAT Components Collection – Readlinebindning
Björn Persson ce0fa77
License:        GPLv3+
Björn Persson ce0fa77
# gnatcoll-readline.ads grants the GCC Runtime Library Exception but
Björn Persson ce0fa77
# gnatcoll-readline.adb does not, and Readline itself is GPLv3+ without
Björn Persson ce0fa77
# exceptions anyway.
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-readline
Björn Persson 98058fe
This is the Readline component of the GNAT Components Collection. It is an
Björn Persson 98058fe
interface to the Readline library for interactive input from the user.
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-readline -l sv
Björn Persson 98058fe
Detta är Readline-komponenten i GNAT Components Collection. Den är ett
Björn Persson 98058fe
gränssnitt mot biblioteket Readline för interaktiv inmatning från användaren.
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%package -n gnatcoll-syslog
Björn Persson 98058fe
Summary:        The GNAT Components Collection – Syslog binding
Björn Persson 98058fe
Summary(sv):    GNAT Components Collection – Syslogbindning
Björn Persson ce0fa77
License:        GPLv3+ with exceptions
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-syslog
Björn Persson 98058fe
This is the Syslog component of the GNAT Components Collection. It is an
Björn Persson 98058fe
interface to the system logger on Unix-like systems.
Björn Persson 98058fe
Björn Persson 98058fe
%description -n gnatcoll-syslog -l sv
Björn Persson 98058fe
Detta är Syslog-komponenten i GNAT Components Collection. Den är ett gränssnitt
Björn Persson 98058fe
mot Unixlika operativsystems loggfunktion.
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%package devel
Björn Persson 98058fe
Summary:        Development files for the GNAT Components Collection – bindings
Björn Persson 98058fe
Summary(sv):    Filer för programmering med GNAT Components Collection – bindningar
Björn Persson e050c60
Requires:       gnatcoll-gmp%{?_isa} = %{epoch}:%{version}-%{release}
Björn Persson e050c60
Requires:       gnatcoll-iconv%{?_isa} = %{epoch}:%{version}-%{release}
Björn Persson 98058fe
%if %{with python}
Björn Persson e050c60
Requires:       gnatcoll-python%{?_isa} = %{epoch}:%{version}-%{release}
Björn Persson 98058fe
%endif
Björn Persson e050c60
Requires:       gnatcoll-readline%{?_isa} = %{epoch}:%{version}-%{release}
Björn Persson e050c60
Requires:       gnatcoll-syslog%{?_isa} = %{epoch}:%{version}-%{release}
Björn Persson 98058fe
Requires:       fedora-gnat-project-common gnatcoll-core-devel
Björn Persson 98058fe
Björn Persson 98058fe
%description devel %{common_description_en}
Björn Persson 98058fe
Björn Persson 98058fe
The gnatcoll-bindings-devel package contains source code and linking information
Björn Persson 98058fe
for developing applications that use the GNAT Components Collection bindings.
Björn Persson 98058fe
Björn Persson 98058fe
%description devel -l sv %{common_description_sv}
Björn Persson 98058fe
Björn Persson 98058fe
Paketet gnatcoll-bindings-devel innehåller källkod och länkningsinformation som
Björn Persson 98058fe
behövs för att utveckla program som använder GNAT Components Collections
Björn Persson 98058fe
bindningar.
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%global set_env export GNATCOLL_VERSION=%{version} \
Björn Persson 98058fe
                export BUILD=PROD \
Björn Persson 98058fe
                export LIBRARY_TYPE=relocatable \
Björn Persson 98058fe
                export GNATCOLL_ICONV_OPT=@/dev/null \
Björn Persson 98058fe
                export GNATCOLL_PYTHON_CFLAGS=`python3-config --cflags` \
Björn Persson 98058fe
                export GNATCOLL_PYTHON_LIBS=`python3-config --ldflags`
Björn Persson 98058fe
# Iconv is not a separate library, but an empty GNATCOLL_ICONV_OPT doesn't
Björn Persson 98058fe
# prevent GPRbuild from using the default "-liconv", so it's set to a value
Björn Persson 98058fe
# that makes no difference.
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%prep
012dae5
%autosetup
Björn Persson 98058fe
Björn Persson 98058fe
# Convert line breaks.
Björn Persson 98058fe
dos2unix --keepdate gmp/examples/gmp_examples.gpr
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%build
Björn Persson 98058fe
%{set_env}
Björn Persson 98058fe
for subdir in gmp iconv %{?with_python:python} readline syslog ; do
Björn Persson 98058fe
    component=gnatcoll_${subdir}
Björn Persson 98058fe
    gprbuild -P ${subdir}/${component}.gpr %{GPRbuild_optflags}
Björn Persson 98058fe
done
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%install
Björn Persson 98058fe
%{set_env}
Björn Persson 98058fe
for subdir in gmp iconv %{?with_python:python} readline syslog ; do
Björn Persson 98058fe
    component=gnatcoll_${subdir}
012dae5
    gprinstall -P ${subdir}/${component}.gpr --prefix=%{buildroot}/%{_prefix} %GPRinstall_flags
Björn Persson 98058fe
    ln --symbolic --force lib${component}.so.%{version} \
Björn Persson 98058fe
       %{buildroot}%{_libdir}/lib${component}.so
Björn Persson 98058fe
Björn Persson 98058fe
    # Make the generated usage project file architecture-independent.
Björn Persson 98058fe
    sed --regexp-extended --in-place \
Björn Persson 98058fe
        '--expression=1i with "directories";' \
Björn Persson 98058fe
        '--expression=/^--  This project has been generated/d' \
Björn Persson 98058fe
        '--expression=/package Linker is/,/end Linker/d' \
Björn Persson 98058fe
        '--expression=/python_(cflags|libs)/d' \
Björn Persson beeeeab
        '--expression=s|^( *for +Source_Dirs +use +).*;$|\1(Directories.Includedir \& "/'%{name}'");|i' \
Björn Persson 98058fe
        '--expression=s|^( *for +Library_Dir +use +).*;$|\1Directories.Libdir;|i' \
Björn Persson beeeeab
        '--expression=s|^( *for +Library_ALI_Dir +use +).*;$|\1Directories.Libdir \& "/'%{name}'";|i' \
Björn Persson 98058fe
        %{buildroot}%{_GNAT_project_dir}/${component}.gpr
Björn Persson 98058fe
    # The Sed commands are:
Björn Persson 98058fe
    # 1: Insert a with clause before the first line to import the directories
Björn Persson 98058fe
    #    project.
Björn Persson 98058fe
    # 2: Delete a comment that mentions the architecture.
Björn Persson 98058fe
    # 3: Delete the package Linker, which contains linker parameters that a
Björn Persson 98058fe
    #    shared library normally doesn't need, and can contain architecture-
Björn Persson 98058fe
    #    specific pathnames.
Björn Persson 98058fe
    # 4: Delete two unused variables with architecture- specific values from
Björn Persson 98058fe
    #    gnatcoll_python.gpr.
Björn Persson 98058fe
    # 5: Replace the value of Source_Dirs with a pathname based on
Björn Persson 98058fe
    #    Directories.Includedir.
Björn Persson 98058fe
    # 6: Replace the value of Library_Dir with Directories.Libdir.
Björn Persson 98058fe
    # 7: Replace the value of Library_ALI_Dir with a pathname based on
Björn Persson 98058fe
    #    Directories.Libdir.
Björn Persson 98058fe
done
Björn Persson 98058fe
Björn Persson 98058fe
# GPRinstall's manifest files are architecture-specific because they contain
Björn Persson 98058fe
# what seems to be checksums of architecture-specific files, so they must not
Björn Persson 98058fe
# be under _datadir. Their function is poorly documented, but they seem to be
Björn Persson 98058fe
# used when GPRinstall uninstalls packages. The manifest files are therefore
Björn Persson 98058fe
# irrelevant in this RPM package, so delete them.
Björn Persson 98058fe
rm --recursive --force %{buildroot}%{_GNAT_project_dir}/manifests
Björn Persson 98058fe
Björn Persson 98058fe
# These files may be of some value to developers:
Björn Persson 98058fe
for subdir in iconv readline syslog ; do
Björn Persson 98058fe
    mkdir --parents %{buildroot}%{_docdir}/gnatcoll/${subdir}
Björn Persson 98058fe
    cp --preserve=timestamps ${subdir}/README.md \
Björn Persson 98058fe
       %{buildroot}%{_docdir}/gnatcoll/${subdir}/
Björn Persson 98058fe
done
Björn Persson 98058fe
Björn Persson 98058fe
# Move the examples to their proper place.
Björn Persson 98058fe
mv %{buildroot}%{_datadir}/examples/gnatcoll %{buildroot}%{_docdir}/gnatcoll/examples
Björn Persson 98058fe
Björn Persson 98058fe
# Install the license with a single pathname that is shared by the subpackages.
Björn Persson 98058fe
mkdir --parents %{buildroot}%{_licensedir}/%{name}
Björn Persson ce0fa77
cp --preserve=timestamps COPYING3 COPYING.RUNTIME \
Björn Persson ce0fa77
   --target-directory=%{buildroot}%{_licensedir}/%{name}
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%files -n gnatcoll-gmp
Björn Persson 98058fe
%{_libdir}/libgnatcoll_gmp.so.*
Björn Persson ce0fa77
%dir %{_licensedir}/%{name}
Björn Persson ce0fa77
%license %{_licensedir}/%{name}/COPYING3
Björn Persson 98058fe
Björn Persson 98058fe
%files -n gnatcoll-iconv
Björn Persson 98058fe
%{_libdir}/libgnatcoll_iconv.so.*
Björn Persson 20d1e62
%license %{_licensedir}/%{name}
Björn Persson 98058fe
Björn Persson 98058fe
%if %{with python}
Björn Persson 98058fe
%files -n gnatcoll-python
Björn Persson 98058fe
%{_libdir}/libgnatcoll_python.so.*
Björn Persson 20d1e62
%license %{_licensedir}/%{name}
Björn Persson 98058fe
%endif
Björn Persson 98058fe
Björn Persson 98058fe
%files -n gnatcoll-readline
Björn Persson 98058fe
%{_libdir}/libgnatcoll_readline.so.*
Björn Persson ce0fa77
%dir %{_licensedir}/%{name}
Björn Persson ce0fa77
%license %{_licensedir}/%{name}/COPYING3
Björn Persson 98058fe
Björn Persson 98058fe
%files -n gnatcoll-syslog
Björn Persson 98058fe
%{_libdir}/libgnatcoll_syslog.so.*
Björn Persson 20d1e62
%license %{_licensedir}/%{name}
Björn Persson 98058fe
Björn Persson 98058fe
%files devel
Björn Persson 98058fe
%{_includedir}/*
Björn Persson 98058fe
%{_libdir}/*.so
Björn Persson 98058fe
%{_libdir}/gnatcoll*
Björn Persson 98058fe
%{_GNAT_project_dir}/*
Björn Persson 98058fe
%{_docdir}/gnatcoll
Björn Persson 98058fe
Björn Persson 98058fe
Björn Persson 98058fe
%changelog
1275179
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2:21.0.0-8
1275179
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
1275179
3a6e1b9
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:21.0.0-7
3a6e1b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
3a6e1b9
Björn Persson ce0fa77
* Fri Apr 02 2021 Björn Persson <Bjorn@Rombobjörn.se> - 2:21.0.0-6
Björn Persson ce0fa77
- Updated the licenses.
Björn Persson ce0fa77
Björn Persson beeeeab
* Mon Feb 08 2021 Björn Persson <Bjorn@Rombobjörn.se> - 2:21.0.0-5
Björn Persson beeeeab
- Adjusted the usage project files.
Björn Persson beeeeab
495447f
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:21.0.0-4
495447f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
495447f
Björn Persson e050c60
* Thu Jan 14 2021 Björn Persson <Bjorn@Rombobjörn.se> - 2:21.0.0-3
Björn Persson e050c60
- Specified epoch of dependencies.
Björn Persson e050c60
012dae5
* Mon Jan 11 2021 Pavel Zhukov <pzhukov@redhat.com> - 2:21.0.0-2
012dae5
- Specify fedora-gnat-projects-common version
012dae5
- Remove obsolete comments
012dae5
012dae5
* Mon Jan 11 2021 Pavel Zhukov <pzhukov@redhat.com> - 2:21.0.0-1
012dae5
- New version 21.0.0
012dae5
c184786
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2018-7
c184786
- Second attempt - Rebuilt for
c184786
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
c184786
042ee0d
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2018-6
042ee0d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
042ee0d
f9085d6
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2018-5
f9085d6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
f9085d6
f2e90ce
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2018-4
f2e90ce
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f2e90ce
Björn Persson 20d1e62
* Wed May 29 2019 Björn Persson <Bjorn@Rombobjörn.se> - 2018-3
Björn Persson 20d1e62
- Tagged the license file as such.
Björn Persson 20d1e62
Björn Persson 98058fe
* Fri Mar 29 2019 Björn Persson <Bjorn@Rombobjörn.se> - 2018-2
Björn Persson 98058fe
- Added more macro usage, more comments and ownership of a directory.
Björn Persson 98058fe
Björn Persson 98058fe
* Sat Mar 16 2019 Björn Persson <Bjorn@Rombobjörn.se> - 2018-1
Björn Persson 98058fe
- new package