Commit 0a4e7d9d authored by PoroCYon's avatar PoroCYon
Browse files

update README

parent 8d074540
# sspt
samselplatro -- semidecent 'package manager' that handles upstream repos
*samselplatro* -- A semidecent 'package manager' meant for installing and
updating the upstream version of a program. It does ***NOT*** try to be a
full-fledged package manager for systemwide use.
I made this because I thought `ls | xargs "!f() { pushd $1 && git pull && make && make install && popd }; f"`
is slightly too hacky. `sspt` is a nicer way for doing this.
## Dependencies
......@@ -14,10 +19,128 @@ samselplatro -- semidecent 'package manager' that handles upstream repos
is required for `curl`/`wget` and `rsync`.
* `npm`, `cargo`, `setuptools`, `idris`, `xbuild`, `stack`, `cabal`,
`scons`, `gradle`, `sbt`, `bazel`, `meson`, `ninja`, `ant`, `maven`,
`cmake`, `qmake`, `autoconf`, `makefile`: for support for the
`cmake`, `qmake`, `autoconf`/`autotools`, `make`: for support for the
respective build system types.
## Installation
## Usage
See also `sspt -h`, `sspt -L` and `ssspt <subcommand> -h`.
### Config
The default location of the configuration file is
`$XDG_CONFIG_HOME/sspt.conf`. It is a simple shell script that defines
these four environment variables:
* `SSPT_DEST_DIR`: The directory where packages should be installed in
(think Makefile `PREFIX`).
* `SSPT_SUB_DIR`: The directory where the subcommands reside.
* `SSPT_DB_DIR`: The directory where the sspt database of pulled and
installed packages resides.
* `SSPT_DL_DIR`: The directory where sspt downloads the repositories to.
The location of the config file can be specified using the `-c` flag.
The default config can be generated by executing `sspt --mk-default-config`.
*NOTE: This will overwrite the current configuration file!*
### Pulling source code
Using this program as an example:
sspt pull
This will download the repository, and add the package to sspt's list of
known packages. It will also autogenerate an `.sspt` file if none exists.
(Note: if autogeneration fails, sspt will automatically open your editor
so you can manually create the `.sspt` file.)
#### Editing the `.sspt` file
sspt edit sspt
The `.sspt` file provides functions for sspt to manage the repository and
to configure, compile and install the package.
The following functions *must* be defined in the `.sspt` file:
* `sspt_pull`: Update the source code to the latest version.
* `sspt_version`: Print the current commit ID/hash.
* `sspt_prettyver`: Print a nicer-to-read version number.
* `sspt_config`: Configure the build system.
* `sspt_build`: Compile the package.
* `sspt_install`: Install the package.
* `sspt_clean`: Perform a cleanup.
* `sspt_clean_config`: Same as above, but also clean all configuration files.
See `sspt-autogen` for 'examples'.
### Compiling a package
This currently requires the package to be pulled.
sspt build sspt
NOTE: currently, it doesn't automatically configure the package.
### Installing a package
This currently requires the package to be pulled.
sspt install sspt
**NOTE: This is not yet implemented.**
### Updating all packages
This will pull the latest changes *and* recompile and install all packages
that have updates.
sspt update
One can also specify a list of packages to update:
sspt update sspt another-package
### Uninstalling a package
sspt uninstall sspt
### Uninstalling a package and deleting the source code
sspt purge sspt
### TODO: more usage docs
## Hacking
Use `./` to run sspt in the test environment,
and `./` to execute other commands in it.
## License
......@@ -121,9 +121,11 @@ main() {
# need to register it before we can autogen the .sspt file
exec_subcommand src-db reg "$PKG_NAME" dummy_revision
exec_subcommand autogen "$PKG_NAME"
if [ $? -ne 0 ]; then # autogen failed -> resorting to manual edit
exec_subcommand edit "$PKG_NAME"
if ! [ -f "$SSPT_DL_DIR/$PKG_NAME/.sspt" ]; then
exec_subcommand autogen "$PKG_NAME"
if [ $? -ne 0 ]; then # autogen failed -> resorting to manual edit
exec_subcommand edit "$PKG_NAME"
# now set the version of the package in the DB
# (this is only possible because the .sspt file is generated)
* install!!!
* list pulled/installed
* aliases (sspt rm foo)
* bulk operations (pull pkg0 pkg1 pkg2 ...)
* auto-execution of other subcmds
......@@ -6,6 +7,7 @@
* build -> auto-configure
* add more switches to subcommands
* autogen -> always edit
* pull -> noautogen
* pull -> no autogen
* pull -> always edit
* install -> clean?
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment