old C version of package and build manager for sabotage linux, current version is written in shell/awk and can be found in KEEP/bin in sabotage-linux.
C Shell Makefile
Clone or download
rofl0r enable optional features
it's now possible to request additional features from a package.

consider a package named foo, that can be built with or without
feature bar and feature baz.
however feature bar may cause additional (usually unwanted) bloat,
and feature baz depends on an additional library qux.
so the package foo will by default be built without features bar
and baz.

if you want to install foo with feature bar enabled, you can now
launch "butch install foo.bar".
the package foo.bar may or may not exist, if not existing the only
thing that will be done is the addition of a variable option_bar=1
to the vars section of foo.
this variable can be used to decide in the build section of foo
whether bar shall be enabled or not.
if a package named foo.bar is existing, additionally to setting
option_bar to 1, butch will process its vars and deps sections
and append it to those of foo (this can be used to override vars
from foo).

if you want to install foo with feature baz enabled, there needs
to be a package named foo.baz, which lists qux in its deps section.

it's also possible to "butch install foo.bar.baz" to enable both
bar and baz. the number of possible options is unlimited.

it should be considered good practice to create packages even
if not explicitly needed (as in the case of foo.bar), to document
that the option exists.
please restrict yourself to option names consisting only of alpha-
numeric lowercase characters.

currently this functionality is implemented such that the options
are immediately stripped from the packagename, so if "foo" is
already installed, running "butch install foo.bar" will do nothing.
"butch rebuild foo.bar" otoh will build foo with bar enabled,
however in the butch.db there will be only an entry for "foo".

if a package has foo.bar.baz in its deps, and foo is not already
installed, or was not yet mentioned in another processed package's
deps section, it will be built with bar+baz enabled though.
Latest commit 737dcb9 Apr 21, 2016

README.md

About

Butch is a relatively small and simple package and build manager, in less than 1000 SLOC of portable C code.

It stands out among other build managers in that it allows to do more than one thing at once. in the default configuration, 16 parallel download jobs (if necessary) and one build job are started, however changing these numbers just requires overriding them via the env variables BUTCH_DL_THREADS and BUTCH_BUILD_THREADS.

as soon as one download finished (and the checksum is valid), the build of the package will be started, unless all build slots are currently in use, or other dependencies not yet downloaded or built.

for any job, butch writes a shell script based on a user-supplied template (see sabotage linux repo for examples) which is then started and its output redirected into a log file.

It uses a custom, ini-like package format which contains the following information:

  • dependency information (section deps)
  • information about a tarball (section vars) (can contain source or binaries)
    • filesize
    • sha512 hash
    • tardir, if the tarball doesnt extract to a dir of the same name
    • other variables
  • mirror information (section mirrors)
  • build section (required to be the last section in the file) the contents of the build section are copied verbatim into the generated build script.

all sections are optional. it's entirely possible to have a package that just contains a list of dependencies (a so-called metapackage), or one that just contains a build section, or one that just contains a mirror url for a tarball + a main section containing the metainformation for that tarball.

example package script:

[deps]
package-foo
package-bar

[vars]
filesize=1024
sha512=deadbeef
tardir=foobar-4.2

[mirrors]
http://foo.bar/foobar-4.2.src.tar.gz
ftp://ftp.foo.bar/foobar-4.2.src.tar.gz
http://mirror.qux.bar/foobar-4.2.src.tar.gz

[build]
./configure && make && make install

Installation

cd /tmp
mkdir butch
cd butch
git clone https://github.com/sabotage-linux/butch
git clone https://github.com/rofl0r/libulz lib
git clone https://github.com/rofl0r/rcb
export PATH=$PATH:/tmp/butch/rcb
ln -s /tmp/butch/rcb/rcb.pl /tmp/butch/rcb/rcb
cd butch
make