... | ... | @@ -20,6 +20,7 @@ This is a draft - comments/discussion/edits are **WELCOME** |
|
|
|
|
|
## Concepts
|
|
|
|
|
|
* `archive` refers to archive containing project source code (also known as tarball).
|
|
|
* `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
|
... | ... | @@ -90,44 +91,61 @@ project |
|
|
|
|
|
Let's start with common packaging operations such as:
|
|
|
|
|
|
### create package sources from current upstream project commit
|
|
|
### create package sources (files to build package(s) from)
|
|
|
|
|
|
* `package-*.src.rpm` for RPM-based systems such as Fedora, CentOS, SUSE, RHEL
|
|
|
* upstream tree with `debian` dir for Debian-based systems including Ubuntu and clones
|
|
|
* `package_*.{dsc,debian.tar.xz,orig.tar.xz}` for Debian-based systems including Ubuntu and clones
|
|
|
* `PKGBUILD` for Arch
|
|
|
* in general whatever is needed to build a package somewhere
|
|
|
|
|
|
Detect current distro and build natively by default. In future, cross-build using VMs will be supported.
|
|
|
|
|
|
By default, create and use archive(tarball) from current `git` commit but allow using remote and local archives instead including automatic download when configured.
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
```
|
|
|
$> apkg get-package-source deb
|
|
|
$> apkg make-package-source (make-pkgsrc, pkgsrc, ...?)
|
|
|
```
|
|
|
Results in `package-sources/deb/*` (source tree copy with `debian/` dir included - ready for package build)
|
|
|
|
|
|
Results:
|
|
|
* on `.deb`-based distro: `package-sources/deb/package_*.{dsc,debian.tar.xz,orig.tar.xz}`
|
|
|
* on `.rpm`-based distro: `package-sources/rpm/package-*.src.rpm`
|
|
|
* etc.
|
|
|
|
|
|
```
|
|
|
$> apkg get-package-source rpm
|
|
|
$> apkg make-package-source --archive ./archives/package-1.0.0.tgz
|
|
|
```
|
|
|
Results in `package-sources/rpm/package-*.src.rpm` (source RPM ready to be built)
|
|
|
Build package source from specified local archive.
|
|
|
|
|
|
|
|
|
```
|
|
|
$> apkg get-package-source ubuntu
|
|
|
$> apkg make-package-source --archive https://some.page/archives/package-1.0.0.tgz
|
|
|
```
|
|
|
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`, ...).
|
|
|
Download specified archive and use it to package source.
|
|
|
|
|
|
```
|
|
|
$> apkg get-package-source
|
|
|
$> apkg make-package-source --get-archive
|
|
|
```
|
|
|
Results in package sources for current distribution in respective directory in `package-sources/`.
|
|
|
Download archive matching current git commit from upstream - requires configuration regarding archive URL that can optionally be stored in `distro/apkg.conf`.
|
|
|
|
|
|
```
|
|
|
$> apkg make-package-source --get-archive --version 1.2.3
|
|
|
```
|
|
|
|
|
|
Download upstream archive version 1.2.3 (config required), [Switch `git` to version `1.2.3`?], and use it to build package source.
|
|
|
|
|
|
|
|
|
### build a package from current commit locally
|
|
|
|
|
|
```
|
|
|
$> apkg build-local
|
|
|
$> apkg build-local (build-package, build-pkg, build, ...?)
|
|
|
```
|
|
|
|
|
|
Results in `packages/ubuntu/package_*.deb` (depending on current distro)
|
|
|
|
|
|
Similar to `make-source-package` with extra step of local build.
|
|
|
|
|
|
|
|
|
### check current packaging status
|
|
|
|
... | ... | |