... | ... | @@ -3,14 +3,28 @@ |
|
|
|
|
|
## General Goals
|
|
|
|
|
|
`apkg` should make it easy to package software for various distributions directly from upstream.
|
|
|
`apkg` must make it easy to package software for various operating system distributions directly from upstream.
|
|
|
|
|
|
`apkg` should follow conventions and best practices of individual distributions as opposed to forcing a custom approach.
|
|
|
|
|
|
`apkg` must be minimalist and maintainable. It should reuse existing tools and only provide glue and reasonable conventions required to use these tools together across different distributions.
|
|
|
|
|
|
`apkg` must be pleasant to use from interactive terminal sessions, shell scripts, python scripts (as a module), and in CI systems.
|
|
|
|
|
|
`apkg` should be smart and infer as much information from environment as possible in order to require no or little parameters to perform its duties. This must be transparent and still allow fine control. If human can do it, machine can too.
|
|
|
|
|
|
`apkg` should lead by example by using and promoting the best packaging practices and providing reasonable conventions and defaults for projects that wish to do packaging right.
|
|
|
|
|
|
`apkg` should be replaceable. Projects following `apkg` conventions should be able to continue packaging (with few scripts of their own probably) even if they chose to drop `apkg`.
|
|
|
|
|
|
## Concepts
|
|
|
|
|
|
## Convetions
|
|
|
* `distro` refers to operating system distribution such as Debian, Fedora, Arch, NixOS, etc.
|
|
|
* `repo` refers to `git` (or other VCS) repository containing project sources
|
|
|
* `package` refers to a package archive accepted by a package manager of particular OS distribution
|
|
|
* `package sources` refer to files needed in order to build a package. This varies a lot between distros, for example RPMs are built from a single `.src.rpm` source package while `.deb` packages are built from upstream sources with added `debian` files
|
|
|
|
|
|
## Conventions
|
|
|
|
|
|
`apkg` is to be invoked in a local `git` copy of a project to be packaged.
|
|
|
|
... | ... | @@ -75,10 +89,10 @@ project |
|
|
|
|
|
Let's start with common packaging operations such as:
|
|
|
|
|
|
### create a package source from current upstream project commit
|
|
|
### create package sources from current upstream project commit
|
|
|
|
|
|
* `package-*.src.rpm` for RPM-based systems such as Fedora, CentOS, SUSE, RHEL
|
|
|
* `package_*.dsc` and friends for Debian-based systems including Ubuntu and clones
|
|
|
* upstream tree with `debian` dir for Debian-based systems including Ubuntu and clones
|
|
|
* `PKGBUILD` for Arch
|
|
|
* in general whatever is needed to build a package somewhere
|
|
|
|
... | ... | @@ -94,11 +108,10 @@ $> apkg get-package-source rpm |
|
|
```
|
|
|
Results in `package-sources/rpm/package-*.src.rpm` (source RPM ready to be built)
|
|
|
|
|
|
|
|
|
```
|
|
|
$> apkg get-package-source ubuntu
|
|
|
```
|
|
|
Is an equivalent of `apkg get-package-source deb` - `apkg` should accept both packaging types (`rpm`, `deb`, ...) and distro names (`debian`, `ubuntu`, `fedora`, `suse`, `arch`, ...).
|
|
|
is an equivalent of `apkg get-package-source deb`. `apkg` should accept both packaging types (`rpm`, `deb`, ...) and distro names (`debian`, `ubuntu`, `fedora`, `suse`, `arch`, ...).
|
|
|
|
|
|
```
|
|
|
$> apkg get-package-source
|
... | ... | @@ -114,6 +127,7 @@ $> apkg build-local |
|
|
|
|
|
Results in `packages/ubuntu/package_*.deb` (depending on current distro)
|
|
|
|
|
|
|
|
|
### check current packaging status
|
|
|
|
|
|
```
|
... | ... | |