packaging: move the AUR package out of the repository
The PKGBUILD now lives in its own AUR clone, next to the other AUR packages, like those of the other own projects (prx, lazyntfy). It builds from the server's tag tarball with a pinned sha256 instead of a git source with SKIP. Remove packaging/aur, the srcinfo Makefile target and the makepkg ignore rules, and shorten the README section to a pointer to the AUR package.
This commit is contained in:
5 files changed
+6
-128
No files matched your search
@@ -1,4 +1 @@
|
||||
build/
|
||||
# makepkg output in packaging/aur
|
||||
packaging/aur/*/
|
||||
packaging/aur/*.pkg.tar.*
|
||||
@@ -5,7 +5,7 @@ GO ?= go
|
||||
# Static, reproducible binaries: no cgo, no local paths embedded.
|
||||
BUILD = CGO_ENABLED=0 $(GO) build -trimpath
|
||||
|
||||
.PHONY: all build check test lint install uninstall clean srcinfo
|
||||
.PHONY: all build check test lint install uninstall clean
|
||||
|
||||
all: build
|
||||
|
||||
@@ -34,7 +34,3 @@ uninstall:
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
# Regenerate the AUR metadata after editing packaging/aur/PKGBUILD.
|
||||
srcinfo:
|
||||
cd packaging/aur && makepkg --printsrcinfo > .SRCINFO
|
||||
@@ -111,35 +111,11 @@ Use `make install PREFIX=/usr/local` (as root) for a system-wide install.
|
||||
|
||||
### Arch Linux package
|
||||
|
||||
`packaging/aur/PKGBUILD` builds a package that follows the Arch Go package
|
||||
guidelines:
|
||||
|
||||
- the binaries are PIE and externally linked with makepkg's flags;
|
||||
- they are built with `-trimpath` and a read-only module graph;
|
||||
- `check()` runs the tests;
|
||||
- the version is stamped from `pkgver`.
|
||||
|
||||
The package installs `/usr/bin/x`, `/usr/bin/c` and the docs. It depends on
|
||||
`libarchive` and lists the other backends as optional dependencies.
|
||||
|
||||
To build and install from the release tag:
|
||||
|
||||
```sh
|
||||
cd packaging/aur && makepkg -si
|
||||
```
|
||||
|
||||
To publish a release to the AUR (package name `archive-utils`):
|
||||
|
||||
```sh
|
||||
git tag v1.0.0 && git push origin v1.0.0 # the PKGBUILD builds from this tag
|
||||
make srcinfo # after any PKGBUILD change
|
||||
git clone ssh://aur@aur.archlinux.org/archive-utils.git ~/aur/archive-utils
|
||||
cp packaging/aur/PKGBUILD packaging/aur/.SRCINFO ~/aur/archive-utils/
|
||||
cd ~/aur/archive-utils
|
||||
git add PKGBUILD .SRCINFO && git commit -m "Update to 1.0.0" && git push
|
||||
```
|
||||
|
||||
For a later release, update `pkgver`, reset `pkgrel=1`, tag, and repeat.
|
||||
An AUR package, `archive-utils`, is maintained separately from this
|
||||
repository. It builds from the release tags and follows the Arch Go package
|
||||
guidelines: PIE binaries, makepkg's flags, `-trimpath`, and the tests in
|
||||
`check()`. It installs `/usr/bin/x`, `/usr/bin/c` and the docs, depends on
|
||||
`libarchive`, and lists the other backends as optional dependencies.
|
||||
|
||||
> **Oh My Zsh users:** the `extract` plugin defines `alias x=extract`, and an
|
||||
> alias takes precedence over `~/.local/bin/x` in interactive zsh. Remove
|
||||
@@ -362,7 +338,6 @@ internal/cli GNU-style option parser, logger, exit codes, signal-aware ma
|
||||
internal/proc runs backend pipelines (pipefail semantics; SIGTERM on cancel)
|
||||
internal/fsx no-replace rename, read-only-safe move, merge and removal
|
||||
internal/progress zap-style live display: renderer and backend monitor
|
||||
packaging/aur PKGBUILD and .SRCINFO for the AUR
|
||||
internal/extract x: format detection, UDF probe, backends, staging and placement
|
||||
internal/create c: types, profiles, validation, backends
|
||||
tests/ end-to-end tests: build both binaries, run real archives
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
pkgbase = archive-utils
|
||||
pkgdesc = Safe, predictable archive extractor (x) and creator (c) built on bsdtar, GNU tar, 7-Zip and zip
|
||||
pkgver = 1.0.0
|
||||
pkgrel = 1
|
||||
url = https://src.panahifar.ir/ahp/archive-utils
|
||||
arch = x86_64
|
||||
arch = aarch64
|
||||
license = Unlicense
|
||||
checkdepends = 7zip
|
||||
checkdepends = binutils
|
||||
checkdepends = unzip
|
||||
checkdepends = zip
|
||||
makedepends = git
|
||||
makedepends = go
|
||||
depends = glibc
|
||||
depends = libarchive
|
||||
optdepends = 7zip: x for 7z, RAR and UDF ISO images; c for 7z
|
||||
optdepends = zip: c for zip
|
||||
optdepends = tar: c for tar archives (GNU tar)
|
||||
optdepends = gzip: x for .gz and .Z; c for tar.gz
|
||||
optdepends = bzip2: x for .bz2; c for tar.bz2
|
||||
optdepends = xz: x for .xz and .lzma; c for tar.xz
|
||||
optdepends = zstd: x for .zst; c for tar.zst
|
||||
source = git+https://src.panahifar.ir/ahp/archive-utils.git#tag=v1.0.0
|
||||
sha256sums = SKIP
|
||||
|
||||
pkgname = archive-utils
|
||||
@@ -1,63 +0,0 @@
|
||||
# Maintainer: Amir Husayn Panahifar <ahp at panahifar dot ir>
|
||||
|
||||
pkgname=archive-utils
|
||||
pkgver=1.0.0
|
||||
pkgrel=1
|
||||
pkgdesc='Safe, predictable archive extractor (x) and creator (c) built on bsdtar, GNU tar, 7-Zip and zip'
|
||||
arch=('x86_64' 'aarch64')
|
||||
url='https://src.panahifar.ir/ahp/archive-utils'
|
||||
license=('Unlicense')
|
||||
depends=(
|
||||
'glibc'
|
||||
'libarchive' # bsdtar: x extracts most formats with it
|
||||
)
|
||||
makedepends=('git' 'go')
|
||||
checkdepends=('7zip' 'binutils' 'unzip' 'zip')
|
||||
optdepends=(
|
||||
'7zip: x for 7z, RAR and UDF ISO images; c for 7z'
|
||||
'zip: c for zip'
|
||||
'tar: c for tar archives (GNU tar)'
|
||||
'gzip: x for .gz and .Z; c for tar.gz'
|
||||
'bzip2: x for .bz2; c for tar.bz2'
|
||||
'xz: x for .xz and .lzma; c for tar.xz'
|
||||
'zstd: x for .zst; c for tar.zst'
|
||||
)
|
||||
source=("git+$url.git#tag=v$pkgver")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
# Go settings from the Arch Go package guidelines: PIE, external linking
|
||||
# with makepkg's flags, reproducible paths, a read-only module graph, and a
|
||||
# module cache inside $srcdir that makepkg can clean.
|
||||
_goenv() {
|
||||
export CGO_CPPFLAGS="$CPPFLAGS" CGO_CFLAGS="$CFLAGS" CGO_CXXFLAGS="$CXXFLAGS" CGO_LDFLAGS="$LDFLAGS"
|
||||
export GOFLAGS='-buildmode=pie -trimpath -mod=readonly -modcacherw'
|
||||
export GOPATH="$srcdir/gopath" GOTOOLCHAIN=local
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd "$pkgname"
|
||||
_goenv
|
||||
go mod download
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$pkgname"
|
||||
_goenv
|
||||
go build \
|
||||
-ldflags "-linkmode=external -X src.panahifar.ir/ahp/archive-utils/internal/cli.Version=$pkgver" \
|
||||
-o build/ ./cmd/x ./cmd/c
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$pkgname"
|
||||
_goenv
|
||||
# -short skips the tests that need a pseudo-terminal.
|
||||
go test -short ./...
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$pkgname"
|
||||
install -Dm755 build/x build/c -t "$pkgdir/usr/bin/"
|
||||
install -Dm644 README.md DESIGN.md -t "$pkgdir/usr/share/doc/$pkgname/"
|
||||
# The Unlicense is a common license (/usr/share/licenses/spdx/Unlicense.txt).
|
||||
}
|
||||
Reference in new issue
Block a user