Quellcode durchsuchen

feat(deps): add file-5.46 source code

clanker vor 1 Monat
Ursprung
Commit
cf85cc15f2

+ 53 - 0
file-5.46/MANIFEST.usm

@@ -0,0 +1,53 @@
+{
+  "name": "file",
+  "version": "5.46",
+  "summary": "A utility that classifies files according to their contents",
+  "licences": [
+    {
+      "name": "BSD-2-Clause",
+      "category": "libre",
+      "text": "COPYING"
+    }
+  ],
+  "provides": {
+    "inc:magic.h": "as-expected",
+    "man:man3/libmagic.3": "as-expected",
+    "man:man1/file.1": "as-expected",
+    "bin:file": "as-expected",
+    "lib:libmagic.so.1.0.0": "as-expected",
+    "lib:libmagic.la": "as-expected",
+    "pc:libmagic.pc": "as-expected",
+    "res:misc/magic.mgc": "as-expected",
+    "lib:libmagic.so.1": "as-expected",
+    "lib:libmagic.so": "as-expected",
+    "man:man4/magic.4": "as-expected"
+  },
+  "depends": {
+    "build": [
+      "bin:gcc",
+      "bin:make",
+      "bin:tar",
+      "bin:gzip"
+    ],
+    "runtime": [
+      "lib:libc.so.6",
+      "lib:libz.so.1"
+    ],
+    "manage": [
+      "bin:wget",
+      "bin:tar",
+      "bin:gzip"
+    ]
+  },
+  "flags": [
+    "simpleBuildEnvironment"
+  ],
+  "md": "PACKAGE.md",
+  "url": "https://www.darwinsys.com/file/",
+  "execs": {
+    "build": "usm-scripts/build.sh",
+    "test": "usm-scripts/test.sh",
+    "install": "usm-scripts/install.sh",
+    "acquire": "usm-scripts/acquire.sh"
+  }
+}

+ 39 - 0
file-5.46/PACKAGE.md

@@ -0,0 +1,39 @@
+# File-5.46
+
+The `file` utility is a command-line tool that attempts to classify each given file according to its contents. It performs several tests to determine the file type, including filesystem tests, magic number tests, and language tests.
+
+## Features
+
+- **File Type Detection**: Identifies file types by examining their contents rather than just file extensions
+- **Magic Number Recognition**: Uses a database of "magic numbers" to recognize file formats
+- **Multiple Test Methods**: Employs filesystem tests, magic number tests, and language tests for accurate classification
+- **Extensible Database**: Uses an extensible magic database that can be customized
+- **Library Support**: Includes the libmagic library for use by other applications
+
+## Installed Programs
+
+- `file`: The main command-line utility for file type detection
+
+## Installed Libraries
+
+- `libmagic.so`: Contains routines for magic number recognition used by the file program and other applications
+
+## Common Usage
+
+```bash
+# Determine file type
+file document.pdf
+
+# Get MIME type
+file -i image.jpg
+
+# Show brief description
+file -b script.sh
+
+# Check multiple files
+file *.txt
+```
+
+## License
+
+This package is distributed under the BSD 2-Clause License.

+ 22 - 0
file-5.46/usm-scripts/acquire.sh

@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+
+# Download URL for file-5.46
+ARCHIVE_URL="https://astron.com/pub/file/file-5.46.tar.gz"
+ARCHIVE_NAME="file-5.46.tar.gz"
+EXTRACT_DIR="sources/file"
+
+# Create sources directory
+mkdir -p sources
+
+echo "Downloading file-5.46 source..."
+wget -O ${ARCHIVE_NAME} ${ARCHIVE_URL}
+
+echo "Extracting archive..."
+mkdir -p ${EXTRACT_DIR}
+tar -xzf ${ARCHIVE_NAME} -C ${EXTRACT_DIR} --strip-components=1
+
+echo "Cleaning up..."
+rm ${ARCHIVE_NAME}
+
+echo "Source acquisition complete."

+ 16 - 0
file-5.46/usm-scripts/build.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+build_dir=$1
+
+# With simpleBuildEnvironment flag, we're already in build directory
+# Source is in sources/file relative to package root
+src_dir="sources/file"
+
+echo "Configuring file-5.46..."
+cd ${src_dir} && ./configure --prefix=${PREFIX}
+
+echo "Building file-5.46..."
+cd ${src_dir} && make
+
+echo "Build complete."

+ 16 - 0
file-5.46/usm-scripts/install.sh

@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+build_dir=$1
+install_dir=$2
+install_type=$3
+
+# With simpleBuildEnvironment flag, we're already in build directory
+# Source is in sources/file relative to package root
+# DESTDIR is overridden to install_dir by USM
+src_dir="sources/file"
+
+echo "Installing file-5.46 to ${install_dir}..."
+cd ${src_dir} && make DESTDIR=${install_dir} install
+
+echo "Installation complete."

+ 13 - 0
file-5.46/usm-scripts/test.sh

@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e
+
+build_dir=$1
+
+# With simpleBuildEnvironment flag, we're already in build directory
+# Source is in sources/file relative to package root
+src_dir="sources/file"
+
+echo "Running tests for file-5.46..."
+cd ${src_dir} && make check
+
+echo "All tests passed."