bg-installer(1)
π bg-installer(1) β like, the standardized installer program, bestie π
okay so real talk: this is bg-installer from the General Commands Manual, section 1 (that's the one for user commands, iykyk). it's a standardized installer program and honestly? it's giving "does one job and does it flawlessly." let's get into it π«Ά
β¨ NAME β¨
bg-installer β the standardized installer program. periodt. that's the whole name, she's simple and she knows it π
πΈ SYNOPSIS πΈ
bg-installer [top-directory] <LIST
like, you hand her a top-directory, you feed her a LIST on stdin, and she goes to work. that's the vibe π
π¦ DESCRIPTION π¦
okay so here's the tea: bg-installer reads an installation instruction file from standard input, and then it executes those instructions inside the directory you named on the command line. main character behavior fr fr.
Every line in the file is an individual instruction. Some lines get special treatment:
- blank lines β ignored, no thoughts head empty π
- lines beginning with
#β also ignored, they're just commentary - lines beginning with
>β these, if present, tellbg-installerwhich base directory to use (more on that below π)
Every other line has to have this format, exactly:
CMD:[OWNER]:[GROUP]:MODE:DIR[:FILENAME[:SOURCE]]
here's what each piece means, bestie:
CMDβ a single character that says which installation command to run. It can optionally be followed by?, which means "only execute this if the source exists." and if that?is followed by a name, that name gets used instead ofSOURCEas the filename to test. sneaky but iconic.OWNERβ (optional) the owner user ID or name for the target file.GROUPβ (optional) the group ID or name for the target file.MODEβ the permissions of the installed file, in octal.DIRβ the subdirectory of the installation prefix where the destination file goes.FILENAMEβ (optional) the name of the file to install into the directory. You can straight up omit this for directories.SOURCEβ (optional) the name of the source file to install, if it differs from the destination file β or, the path in the symlink. versatile queen π
Now the wildcard lore π§:
If SOURCE contains wildcards, the command gets repeated once for each matching filename. she's thorough like that.
If FILENAME is empty, it gets replaced with the value of SOURCE after wildcard expansion. And each instance of $N in FILENAME β where N is a single digit β gets replaced with the Nth part of the source filename. $0 gets replaced with the whole source filename. so $0, $1, $2β¦ they're all little slots, and she fills them in for you π
The target filename works out to:
PREFIX/TOP/DIR/FILENAME
where:
PREFIXis the value of$install_prefixif it is set,TOPis the directory given on the command line,DIRandFILENAMEare the ones given in the installation file.
and here are the commands, aka the four flavors of slay π₯:
clines copy regular files from the current directorydlines create directoriesslines create symlinks β and heads up,UID,GID, andMODEare ignored for thesellines copy libraries usinglibtool
π and then there's the base directory directive thing: whenbg-installerencounters one (the>lines we talked about), it opens the file namedconf-BASEβ whereBASEis the word on the directive line β reads the first line, and uses that as the base directory (prefixed by$install_prefix, same as above). cute, right? π
β¨ OPTIONS β¨
-v,--verboseβ lists the files as they are processed. she's narrating her own life, as she should π£-n,--dry-runβ doesn't modify any files, just displays. window shopping only, no cap ποΈ-c,--checkβ checks destinations instead of installing.-h,--helpβ displays usage information and exits. the classic escape hatch π«Ά
π EXAMPLES π
>bin
c:::755::prog2
c?:root:root:4750::prog2
>include
d:::755:package
c:::644:package:base.h:pkgbase.h
s:::::package.h:package/base.h
okay let's break down what this whole thing is doing, because it's lowkey beautiful β¨:
This reads conf-bin, and installs prog1 and setuid root prog2 (if it was built) under it. It then reads conf-include, creates the directory package under it, and installs pkgbase.h as base.h in that directory. It also creates a symlink package.h to package/base.h.
see? chef's kiss π
π ENVIRONMENT π
install_prefixβ if set, it is prefixed to all destination file names. that's it, that's the whole variable π¦
π AUTHOR π
Bruce Guenter <bruce@untroubled.org> β the legend herself. respect where respect is due π
and that's the page, bestie π this was bg-installer(1), straight out of the General Commands Manual, section 1. no version number and no date were printed on this one, so we're just vibing with the manual name and calling it a day. go install something cute, ily, bye π
β¨πΈ
π¦ where this page comes from
- debian bookworm: libbg-dev 2.04+dfsg-2.1 Β· LGPL-2.1-or-later
- debian trixie: libbg-dev 2.04+dfsg-8+b9 Β· LGPL-2.1-or-later
- ubuntu jammy: libbg-dev 2.04+dfsg-2.1 Β· LGPL-2.1-or-later
- ubuntu noble: libbg-dev 2.04+dfsg-6build1 Β· LGPL-2.1-or-later
- ubuntu questing: libbg-dev 2.04+dfsg-9
- ubuntu resolute: libbg-dev 2.04+dfsg-9build1 Β· LGPL-2.1-or-later
- ubuntu stonking: libbg-dev 2.04+dfsg-9ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms