mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-13 00:16:45 +02:00
135 lines
4.2 KiB
Text
135 lines
4.2 KiB
Text
maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
|
|
pkgname=zot
|
|
pkgver=2.1.2
|
|
_zui_commit=930ae7e0d386b8a0d44307b5b47bdf5db2dccf70
|
|
pkgrel=3
|
|
pkgdesc="Vendor-neutral OCI-native container image registry"
|
|
url="https://zotregistry.dev/"
|
|
# 32-bit: tests fail to build
|
|
# riscv64: npm run build fails
|
|
arch="all !x86 !armhf !armv7 !riscv64"
|
|
license="Apache-2.0"
|
|
makedepends="go linux-headers npm nodejs"
|
|
checkdepends="openssl"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-openrc
|
|
$pkgname-cli:_cli
|
|
$pkgname-exporter:_exporter
|
|
$pkgname-cli-bash-completion:_bashcomp:noarch
|
|
$pkgname-cli-fish-completion:_fishcomp:noarch
|
|
$pkgname-cli-zsh-completion:_zshcomp:noarch
|
|
"
|
|
source="
|
|
$pkgname-$pkgver.tar.gz::https://github.com/project-zot/zot/archive/refs/tags/v$pkgver.tar.gz
|
|
zui-$_zui_commit.tar.gz::https://github.com/project-zot/zui/archive/$_zui_commit.tar.gz
|
|
zot.initd
|
|
zot.confd
|
|
|
|
basename_patch
|
|
"
|
|
options="net" # download Go modules
|
|
|
|
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
|
|
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
|
|
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
|
|
|
|
prepare() {
|
|
default_prepare
|
|
go mod vendor -v
|
|
patch -p1 -i "$srcdir"/basename_patch
|
|
|
|
cd "$srcdir"/zui-$_zui_commit
|
|
npm install --no-progress
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir"/zui-$_zui_commit
|
|
npm run build
|
|
cp -r build "$builddir"/pkg/extensions/
|
|
|
|
cd "$builddir"
|
|
local _extensions="sync,search,scrub,metrics,lint,ui,mgmt,profile,userprefs,imagetrust"
|
|
local _goldflags="
|
|
-X zotregistry.dev/zot/pkg/api/config.ReleaseTag=v$pkgver
|
|
-X zotregistry.dev/zot/pkg/api/config.Commit=AlpineLinux
|
|
-X zotregistry.dev/zot/pkg/api/config.BinaryType=${_extensions//,/-}
|
|
-X zotregistry.dev/zot/pkg/api/config.GoVersion=$(go env GOVERSION)
|
|
"
|
|
|
|
for binary in zot zb zli; do
|
|
go build -v \
|
|
-ldflags "$_goldflags" \
|
|
-tags "$_extensions,containers_image_openpgp" \
|
|
./cmd/$binary
|
|
done
|
|
go build -v -tags containers_image_openpgp ./cmd/zxp
|
|
|
|
# Only generate shell completions for the CLI client
|
|
for shell in bash fish zsh; do
|
|
./zli completion $shell > zli.$shell
|
|
done
|
|
}
|
|
|
|
check() {
|
|
# A small part of 'make test/data'
|
|
mkdir -p test/data/noidentity
|
|
cd test/data
|
|
sh ../scripts/gen_certs.sh
|
|
cd noidentity
|
|
sh ../../scripts/gen_nameless_certs.sh
|
|
|
|
# Skip tests requiring static container image tarballs (pulled via skopeo) in $builddir/test/data/
|
|
cd "$builddir"
|
|
go test -tags containers_image_openpgp \
|
|
-skip 'TestGarbageCollectForImageStore|TestImageBuilder|TestPredefinedImages' \
|
|
./...
|
|
}
|
|
|
|
package() {
|
|
install -Dm755 zot -t "$pkgdir"/usr/bin/
|
|
|
|
install -Dm644 examples/config-*.json -t "$pkgdir"/usr/share/doc/zot/examples/
|
|
|
|
install -Dm755 "$srcdir"/zot.initd -t "$pkgdir"/etc/init.d/zot
|
|
install -Dm644 "$srcdir"/zot.confd -t "$pkgdir"/etc/conf.d/zot
|
|
}
|
|
|
|
_cli() {
|
|
pkgdesc="$pkgdesc - CLI tools"
|
|
install -Dm755 "$builddir"/zli "$builddir"/zb -t "$subpkgdir"/usr/bin/
|
|
}
|
|
|
|
_exporter() {
|
|
pkgdesc="$pkgdesc - metrics exporter"
|
|
install -Dm755 "$builddir"/zxp -t "$subpkgdir"/usr/bin/
|
|
}
|
|
|
|
_bashcomp() {
|
|
pkgdesc="Bash completions for $pkgname-cli"
|
|
install_if="bash-completion $pkgname-cli=$pkgver-r$pkgrel"
|
|
install -Dm644 "$builddir"/zli.bash \
|
|
"$subpkgdir"/usr/share/bash-completion/completions/zli
|
|
}
|
|
|
|
_fishcomp() {
|
|
pkgdesc="Fish completions for $pkgname-cli"
|
|
install_if="fish $pkgname-cli=$pkgver-r$pkgrel"
|
|
install -Dm644 "$builddir"/zli.fish \
|
|
"$subpkgdir"/usr/share/fish/vendor_completions.d/zli.fish
|
|
}
|
|
|
|
_zshcomp() {
|
|
pkgdesc="Zsh completions for $pkgname-cli"
|
|
install_if="zsh $pkgname-cli=$pkgver-r$pkgrel"
|
|
install -Dm644 "$builddir"/zli.zsh \
|
|
"$subpkgdir"/usr/share/zsh/site-functions/_zli
|
|
}
|
|
|
|
sha512sums="
|
|
304aa2694db8216fd8e170417802b074d494656845931df504de6578a1c84f959435f1bf7fb97e8dc2f7eb154280ce61f4729f8262901e64378d39f3cae2b12d zot-2.1.2.tar.gz
|
|
d30412ba447e52948488addba33540d266ec050f2aeff13ffa9fe004fc5c9aeddaafdd90842ca29f18199819abcc40cf21b333b940e5f6cd0df135265aad51d1 zui-930ae7e0d386b8a0d44307b5b47bdf5db2dccf70.tar.gz
|
|
86dfa273e97110b703fbc368757520ef6169dead185ff54b5b8ba45e764949bc3a21a51d53a1605d7163faef8c83c066e688577f5315b8c0afb09f69a2bbe3bb zot.initd
|
|
b128ecaf3e35cfdab8069da9a8267a9faed50b892ae07b6a4a22a4108236d6cdbc10cc4cf0105c728e9e6da6ac773f56d1dd84de1ba4463110058b6c2f190b30 zot.confd
|
|
640526de31a5eb21112c3d3fd30ce78331e5f5998166c9af9405ebad919a9a895ee82e3eed7067c2ce7e3e558e31907398fec1ad895be708e9f8ada696076216 basename_patch
|
|
"
|