Artifact [42f4276675]
Not logged in

Artifact 42f42766752036e93161b1a21fcc7561c22e5a44:


SourcePackageManager

.. A tiny embeddable package manager library and application.

SourcePackageManager, hereafter refered to as 'SPM', is designed to be used in the same way as RVM regarding paths, and in the same way as RubyGems in terms of managing packages, except with support for per-project dependencies, and not just system-wide and per-user packages. In fact, system-wide packages are not really handled by SPM, but instead left for your local system package manager.

To use this system, simply run

fossil clone https://chiselapp.com/user/mastersrp/repository/SourcePackageManager/ ~/.spm.fossil
mkdir ~/.spm && cd ~/.spm
fossil open ~/.spm.fossil

Then follow the instructions in the Compiling section.

Requirements

Even though SPM is rather small, it does have some dependencies.

  • bash
  • gcc 4.7.3
  • fossil (for pulling down dependencies)
  • git (for pulling down dependencies)
  • tup

Most, if not all, of these packages can probably be installed using your package manager.

Compiling

Currently, SPM is only supported for compilation on 32bit and 64bit architectures of GNU/Linux systems. Other systems may work out of the box, but have not been tested.
Feel free to open issues with patches if you got it working on your platform.
The included spm.sh is a very lightweight script that simply runs spm from the lua code in the $PAKLIB directory.

First, you must fetch dependency software and tools required to build the package. It is assumed that a basic compiler package with make and gcc is already installed.

./spm.sh fetch

Second, you must configure the system. It is urged that you first configure the package, and then check the configuration file for any errors.
It is to be noted that the $PREFIX environment variable only has effect in the configure and install targets. Configuration is very simple:

./spm.sh configure

Then check the configuration in build/tup.config and make sure that everything is set to values that you're okay with.
To build a lite SPM package, simply change the BUILD_TYPE configuration from 'standalone' to 'lite' and the build files will do the rest.
Then, to build the system, simply run

./spm.sh build

This will build the entire system and all dependencies.
If anything goes wrong, feel free to check the log in the .spm directory.

Installation

There are various ways to do the installation. The simple one is using the spm.sh script:

./spm.sh install

Please note that using this target requires the $PREFIX environment to be set. Default is "/usr/local/spm".

The file 'bin/spm' is really all there is required. Put it whereever you want, or just run

source scripts/spm

to prepend the bin directory to your PATH variable.
Note that this only works for the current terminal session. For permanent use, you should add

source _spm_clone_directory_/scripts/spm

To your bashrc or

source _spm_clone_directory_/scripts/spm.zsh

to your zshrc.

Alternatively, you can use this gist to manage your PATH variable easily, without having to mess about a lot with rc files.