+-------------------------------------------------------+ | | | KISS PACKAGE SYSTEM | | | | * The distribution employs a package system based | | around the concept of easily parseable plain-text | | files (*separated by lines and spaces*). | | | | * This format allows effortless interface using any | | programming language or just basic UNIX tools. | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | DIRECTORY STRUCTURE | | | | zlib/ # Package name. | | |- build # Build script (chmod +x). | | |- sources # Remote and local sources. | | |- version # Package version. | | | | # Optional files. | | | | |- depends # Dependencies (usually required). | | |- pre-remove # Pre-remove script (chmod +x). | | |- post-install # Post-install script (chmod +x). | | |- patches/* # Directory to store patches. | | |- files/* # Directory to store misc files. | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | BUILD | | | | * The build file should contain all of the steps | | necessary to patch, configure, make and install | | ('make install' in this context) the package. | | | | * The file is language agnostic and the only | | requirement is that it be executable. | | | | * On execution the script will start in the | | directory of the package's source (no need to cd). | | | | * The script is also given a single argument | | (equivalent to 'script arg'), this argument | | contains the path where the script should | | install the compiled files. | | | | * Everything in the path is added to the package | | tarball and later installed to the system. | | | | | | EXAMPLE | | | | #!/bin/sh -e | | | | # Disable stripping (add this only if needed). | | :> nostrip | | | | ./configure \ | | --prefix=/usr | | | | make | | make DESTDIR="$1" install | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | DEPENDS | | | | * The depends file should contain any other packages | | the package depends on to function correctly. | | | | * Each dependency should be listed one per line and | | an optional second field allows for the | | distinction between a compile time dependency and | | a run time one. | | | | * The optional second field should be set to 'make' | | for compile time dependencies and left blank for | | runtime dependencies. | | | | * The depends file can be omitted entirely if the | | package has no dependencies. | | | | | | EXAMPLE | | | | # Comments are also supported. | | | | # Perl is needed at compile time. | | perl make | | | | # zlib is needed at runtime. | | zlib | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | SOURCES | | | | * The sources file should contain all remote and | | local files needed by the package during the build. | | | | * This includes the source, patches and any other | | miscellaneous files which may be needed. | | | | * Each source should be listed one per line. | | An optional second field specifies an extraction | | directory (relative to the build directory). | | | | * Sources which pull from a git repository use a | | special syntax. An additional prefix 'git+' should | | be added with an optional suffix #hash or #branch). | | | | | | EXAMPLE | | | | https://example.com/dhcpcd-8.0.2.tar.xz | | files/dhcpcd.run | | | | | | EXAMPLE (WITH SECOND FIELD) | | | | https://example.com/gcc-9.1.0.tar.xz gcc | | https://example.com/gmp-6.1.2.tar.xz gcc/gmp | | https://example.com/mpfr-4.0.2.tar.xz gcc/mpfr | | https://example.com/mpc-1.1.0.tar.gz gcc/mpc | | | | | | EXAMPLE (GIT) | | | | git+https://github.com/dylanaraps/eiwd | | | | # Grabbing a specific branch. | | git+https://github.com/dylanaraps/eiwd@branch | | | | # Grabbing a specific commit. | | git+https://github.com/dylanaraps/eiwd#commit | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | VERSION | | | | * The version file should contain a single line with | | two fields. All other lines will be ignored. | | | | * The first field should contain the software's | | upstream version and the second field should | | contain the version number of the repository | | files themselves. | | | | * If the package is using a git source to pull | | down the latest commit, the version should be | | simply set to git. | | | | | | EXAMPLE | | | | 1.2.3 1 | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | PRE-REMOVE | | | | * The pre-remove file should contain anything that | | needs run prior to the removal of the package. | | | | * The file is language agnostic and the only | | requirement is that it be executable. | | | | | | EXAMPLE | | | | #!/bin/sh -e | | | | printf 'No one has used this yet!\n' | | printf 'I have no example!\n' | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | POST-INSTALL | | | | * The post-install file should contain anything that | | needs to be run after a package installation to | | properly setup the software. | | | | * The file is language agnostic and the only | | requirement is that it be executable. | | | | | | EXAMPLE | | | | #!/bin/sh -e | | | | /usr/sbin/update-ca-certificates --fresh | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | PATCHES/* | | | | * The patches directory should contain any patches | | the software needs. | | | | * In the `sources` file patches are referred to by | | using a relative path (patches/musl.patch). | | | | * The package manager does not automatically apply | | patches. This must be done in the build script | | of the package. | | | | * The build script has direct access to the patches | | in its current working directory. | | | | | | EXAMPLE SOURCES FILE | | | | https://example.com/rxvt-unicode-9.22.tar.bz2 | | patches/gentables.patch | | patches/rxvt-unicode-kerning.patch | | | | | | EXAMPLE BUILD FILE | | | | #!/bin/sh -e | | | | patch -p1 < rxvt-unicode-kerning.patch | | patch -p1 < gentables.patch | | | | ./configure \ | | --prefix=/usr | | | | make | | make DESTDIR="$1" install | | | | | +-------------------------------------------------------+ +-------------------------------------------------------+ | | | FILES/* | | | | * The files/ directory should contain any | | miscellaneous files the software needs. | | | | * In the sources file, files are referred to by | | using a relative path (files/busybox.config). | | | | * The build script has direct access to the files | | in its current working directory. | | | | | | EXAMPLE SOURCES FILE | | | | https://example.com/kiss-1.0.0.tar.gz | | files/kiss_path.sh | | | | | | EXAMPLE BUILD FILE | | | | #!/bin/sh -e | | | | install -D kiss "$1/usr/bin/kiss" | | | | # Accessible directly in '$PWD'. | | install -D kiss_path.sh "$1/etc/kiss_path.sh" | | | | | +-------------------------------------------------------+