OpenSPM - Open Source Package Manager
OpenSPM is a lightweight, cross-platform package manager designed for easy distribution and installation of binary and source packages. It provides a simple YAML-based repository format and supports dependency management, platform-specific packages, and tag-based compatibility.
Features
- Simple Repository Format: YAML-based package metadata that's easy to create and maintain
- HTTP/HTTPS Support: Fetch packages from any web server
- Tag-Based Compatibility: Platform and compiler tags ensure packages match your system
- Dependency Management: Automatic resolution of package dependencies
- Repository Chaining: Repositories can depend on other repositories
- Cross-Platform: Supports Linux, macOS, and Windows
- Archive-Based Storage: Efficient compressed storage for package metadata
Installation
Prerequisites
OpenSPM requires the following dependencies:
- CMake 3.10 or higher
- C++17 compatible compiler (GCC, Clang, or MSVC)
- libarchive (system package)
- libzstd (system package)
- pkg-config
Ubuntu/Debian
sudo apt-get install cmake g++ libarchive-dev libzstd-dev pkg-config
Fedora/RHEL
sudo dnf install cmake gcc-c++ libarchive-devel libzstd-devel pkgconfig
macOS (Homebrew)
brew install cmake libarchive zstd pkg-config
Usage
Initial Configuration
Before using OpenSPM, run the configuration wizard (requires administrator/root privileges):
sudo openspm configure
This will guide you through setting up data and target directories and color output preferences.
Managing Repositories
Adding a Repository
sudo openspm add-repo https://example.com/repository
Short form: sudo openspm ar https://example.com/repository
Creating Your Own Repository
A repository consists of two main YAML files hosted on a web server:
- repository.yaml - Repository metadata
- pkg-list.yaml - Package index
Configuration
OpenSPM stores its configuration in /etc/openspm/config.yaml and uses an archive-based data store in <dataDir>/data.bin.
Development
Project structure, build steps, and tests are included in the repository. Use CMake to build and run tests with ctest.
Platform Support
Supported platforms: Linux, macOS, Windows. See platform-specific notes in the full docs.
Troubleshooting
Permission Denied
OpenSPM requires administrator/root privileges for most operations. Prefix commands with sudo where necessary.