Skip to content

Commit

Permalink
chore: README.md: move some content in the wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
M0Rf30 committed Mar 16, 2024
1 parent 5985df9 commit 9136fd3
Showing 1 changed file with 36 additions and 126 deletions.
162 changes: 36 additions & 126 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,148 +5,58 @@
[![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/M0Rf30/yap)
[![View examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](examples)

Yap allows building packages for multiple GNU/Linux distributions with a
consistent package spec format.
## Introduction

Builds are done on OCI containers without needing to setup any virtual
machines or install any software other than Docker/Podman.
Yap is a versatile tool designed to simplify the process of building packages
for multiple GNU/Linux distributions. It provides a consistent package
specification format, reducing the complexity typically associated with
multi-distribution package building.

All packages are built using a simple format that is similar to
[PKGBUILD](https://wiki.archlinux.org/index.php/PKGBUILD) from Arch Linux.
## Key Features

Each distribution is different and will still require different build
instructions, but a consistent build process and format can be used for all
builds.
- **OCI Container Builds:** Yap conducts builds on OCI containers, eliminating
the need for setting up any virtual machines or installing any software other
than Docker/Podman.
- **Simple Format:** Yap uses a simple format that is similar to [PKGBUILD](https://wiki.archlinux.org/index.php/PKGBUILD) from Arch Linux, making it easy to use and understand.
- **Consistent Build Process:** Though each Linux distribution requires different build instructions, Yap ensures a consistent build process and format across all builds.

## Format
## Quick start

To install latest release, follow the steps below:

```sh
key="example string"
key=`example "quoted" string`
key=("list with one element")
key=(
"list with"
"multiple elements"
)
key="example ${variable} string"
key__ubuntu="this will apply only to Ubuntu builds"
```
# First, download the latest version of the software from the goreleaser
# archives
wget https://github.com/M0Rf30/yap/releases/latest/download/yap_Linux_x86_64.tar.gz

## Builtin Variables

| key | value |
| ----------- | ----------------------------------------------------------------- |
| `${srcdir}` | `Source` directory where all sources are downloaded and extracted |
| `${pkgdir}` | `Package` directory for the root of the package |

## Spec file - the PKGBUILD

| key | type | value |
|--------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `pkgname` | `string` | Package name |
| `epoch` | `string` | Package epoch |
| `pkgver` | `string` | Package version |
| `pkgrel` | `string` | Package release number |
| `pkgdesc` | `string` | Short package description |
| `maintainer` | `string` | Package maintainer |
| `arch` | `list` | Package architecture, can be `any` or `x86_64` |
| `license` | `list` | List of licenses for packaged software |
| `section` | `string` | Section for package. Built in sections available: `admin` `localization` `mail` `comm` `math` `database` `misc` `debug` `net` `news` `devel` `doc` `editors` `electronics` `embedded` `fonts` `games` `science` `shells` `sound` `graphics` `text` `httpd` `vcs` `interpreters` `video` `web` `kernel` `x11` `libdevel` `libs` |
| `priority` | `string` | Package priority, only used for Debian packages |
| `url` | `string` | Package url |
| `depends` | `list` | List of package dependencies |
| `optdepends` | `list` | List of package optional dependencies |
| `makedepends` | `list` | List of package build dependencies |
| `provides` | `list` | List of packages provided |
| `conflicts` | `list` | List of packages conflicts |
| `source` | `list` | List of packages sources. Sources can be url or paths that are relative to the PKGBUILD |
| `debconf_config` | `string` | File used as debconf config, only used for Debian packages |
| `debconf_template` | `string` | File used as debconf template, only used for Debian packages |
| `hashsums` | `list` | List of `sha256`/`sha512` hex hashes for sources, hash type is determined by the length of the hash. Use `SKIP` to ignore hash check |
| `backup` | `list` | List of config files that shouldn't be overwritten on upgrades |
| `build` | `func` | Function to build the source, starts in srcdir |
| `package` | `func` | Function to package the source into the pkgdir, starts in srcdir |
| `preinst` | `func` | Function to run before installing |
| `postinst` | `func` | Function to run after installing |
| `prerm` | `func` | Function to run before removing |
| `postrm` | `func` | Function to run after removing |

### Build targets

| target | value |
|------------------|---------------------------|
| `alpine` | all Alpine Linux releases |
| `arch` | all Arch Linux releases |
| `amazon` | all Amazon Linux releases |
| `centos` | all CentOS releases |
| `debian` | all Debian releases |
| `fedora` | all Fedora releases |
| `oracle` | all Oracle Linux releases |
| `ubuntu` | all Ubuntu releases |
| `amazon-1` | Amazon Linux 1 |
| `amazon-2` | Amazon Linux 2 |
| `debian-jessie` | Debian Jessie |
| `debian-stretch` | Debian Stretch |
| `debian-buster` | Debian Buster |
| `fedora-38` | Fedora 38 |
| `rocky-8` | Rocky Linux 8 |
| `rocky-9` | Rocky Linux 9 |
| `ubuntu-bionic` | Ubuntu Bionic |
| `ubuntu-focal` | Ubuntu Focal |
| `ubuntu-jammy` | Ubuntu Jammy |

### Directives

Directives are used to specify variables that only apply to a limited set of
build targets.

All variables can use directives including user defined variables.

To use directives include the directive after a variable separated by a colon
such as `pkgdesc__ubuntu="This description will only apply to Ubuntu packages"`.

The directives above are sorted from lowest to the highest priority.

| directive | value |
|------------------|---------------------------|
| `apk` | all apk packages |
| `apt` | all deb packages |
| `pacman` | all pkg packages |
| `yum` | all yum rpm packages |
| `alpine` | all Alpine Linux packages |
| `arch` | all Arch Linux releases |
| `amazon` | all Amazon Linux releases |
| `centos` | all CentOS releases |
| `debian` | all Debian releases |
| `fedora` | all Fedora releases |
| `oracle` | all Oracle Linux releases |
| `ubuntu` | all Ubuntu releases |
| `amazon_1` | Amazon Linux 1 |
| `amazon_2` | Amazon Linux 2 |
| `debian_jessie` | Debian Jessie |
| `debian_stretch` | Debian Stretch |
| `debian_buster` | Debian Buster |
| `fedora_38` | Fedora 38 |
| `rocky_8` | Rocky Linux 8 |
| `rocky_9` | Rocky Linux 9 |
| `ubuntu_bionic` | Ubuntu Bionic |
| `ubuntu_focal` | Ubuntu Focal |
| `ubuntu_jammy` | Ubuntu Jammy |
# Next, extract the downloaded archive
tar -xvf yap_Linux_x86_64.tar.gz

## Examples
# Move the extracted files to a directory in your PATH
sudo mv yap /usr/local/bin/

Please have a look under the `examples` folder.
# Verify the installation
yap version
```

You'll find:
## Documentation

Detailed documentation and guidelines on how to use Yap are available on our
[wiki](https://github.com/M0Rf30/yap/wiki).

## Examples

To get a better understanding of how Yap works, you can refer to the examples
provided in the [examples](examples) folder. Here you'll find:
- [the project definition](examples/yap.json)
- [the spec file](examples/yap/PKGBUILD)

## License

See [LICENSE](LICENSE.md) file for details.
Yap is licensed under the terms mentioned in the [LICENSE](LICENSE.md) file.

## Credits

[Zachary Huff](https://github.com/zachhuff386), for his work on Pacur, on which
Yap is based on.
We would like to express our gratitude to
[Zachary Huff](https://github.com/zachhuff386) for his significant contributions
to Pacur, the project on which Yap is based.

0 comments on commit 9136fd3

Please sign in to comment.