2019-06-13 08:49:05 -06:00
# kiss
2019-09-11 00:00:33 -06:00
Tiny and straightforward package manager for KISS written in POSIX `sh` .
2019-06-13 11:22:08 -06:00
2020-02-09 02:43:15 -07:00
- Only 600~ lines of POSIX `sh` (*excluding blank lines and comments*).
2019-09-11 00:00:33 -06:00
- Runtime dependency detection.
- Incremental package installation.
2019-09-11 00:02:24 -06:00
- Fast dependency solver.
- File conflict detection.
2020-01-29 01:26:31 -07:00
- Package alternatives system.
2019-09-11 00:00:33 -06:00
- Binary stripping.
- `shellcheck` compliant.
2019-06-13 11:22:08 -06:00
2020-02-11 03:41:41 -07:00
## `kiss` Guidestones
2020-02-14 04:47:23 -07:00
Read: https://k1ss.org/guidestones.txt
2020-02-11 03:41:41 -07:00
2019-06-13 11:32:46 -06:00
## Usage
```sh
2020-01-29 01:19:56 -07:00
-> kiss [a|b|c|i|l|r|s|u|v] [pkg] [pkg] [pkg]
-> alternatives: List and swap to alternatives
-> build: Build a package
-> checksum: Generate checksums
-> install: Install a package
-> list: List installed packages
-> remove: Remove a package
-> search: Search for a package
-> update: Check for updates
-> version: Package manager version
2019-06-13 11:32:46 -06:00
```
2019-08-13 03:22:12 -06:00
2020-01-29 03:21:20 -07:00
## Index
<!-- vim - markdown - toc GFM -->
* [Package format ](#package-format )
* [Customization ](#customization )
* [Alternatives system ](#alternatives-system )
* [Extending the package manager ](#extending-the-package-manager )
<!-- vim - markdown - toc -->
2019-09-11 00:00:33 -06:00
## Package format
2020-03-11 08:52:48 -06:00
See: < https: / / k1ss . org / package-system >
2019-09-11 00:00:33 -06:00
2019-10-07 07:31:26 -06:00
## Customization
2019-08-13 03:22:12 -06:00
2019-10-07 07:31:26 -06:00
```sh
# The package manager is controlled through environment variables.
#
# These can be set in your '.profile' or '/etc/profile.d' to have
# the options apply all the time.
#
# These can also be set in the current shell to have them apply
# only for the current session.
#
# NOTE: The values shown below are the defaults.
# Managing repositories.
#
# This works exactly like '$PATH' (Colon separated).
#
# A list of repositories the package manager will use. You can
# add your own repositories or remove the default ones.
export KISS_PATH=/var/db/kiss/repo/core:/var/db/kiss/repo/extra:/var/db/kiss/repo/xorg
# Force package installation or removal.
#
# This can be used to bypass the dependency checks on installation
# and removal of packages.
#
# Set it to '1' to force.
export KISS_FORCE=0
2020-02-07 06:42:19 -07:00
# Hook into kiss through a script.
#
# This can be used set custom CFLAGS per package, modify builds,
# etc. This environment variable must point to a shellscript.
#
# The script will have the following environment variables set.
#
# $PKG: Name of the current package .
# $TYPE: The type of hook (valid: pre-build, post-build).
# $DEST: The full path to where 'make install' will put the package.
#
# Simple example script:
#
# case $TYPE in
# pre-build)
# case $PKG in
# zlib) export CFLAGS="-Os -static" ;;
# curl) export CFLAGS="-O3" ;;
# esac
# ;;
#
# post-build)
2020-02-19 15:21:45 -07:00
# : "${DEST:?DEST is unset}"
#
# rm -rf "$DEST/usr/share/doc"
# rm -rf "$DEST/usr/share/gettext"
2020-02-07 06:42:19 -07:00
# ;;
# esac
#
export KISS_HOOK=/path/to/script
2019-10-07 07:31:26 -06:00
# Root directory.
#
# Where installed packages will go. You won't ever need
# to touch this during normal usage.
#
# This can be used to have the package manager run in a "fake root".
export KISS_ROOT=/
2020-02-07 06:42:19 -07:00
# Keep build logs around for successful builds and not just failing
# ones. Helpful when debugging.
2019-10-07 07:31:26 -06:00
#
# Set it to '1' to enable.
export KISS_DEBUG=0
2020-02-07 06:42:19 -07:00
# Force the usage of a different 'sudo' tool.
#
# Values: 'su', 'sudo', 'doas'
export KISS_SU=
2019-10-07 07:31:26 -06:00
# Use a reproducible cache naming scheme.
#
# The package manager builds packages inside 'build-$PID/' with '$PID'
# being the package manager's process ID. This allows for multiple
# builds to happen at once.
#
# You can override this and _know_ the location beforehand with the
# below environment variable. 'KISS_PID=test' will build the package
# in 'build-test'.
#
# Unset by default.
export KISS_PID=
#
# non-package-manager related options.
# These are listed for clarity.
#
2019-09-11 00:00:33 -06:00
2019-10-07 07:31:26 -06:00
# Cache directory location.
export XDG_CACHE_HOME=$HOME/.cache/
2019-09-11 10:21:44 -06:00
2019-10-07 07:31:26 -06:00
# Compiler.
export CC=gcc
export CXX=g++
# AR.
export AR=ar
# NM.
export NM=nm
# RANLIB.
export RANLIB=ranlib
# Compiler flags.
# Good value: CFLAGS/CXXFLAGS='-march=native -pipe -O2'
export CFLAGS=
export CXXFLAGS=
# Linker flags.
export LDFLAGS=
# Make flags.
2020-02-07 06:42:19 -07:00
# Good value: MAKEFLAGS='-j4' (number of cores).
2019-10-07 07:31:26 -06:00
export MAKEFLAGS=
2019-11-16 08:55:44 -07:00
2020-02-07 06:42:19 -07:00
# Ninja (Samurai) flags.
# Good value: SAMUFLAGS='-j4' (number of cores).
export SAMUFLAGS=
2019-11-16 08:55:44 -07:00
# Cmake Generator.
2020-02-07 06:42:19 -07:00
# Good value (Ninja): export CMAKE_GENERATOR='Ninja'
# Good value (Makefiles): export CMAKE_GENERATOR='Unix Makefiles'
2019-11-16 08:55:44 -07:00
export CMAKE_GENERATOR=
2019-10-07 07:31:26 -06:00
```
2020-01-29 03:21:20 -07:00
## Alternatives system
2020-02-19 02:53:03 -07:00
When a package with conflicts is installed the conflicting
2020-02-10 13:35:08 -07:00
files will be added as "choices" to the alternatives system.
2020-01-29 03:21:20 -07:00
2020-02-10 13:35:08 -07:00
Afterwards, running kiss a/kiss alternatives will list all of
the choices you are able to make. Each line of output with this
command is also usable directly as input.
2020-01-29 03:21:20 -07:00
2020-02-10 13:35:08 -07:00
NOTE: To disable this functionality, set 'KISS_CHOICE=0'.
2020-01-29 03:21:20 -07:00
Example usage:
```sh
# List alternatives.
-> kiss a
-> Alternatives:
ncurses /usr/bin/clear
ncurses /usr/bin/reset
# Swap to ncurses 'clear'.
-> kiss a ncurses /usr/bin/clear
-> Swapping '/usr/bin/clear' from 'busybox' to 'ncurses'
Password:
# New listing (busybox clear was swapped out).
-> kiss a
-> Alternatives:
busybox /usr/bin/clear
ncurses /usr/bin/reset
```
Example usage (complex):
```sh
-> kiss i sbase
# More lines...
-> sbase Found conflict (/usr/bin/renice), adding choice
-> sbase Found conflict (/usr/bin/logger), adding choice
-> sbase Found conflict (/usr/bin/flock), adding choice
-> sbase Found conflict (/usr/bin/cal), adding choice
-> sbase Installing package incrementally
-> sbase Installed successfully
# List alternatives.
-> kiss a
-> Alternatives:
# More lines...
sbase /usr/bin/uuencode
sbase /usr/bin/wc
sbase /usr/bin/which
sbase /usr/bin/whoami
sbase /usr/bin/xargs
sbase /usr/bin/yes
# Swapping in bulk (all of sbase).
# The 'kiss a' command with '-' as an argument will read
# from stdin and use each line as arguments to 'kiss a'.
kiss a | grep ^sbase | kiss a -
# New listing, sbase has replaced busybox utilities.
-> kiss a
-> Alternatives:
# More lines...
busybox /usr/bin/uuencode
busybox /usr/bin/wc
busybox /usr/bin/which
busybox /usr/bin/whoami
busybox /usr/bin/xargs
busybox /usr/bin/yes
```
2019-10-07 07:31:26 -06:00
## Extending the package manager
2020-02-19 02:53:03 -07:00
The `contrib` directory contains a set of simple scripts to extend the package manager. These are just simple and stupid automations which parse the package format.
2019-10-30 04:51:48 -06:00
2020-03-12 09:00:16 -06:00
- `kiss-cargo-urlgen` : Generate sources for rust packages.
2020-02-19 02:53:03 -07:00
- `kiss-chbuild` : Spawn a throwaway chroot.
2019-10-30 04:51:48 -06:00
- `kiss-chroot` : Enter a KISS `chroot` .
- `kiss-depends-finder` : Find missing dependencies by parsing 'ldd'.
- `kiss-depends` : Display a package's dependencies.
- `kiss-export` : Turn an installed package into a KISS tarball.
- `kiss-manifest-tree` : Display all files as tree owned by a package.
- `kiss-manifest` : Display all files owned by a package.
- `kiss-maintainer` : Display the package maintainers.
2020-02-19 02:53:03 -07:00
- `kiss-new` : Create a boilerplate package.
2019-10-30 04:51:48 -06:00
- `kiss-orphans` : List orphaned packages.
2020-03-03 15:49:41 -07:00
- `kiss-outdated` : List outdated packages based on Repology versions.
2019-10-30 04:51:48 -06:00
- `kiss-owns` : Check which package owns a file.
2020-02-19 02:53:03 -07:00
- `kiss-repodepends` : Display a package's original dependencies.
- `kiss-reset` : Reset the system to the base.
2019-10-30 04:51:48 -06:00
- `kiss-revdepends` : Display packages which depend on package.
- `kiss-size` : Show the size on disk for an installed package.
2020-02-19 02:53:03 -07:00