Test ran at 2024-04-20 12:55:39.970593+00:00 SOLUTION: magicada=1.0.1: Magic Number Recognition Library Ada binding Origin: commit 32af2d9a67f8da651cf66cd2deba9d0e898aef2f from https://gitlab.com/stcarrez/ada-libmagic.git Available when: (case OS is Freebsd => True, Linux => True, others => False) Properties: Author: Stephane.Carrez@gmail.com Configuration: no modifiers Description: Magic Number Recognition Library Ada binding GPR Scenario: MAGICADA_BUILD := distrib | debug | optimize | profile | coverage GPR Scenario: MAGICADA_LIBRARY_TYPE := relocatable | static | static-pic License: Apache-2.0 Long_Description: Small Ada binding library to the [libmagic (3)](https://linux.die.net/man/3/libmagic) library which is used by the implementation of the [file (1)](https://linux.die.net/man/1/file) command. To simplify and help in the use of the magic Ada library, the `Magic.Manager` package encapsulates the management of the libmagic library and provides high level simple operations to hide the details of interacting with the C library. The package defines the `Magic_Manager` tagged record that takes care of the C library interaction and cleaning of the libmagic library once the manager is no longer required. To use it, declare the instance and initialize it with the `Initialize` procedure: ```Ada with Magic.Manager; ... Mgr : Magic.Manager.Magic_Manager; ... Mgr.Initialize (Magic.MAGIC_MIME, Magic.DEFAULT_PATH); ``` The first parameter defines a set of flags represented by the `Magic.Flags` type to control various options of the libmagic library. The second parameter indicates the default path to the magic file (see [magic (5)](https://linux.die.net/man/5/magic)). Once configured, the `Identify` functions can be used to identify a content. For the first form, a path of the file is given: ```Ada Mime : constant String := Mgr.Identify ("file.ads"); ``` With the second form, a `Stream_Element_Array` with the content to identify is given to the function. ## Example - [examples.adb](https://gitlab.com/stcarrez/ada-libmagic/-/blob/main/examples/src/examples.adb?ref_type=heads) Maintainer: Stephane.Carrez@gmail.com Maintainers_Logins: stcarrez Name: magicada Tag: magic Tag: file Tag: bindings Version: 1.0.1 Website: https://gitlab.com/stcarrez/ada-libmagic Dependencies (direct): libmagic* Dependencies (solution): libmagic=5.41.0 Dependencies (graph): magicada=1.0.1 --> libmagic=5.41.0 (*) LOG: Note: Deploying magicada=1.0.1... Note: Deploying libmagic=5.41.0... The system package 'libmagic-dev' is about to be installed. This action might require admin privileges and impact your system installation. Do you want Alire to install this system package? Using default: Yes debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libmagic-mgc. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 22683 files and directories currently installed.) Preparing to unpack .../libmagic-mgc_1%3a5.41-3ubuntu0.1_amd64.deb ... Unpacking libmagic-mgc (1:5.41-3ubuntu0.1) ... Selecting previously unselected package libmagic1:amd64. Preparing to unpack .../libmagic1_1%3a5.41-3ubuntu0.1_amd64.deb ... Unpacking libmagic1:amd64 (1:5.41-3ubuntu0.1) ... Selecting previously unselected package libmagic-dev:amd64. Preparing to unpack .../libmagic-dev_1%3a5.41-3ubuntu0.1_amd64.deb ... Unpacking libmagic-dev:amd64 (1:5.41-3ubuntu0.1) ... Setting up libmagic-mgc (1:5.41-3ubuntu0.1) ... Setting up libmagic1:amd64 (1:5.41-3ubuntu0.1) ... Setting up libmagic-dev:amd64 (1:5.41-3ubuntu0.1) ... Processing triggers for libc-bin (2.35-0ubuntu3.3) ... Note: Building magicada/magicada.gpr... Setup [mkdir] object directory for project MagicAda [mkdir] library directory for project MagicAda Compile [Ada] magic-manager.adb [Ada] magic.ads Build Libraries [gprlib] magicada.lexch [archive] libmagicada.a [index] libmagicada.a Build finished successfully in 0.34 seconds. magicada=1.0.1 successfully retrieved and built. Dependencies were solved as follows: + libmagic 5.41.0 (new) Found declared GPR file: magicada.gpr