Automatic generation of USM file structures from source archives

clanker b83e2e4401 Autodetection improvements 1 month ago
src b83e2e4401 Autodetection improvements 1 month ago
.gitignore 200b1b596c Initial commit 1 month ago
README.md 200b1b596c Initial commit 1 month ago
USM-SPEC.md 200b1b596c Initial commit 1 month ago
debug_autoprovides.py 84b8c5728e Basic working implementation 1 month ago
debug_dependency_detection.py b83e2e4401 Autodetection improvements 1 month ago
example_usage.py 200b1b596c Initial commit 1 month ago
pyproject.toml 200b1b596c Initial commit 1 month ago
test_autoprovides_fix.py 84b8c5728e Basic working implementation 1 month ago
test_autusm.py 200b1b596c Initial commit 1 month ago
test_comprehensive_build_system_detection.py b83e2e4401 Autodetection improvements 1 month ago
test_extraction_consistency.py 84b8c5728e Basic working implementation 1 month ago
test_fix.py 84b8c5728e Basic working implementation 1 month ago
test_gcc_build_system_detection.py b83e2e4401 Autodetection improvements 1 month ago
test_license_comprehensive.py d1a3f326e9 Fix LGPL issue 1 month ago
test_license_detection.py d1a3f326e9 Fix LGPL issue 1 month ago
test_metadata_detection.py b83e2e4401 Autodetection improvements 1 month ago
test_no_timeout.py b83e2e4401 Autodetection improvements 1 month ago
test_xz_support.py 173282750a Add xz support 1 month ago

README.md

Autusm - Automatic USM Generator

Autusm is a command-line utility that automatically generates USM (Universal Source Manifest) files from source packages. It analyzes source code, detects build systems, extracts metadata, and creates USM-compatible scripts for acquiring, building, and installing packages.

Features

  • Multi-format Support: Downloads and extracts tar, tar.gz, tar.bz2, and zip archives
  • Build System Detection: Automatically detects autotools, CMake, Meson, Make, Python, Cargo, and NPM build systems
  • Metadata Extraction: Extracts package information from package.json, setup.py, Cargo.toml, and other configuration files
  • USM Integration: Integrates with USM package manager for autoprovides
  • Interactive Mode: Prompts for missing information in interactive mode
  • Script Generation: Generates USM-compatible acquire, build, and install scripts

Installation

From PyPI

pip install autusm

From Source

git clone https://github.com/autusm/autusm.git
cd autusm
pip install -e .

Usage

Basic Usage

autusm https://example.com/source.tar.gz

Advanced Usage

autusm https://example.com/source.tar.gz \
  --output-dir ./my-package \
  --name my-package \
  --version 1.0.0 \
  --summary "My awesome package" \
  --verbose

Options

  • URL: URL to source archive (required)
  • -o, --output-dir: Output directory for generated files (default: current directory)
  • -w, --work-dir: Working directory for temporary files
  • -n, --name: Override package name
  • -v, --version: Override package version
  • -s, --summary: Override package summary
  • --non-interactive: Run in non-interactive mode
  • --verbose: Enable verbose output
  • --quiet: Suppress non-error output
  • --skip-usm-check: Skip USM availability check

Supported Build Systems

  • Autotools: Projects using configure scripts and Makefile.am
  • CMake: Projects with CMakeLists.txt
  • Meson: Projects with meson.build
  • Make: Projects with Makefile
  • Python: Projects with setup.py or pyproject.toml
  • Cargo: Rust projects with Cargo.toml
  • NPM: Node.js projects with package.json

Supported Metadata Formats

  • Python: setup.py, pyproject.toml, setup.cfg
  • Node.js: package.json
  • Rust: Cargo.toml
  • PHP: composer.json
  • Java: pom.xml, build.gradle
  • Ruby: Gemfile, *.gemspec
  • Perl: Makefile.PL, META.json, META.yml

Output Files

Autusm generates the following files in the output directory:

  • MANIFEST.usm: USM manifest file in JSON format
  • scripts/acquire: Script to acquire source code
  • scripts/build: Script to build the package
  • scripts/install: Script to install the package

Examples

Processing a Python Package

autusm https://github.com/python/cpython/archive/refs/tags/v3.11.0.tar.gz

Processing a CMake Project

autusm https://github.com/Kitware/CMake/archive/v3.25.1.tar.gz

Non-Interactive Mode

autusm https://example.com/source.tar.gz \
  --name my-package \
  --version 1.0.0 \
  --summary "My package summary" \
  --non-interactive

USM Integration

If USM is installed on your system, autusm will automatically:

  1. Run usm manifest autoprovides to detect provided resources
  2. Merge autoprovides into the generated manifest
  3. Validate the generated manifest with USM

Contributing

Contributions are welcome! Please see the Contributing Guidelines for details.

License

Autusm is released under the MIT License. See the LICENSE file for details.

Support