From Fedora Project Wiki

Line 35: Line 35:
* GNAT project file
* GNAT project file
: The -devel package for each library '''SHALL''' provide a GNAT project file named <code>%{_libdir}/gnat/%{name}.gpr </code>. You '''SHOULD''' point ADA_PROJECT_PATH="/usr/lib64/gnat" to build in packages depends on %{name}
: The -devel package for each library '''SHALL''' provide a GNAT project file named <code>%{_libdir}/gnat/%{name}.gpr </code>. You '''SHOULD''' point ADA_PROJECT_PATH="/usr/lib64/gnat" to build in packages depends on %{name}
: The project file '''SHALL''' have a <code>Source_Dirs</code> attribute containing at least <code>%{_libdir}/gnat/%{name}.gpr</code>
: The project file '''MUST''' have a <code>Source_Dirs</code> attribute containing at least <code>%{_libdir}/gnat/%{name}.gpr</code>
: The project file '''SHALL''' have a <code>Library_ALI_Dir</code> equal to <code>%{_libdir}/gnat/%{name}.gpr</code>
: The project file '''MUST''' have a <code>Library_ALI_Dir</code> equal to <code>%{_libdir}/gnat/%{name}.gpr</code>
: The project file '''SHALL''' have a <code>Library_Name</code> attribute equal to the library name of the shared library.  
: The project file '''MUST''' have a <code>Library_Name</code> attribute equal to the library name of the shared library.  
: The project file '''SHALL''' have a <code>Library_Kind</code> attribute equal to ‘dynamic’ or 'relocatable'
: The project file '''MUST''' have a <code>Library_Kind</code> attribute equal to ‘dynamic’ or 'relocatable'
: The project file SHALL have a Library_Dir attribute equal to <code>%{_libdir}</code>
: The project file SHALL have a Library_Dir attribute equal to <code>%{_libdir}</code>
<!-- TODO CHECK IT: The project file SHALL have an Externally_Built attribute equal to ‘true’. :Example -->
<!-- TODO CHECK IT: The project file SHALL have an Externally_Built attribute equal to ‘true’. :Example -->


[[ Category:Packaging guidelines drafts ]]
[[ Category:Packaging guidelines drafts ]]

Revision as of 08:14, 8 February 2011

Packaging of Ada programs

Introdution

This document describes all there is to know about Ada in Fedora.

Compilation

Ada programs in Fedora MUST be compiled, if possible, using the default Ada compiler in Fedora gcc-gnat. As usual, standard Fedora optimization flags %{optflags} MUST be used in the compilation. If possible project SHOULD have makefile and configure script

Ada libraries

The Policy for Ada libraries is mostly interesting if you want to package libraries. If you only want to use libraries, see Package Libraries

Files placing

All Ada include files '*.adb' and '*.ads' MUST be placed in the standard include directory: either directly in %{_includedir} , or if headers have general names or upstream recommends having an own directory, in e.g. %{_includedir}/%{name}.

Ada projects files MUST be placed in %{_libdir}/gnat/ directory of if project have several '*.gpr' files in e.g.  %{_libdir}/gnat/%{name}.

Rpmlint and Ada packages

rpmlint is a program that checks packages for common problems. For ada packages, some of the rpmlint messages can be disregarded.

Devel packages

Ada packages MUST package Ada specification files (*.ads), Ada body files (*.adb) and GNAT project (*.gpr) files in -devel package. The devel package MUST provide all source files (specs and bodies) necessary for compilation of code that uses the library. The directory with all Ada source files MUST NOT contain any Makefiles or any other files that might be necessary to recompile the library. The -devel package SHALL NOT provide any *.o files.

  • Ada Library information
The -devel package SHALL provide Ada Library Information (*.ali) files that gcc-gnat creates when compiling the shared (relocatable, not static) library. The '*.ali' files SHOULD reside in %{libdir}/%{name}/*.ali.
  • GNAT project file
The -devel package for each library SHALL provide a GNAT project file named %{_libdir}/gnat/%{name}.gpr . You SHOULD point ADA_PROJECT_PATH="/usr/lib64/gnat" to build in packages depends on %{name}
The project file MUST have a Source_Dirs attribute containing at least %{_libdir}/gnat/%{name}.gpr
The project file MUST have a Library_ALI_Dir equal to %{_libdir}/gnat/%{name}.gpr
The project file MUST have a Library_Name attribute equal to the library name of the shared library.
The project file MUST have a Library_Kind attribute equal to ‘dynamic’ or 'relocatable'
The project file SHALL have a Library_Dir attribute equal to %{_libdir}