# 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 ```bash pip install autusm ``` ### From Source ```bash git clone https://github.com/autusm/autusm.git cd autusm pip install -e . ``` ## Usage ### Basic Usage ```bash autusm https://example.com/source.tar.gz ``` ### Advanced Usage ```bash 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 ```bash autusm https://github.com/python/cpython/archive/refs/tags/v3.11.0.tar.gz ``` ### Processing a CMake Project ```bash autusm https://github.com/Kitware/CMake/archive/v3.25.1.tar.gz ``` ### Non-Interactive Mode ```bash 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](CONTRIBUTING.md) for details. ## License Autusm is released under the MIT License. See the [LICENSE](LICENSE) file for details. ## Support - **Documentation**: [https://autusm.org/docs](https://autusm.org/docs) - **Issues**: [https://github.com/autusm/autusm/issues](https://github.com/autusm/autusm/issues) - **Discussions**: [https://github.com/autusm/autusm/discussions](https://github.com/autusm/autusm/discussions)