... | ... | @@ -79,36 +79,65 @@ Furthermore, having packaging templates in a dedicated `distro/pkg/` directory h |
|
|
|
|
|
### Output
|
|
|
|
|
|
Any successful `apkg` operation MUST result in a clean git repository.
|
|
|
Any successful `apkg` operation on a repo MUST result in a clean repo.
|
|
|
|
|
|
Operations that modify project source (for example files in `distro/`) MUST create appropriate and well-named commit, inform user about creation of new commit (for example by showing `diff`), and result in clean `git` (when they succeed). That way, user can easily view what `apkg` did using `git show` and/or undo by `git reset --hard HEAD~` when unhappy with results.
|
|
|
|
|
|
Operations that generate files shouldn't spam project root - create a few well-named output directories and put files there.
|
|
|
|
|
|
When generating distro-specific files, mirror the respective layout of `distro/` sub-directories when viable, for example:
|
|
|
|
|
|
```
|
|
|
project
|
|
|
└── package-sources
|
|
|
All project-specific `apkg` **output** files should be placed into respective subdirs in **output-only `pkg/` dir**:
|
|
|
|
|
|
```
|
|
|
pkg
|
|
|
├── archives
|
|
|
│ ├── dev
|
|
|
│ │ └── knot-resolver-5.1.3.1602777860.d5fc45b3.tar.xz
|
|
|
│ └── upstream
|
|
|
│ ├── knot-resolver-5.1.3.tar.xz
|
|
|
│ └── knot-resolver-5.1.3.tar.xz.asc
|
|
|
├── build
|
|
|
│ ├── packages
|
|
|
│ │ ├── arch
|
|
|
│ │ ├── debian-10
|
|
|
│ │ └── fedora-32
|
|
|
│ └── source-packages
|
|
|
│ ├── arch
|
|
|
│ ├── debian-10
|
|
|
│ └── fedora-32
|
|
|
├── packages
|
|
|
│ ├── arch
|
|
|
│ ├── debian-10
|
|
|
│ └── fedora-32
|
|
|
└── source-packages
|
|
|
├── arch
|
|
|
│ └── arch_files
|
|
|
├── deb
|
|
|
│ └── debian_files
|
|
|
└── rpm
|
|
|
└── rpm_files
|
|
|
├── debian-10
|
|
|
└── fedora-32
|
|
|
```
|
|
|
|
|
|
This structure has following advantages:
|
|
|
|
|
|
* not spamming project root with temporary files
|
|
|
* each kind of file has a well-defined dedicated directory:
|
|
|
* dev archive
|
|
|
* upstream archive
|
|
|
* source package build files
|
|
|
* package build files
|
|
|
* source packages
|
|
|
* packages
|
|
|
* build files separated from build outputs
|
|
|
* if build fails, user can just go to `pkg/build/*` and continue where `apkg` ended
|
|
|
* individual dirs or even entire `pkg/` can be safely deleted
|
|
|
|
|
|
|
|
|
## Initial goals
|
|
|
|
|
|
Let's start with common packaging operations such as:
|
|
|
|
|
|
|
|
|
### make archive from repo
|
|
|
|
|
|
```
|
|
|
$> apkg make-archive [v1.2.3]
|
|
|
```
|
|
|
creates source archive from current (or specified) repo commit in `archives/local/project-*`.
|
|
|
creates source archive from current (or specified) repo commit in `pkg/archives/dev/*`.
|
|
|
|
|
|
|
|
|
### get upstream archive
|
... | ... | @@ -116,49 +145,49 @@ creates source archive from current (or specified) repo commit in `archives/loca |
|
|
```
|
|
|
$> apkg get-archive [1.2.3]
|
|
|
```
|
|
|
downloads upstream archive for current commit (or specified version) into `archives/upstream/project-*` - requires archive URL configuration, supports signatures too. Such config can be optionally stored in `distro/apkg.conf`
|
|
|
downloads upstream archive for current commit (or specified version) into `pkg/archives/upstream/*` - requires archive URL configuration, supports signatures too. Such config can be stored in `distro/.apkg/config.yaml`
|
|
|
|
|
|
Both `make-archive` and `get-archive` (when configured) will be used by other commands when requested through parameters and might be useful to user on their own - better expose them properly.
|
|
|
|
|
|
|
|
|
### create package sources (files to build package(s) from)
|
|
|
### create sources packages (files to build package(s) from)
|
|
|
|
|
|
* `package-*.src.rpm` for RPM-based systems such as Fedora, CentOS, SUSE, RHEL
|
|
|
* `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 native package sources by default. In future, cross-build using VMs will probably be supported.
|
|
|
Detect current distro and build native source packages by default. In future, cross-build using VMs will probably be supported.
|
|
|
|
|
|
By default, create and use archive(tarball) from current repo commit but allow using remote and local archives as supported by `{make,get}-archive`.
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
```
|
|
|
$> apkg make-package-source (make-pkgsrc, pkgsrc, ...?)
|
|
|
$> apkg make-source-package (make-srckpkg, srcpkg, ...?)
|
|
|
```
|
|
|
|
|
|
* 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`
|
|
|
* on `.deb`-based distro: `pkg/source-packages/Debian-10/package_*.{dsc,debian.tar.xz,orig.tar.xz}`
|
|
|
* on `.rpm`-based distro: `pkg/source-packages/Fedora-32/package-*.src.rpm`
|
|
|
* etc.
|
|
|
|
|
|
```
|
|
|
$> apkg make-package-source --archive ./archives/upstream/package-1.0.0.tgz
|
|
|
$> apkg make-source-package --archive ./pkg/archives/upstream/package-1.0.0.tgz
|
|
|
```
|
|
|
builds package source from specified local archive.
|
|
|
|
|
|
```
|
|
|
$> apkg make-package-source --archive https://some.page/archives/package-1.0.0.tgz
|
|
|
$> apkg make-source-package --archive https://some.page/archives/package-1.0.0.tgz
|
|
|
```
|
|
|
downloads specified archive and uses it to create package source.
|
|
|
|
|
|
```
|
|
|
$> apkg make-package-source --get-archive
|
|
|
$> apkg make-source-package --get-archive
|
|
|
```
|
|
|
downloads archive matching current repo commit from upstream (using `get-archive`) and creates package source from it. Requires configuration regarding archive URL.
|
|
|
|
|
|
```
|
|
|
$> apkg make-package-source --get-archive --version 1.2.3
|
|
|
$> apkg make-source-package --get-archive --version 1.2.3
|
|
|
```
|
|
|
downloads upstream archive version `1.2.3` (using `get-archive`), [switches `git` to version `1.2.3`?], and uses it to create package sources.
|
|
|
|
... | ... | @@ -169,12 +198,11 @@ downloads upstream archive version `1.2.3` (using `get-archive`), [switches `git |
|
|
$> apkg build-local (build-package, build-pkg, build, ...?)
|
|
|
```
|
|
|
|
|
|
Results in `packages/ubuntu/package_*.deb` (depending on current distro)
|
|
|
Results in `pkg/packages/Ubuntu-20.04/package_*.deb` (depending on current distro)
|
|
|
|
|
|
Similar to `make-source-package` with extra step of local build.
|
|
|
|
|
|
|
|
|
|
|
|
### check current packaging status
|
|
|
|
|
|
```
|
... | ... | |