A Shedmake Package is nothing more than a fodler with a handful of files that provide recipes for patching, compiling and archiving a piece of software. The only files required to be present are package.txt
, which contains metadata about the packaged software, and build.sh
, a shell script invoked to compile it. Bare versions of these files are provided in shedmake
's default template and are copied over automatically when using its create
action:
shedmake create my-new-package
A complete list of supported package files and folders, and a explanation of the fields in package.txt
follows.
File | Format | Required | Description |
---|---|---|---|
package.txt | plaintext | yes | This is the package metadata file that contains, among other thing, version, license and source location information. |
build.sh | bash script | yes | This shell script is invoked to configure and compile the packaged software. |
preinstall.sh | bash script | no | If present, shedmake invokes this script prior to installing files from the binary archive. |
install.sh | bash script | no | When this file is provided, shedmake will invoke it rather than expanding a binary archive to install files. |
postinstall.sh | bash script | no | This is an optional script run after the files in the binary archive have been installed. This mechanism is used to register systemd services and |
LICENSE | plaintext | no, but recommended | Provides a license for the included packaging files. The Shedbuilt developers typically provide packaging under the MIT License. |
.gitignore | git ignore file | no, but recommended | For packages that live in git repositories, we recommend including a .gitignore file to prevent the 'source', 'binary' and 'install' folders created by shedmake from being committed. |
Key | Values | Required | Description | Example |
---|---|---|---|---|
NAME | lowercase string, no spaces | yes | Name of the software being packaged | NAME=linux |
VERSION | string, no spaces | yes | Version of the software package given by its vendor | VERSION=4.15rc4 |
REVISION | integer, monotonically increasing | yes | Packaging revision for this software | REVISION=1 |
LICENSE | SPDX identifiers, space delimited | no | Indicates the license(s) under which the vendor provides the software. See https://spdx.org/licenses/ for valid values. | LICENSE=GPL-2.0-or-later |
SRC | HTTP/S or FTP URL | no | HTTP/S Git repo URL or download URL for the source archive | SRC=https://example.con/file.tar.xz |
SRCMD5 | MD5 hash | no | MD5 to verify integrity of the source archive downloaded from SRC | SRCMD5=0d701ac1e2a67d47ce7127432df2c32b |
SRCFILE | filename, no spaces | no | Specifies the filename for the archive downloaded from SRC, if provided. If not, name is determined by wget . |
SRCFILE=my_source_code.tar |
REF | Git refspec | no | If SRC is an HTTP/S Git repo URL, specifies the reference to fetch | REF=refs/heads/master |
COMMIT | Git commit hash | no | If SRC is an HTTP/S Git repo URL, specifies the commit to build | COMMIT=44f732b601640ee2bef7dbeb8dc7cf693f1e5b58 |
BIN | HTTP/S or FTP URL | no | URL to search for a Shedbuilt binary archive of this software | BIN=https://example.com/shedbuilt-games/ |
BINFILE | filename, no spaces, with variables | no | Provides a name or template for the binary archive shedmake creates when building the package | BINFILE=${NAME}${VERSION}${REVISION}_${SHEDRELEASE}${SHED_DEVICE}.${BINARCHEXT} |
STRIP | 'yes' or 'no' | no | Tells shedmake whether or not to strip libraries and executables built for this package. Default is specified in shedmake's config file. Can be overriden by command line options. |
STRIP=yes |
PURGE | 'yes' or 'no' | no | Tells shedmake whether or not to delete orphaned files when this package is upgraded. Default is 'no'. Can be overriden by command line options. |
CLEANUP=yes |
BUILDDEPS | package names, space delimited | no | Specifies packages that must be installed prior to building the current one. Package names may be placed in parentheses to indidate a 'soft' dependency whose installation may be deferred. This is used to break circular dependencies between certain pieces of software. | BUILDDEPS=binutils gmp mpfr mpc |
INSTALLDEPS | package names, space delimited | no | Specifies additional packages for shedmake to install just before the current one is installed. |
INSTALLDEPS=binutils gmp mpfr mpc |
RUNDEPS | package names, space delimited | no | Specifies additional packages for shedmake to install just after installation of the current one is completed. |
RUNDEPS=alsamixer |
OPTIONS | lowercase strings, space delimited | no | Specifies options the package can be built with. Items joined by a '|' are mutually exclusive. Items in parentheses are optional. | OPTIONS=release|bootstrap (docs) |
DEFAULTS | lowercase strings, space delimited | no | Specifies the options that the package should be built with by default | DEFAULTS=release docs |
ALIASES | lowercase strings, space delimited | no | Aliases universal build options to package-specific options | ALIASES=nanopineo|allh3cc|orangepione:sunxi |
Folder | Script Variable | Included in Repository | Description |
---|---|---|---|
source | SHED_PKG_SOURCE_DIR | no | shedmake optionally caches source code archives for the package in this folder, which can be removed using the clean action. |
binary | N/A | no | shedmake optionally caches compiled binary archives for the package in this folder, which can be removed using the clean action. |
install | SHED_PKG_LOG_DIR | no | shedmake records files installed by each package revision in this folder. It is created if necessary when the install action is invoked and removed by uninstall . |
patch | SHED_PKG_PATCH_DIR | yes | Patch files needed to correct issues in source code compiled by the package are stored in this directory which is optionally included in package repositories. |
contrib | SHED_PKG_CONTRIB_DIR | yes | Default configuration files installed by the package are stored in this folder which is optionally included in package repositories. |
During the build process, shedmake
generates folders to receive build artifacts that can be accessed using the following script variables:
Script Variable | Example | Description |
---|---|---|
SHED_FAKE_ROOT | /var/tmp/shedmake/linux/fakeroot | This is the directory into which build scripts should install files (i.e. the directory that should be passed to make as DESTDIR). |
SHED_PKG_DOCS_INSTALL_DIR | /usr/share/docs/linux-4.19.0 | This variable contains the directory into which package documentation should be installed, often passed to a configure script as the 'docdir'. |
SHED_PKG_DEFAULTS_INSTALL_DIR | /usr/share/defaults/screen/ | If the package installs default configuration files, they should be placed in this directory at build time. |