Packaging:Ada

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Rpmlint and Ada packages)
(_GNAT_project_dir)
Line 15: Line 15:
  
 
* All Ada include files '*.adb'  and '*.ads' '''MUST''' be placed in the standard include directory: either directly in <code>%{_includedir}</code>, or if headers have general names or upstream recommends having an own directory, in e.g. <code>%{_includedir}/%{name}</code>.  
 
* All Ada include files '*.adb'  and '*.ads' '''MUST''' be placed in the standard include directory: either directly in <code>%{_includedir}</code>, or if headers have general names or upstream recommends having an own directory, in e.g. <code>%{_includedir}/%{name}</code>.  
* Ada projects files '''MUST''' be placed in <code>%{_datadir}/gpr/</code> directory of if project have several '*.gpr' files in e.g. <code> %{_datadir}/gpr/%{name}</code>.
+
* GNAT projects files '''MUST''' be placed in the <code>%{_GNAT_project_dir}</code> directory or a subdirectory thereof. A subdirectory, for example <code>%{_GNAT_project_dir}/%{name}</code>, may be a good idea if there are lots of project files in the same package or if they have generic names. Otherwise they should usually be placed directly in <code>%{_GNAT_project_dir}</code>.
{{Admon/note | Note| Currently in Fedora /lib/gnat dir for projects files is using  but  /usr/share/gpr is a better way (according FHS, for example).}}
+
{{Admon/note | Note| The current value of <code>%{_GNAT_project_dir}</code> is <code>/usr/lib/gnat</code>. We intend to change it to <code>/usr/share/gpr</code>, which is more in line with FHS, if we can get GNAT to use that directory.}}
 
* Ada Library Information '*.ali' files SHOULD reside in %{libdir}/%{name}/*.ali.
 
* Ada Library Information '*.ali' files SHOULD reside in %{libdir}/%{name}/*.ali.
  
Line 33: Line 33:
  
 
* GNAT project file
 
* GNAT project file
: The -devel package for each library '''SHOULD''' provide a GNAT project file named <code>%{_datadir}/ada/%{name}.gpr </code>.  
+
: The -devel package for each library '''SHOULD''' provide a GNAT project file named <code>%{_GNAT_project_dir}/%{name}.gpr</code>.  
 
<!-- MACROS: You '''SHOULD''' point ADA_PROJECT_PATH="%{_datadir}/ada" to build in packages depends on %{name} -->
 
<!-- MACROS: You '''SHOULD''' point ADA_PROJECT_PATH="%{_datadir}/ada" to build in packages depends on %{name} -->
 
<!-- 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 23:59, 11 February 2011

Contents

Packaging of Ada programs

Introduсtion

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

Compilation

Ada programs in Fedora MUST be compiled 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

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}.
  • GNAT projects files MUST be placed in the %{_GNAT_project_dir} directory or a subdirectory thereof. A subdirectory, for example %{_GNAT_project_dir}/%{name}, may be a good idea if there are lots of project files in the same package or if they have generic names. Otherwise they should usually be placed directly in %{_GNAT_project_dir}.
Note.png
Note
The current value of %{_GNAT_project_dir} is /usr/lib/gnat. We intend to change it to /usr/share/gpr, which is more in line with FHS, if we can get GNAT to use that directory.
  • Ada Library Information '*.ali' files SHOULD reside in %{libdir}/%{name}/*.ali.

Rpmlint and Ada packages

Rpmlint is a program that checks packages for common problems. For ada packages, some of the rpmlint messages, such as "executable-stack", can be disregarded. gcc because Ada and Pascal nested functions do not use trampolines.

Devel packages

  • Ada packages MUST package Ada specification files (*.ads), Ada body files (*.adb), Ada Library information (*.ali) and GNAT project (*.gpr) files in -devel package.
  • The -devel package MUST depend on fedora-gnat-common package
  • The -devel package MUST provide all source files (specs and bodies) necessary for compilation of code that uses the library. The -devel package MUST depends on fedora-gnat-project-common package
  • 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 SHOULD NOT provide any *.o files.
  • Ada Library information
The -devel package SHOULD provide Ada Library Information (*.ali) files that gcc-gnat creates when compiling the shared (relocatable, not static) library.
  • GNAT project file
The -devel package for each library SHOULD provide a GNAT project file named %{_GNAT_project_dir}/%{name}.gpr.