# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=garage pkgver=0.8.2 pkgrel=1 pkgdesc="Lightweight S3-compatible distributed object store" url="https://garagehq.deuxfleurs.fr" # armhf,armv7,x86: fails to build (std::bad_alloc) # riscv64: would take eternity to build arch="all !armhf !armv7 !x86 !riscv64" license="AGPL-3.0" makedepends=" cargo cargo-auditable libsodium-dev protoc sqlite-dev zstd-dev " checkdepends="openssl-dev" pkgusers="garage" pkggroups="garage" install="$pkgname.pre-install $pkgname.post-upgrade" subpackages=" $pkgname-convert-db:_convertdb $pkgname-openrc " source="https://github.com/deuxfleurs-org/garage/archive/v$pkgver/garage-$pkgver.tar.gz fix-website-test-k2v.patch syslog-support.patch garage.toml garage-migrate-to-lmdb $pkgname.initd $pkgname.confd " case "$CARCH" in # Fails to build ring crate. ppc64le | s390x) options="!check";; esac _cargo_opts="--frozen --no-default-features --features system-libs,sled,lmdb" export CARGO_PROFILE_RELEASE_OPT_LEVEL=2 export SODIUM_USE_PKG_CONFIG=1 export GIT_VERSION="v$pkgver" # version used in --version prepare() { default_prepare cargo fetch --target="$CTARGET" --locked } build() { cargo auditable build $_cargo_opts --release cargo auditable build -p garage_db --bin convert --features cli,lmdb,sqlite --frozen --release } check() { cargo test $_cargo_opts --workspace } package() { install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/ install -D -m755 target/release/convert "$pkgdir"/usr/bin/garage-convert-db install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname install -D -m644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname install -D -m640 -o garage -g garage "$srcdir"/garage.toml -t "$pkgdir"/etc/ install -D -m755 "$srcdir"/garage-migrate-to-lmdb -t "$pkgdir"/usr/sbin/ install -d -m700 -o garage -g garage "$pkgdir"/var/lib/$pkgname } _convertdb() { pkgdesc="Utility to convert Garage metadata directory from one format to another" amove usr/bin/garage-convert-db } sha512sums=" b2279fb55d4c694d4dff155c123c3c3e7fda8d04676a10ef9b572b199c873bdb79397fb686c3236f90be92f2bc1aef36f845ec40b38def9593f86d0fac687c21 garage-0.8.2.tar.gz d5ab54a95e1376988e72dc7c9c2565a381de5ae771de72e8f60e3b331f8e8ab951a2778199215b55b90f93e00634addbf19c843882def51b0a0e07ac5d7e6779 fix-website-test-k2v.patch e59399ab8a16b591498be0d6510054adf14ff5c4ec15ddfdf69b046119fa036c8abef10173aa29f832ff64d1b0c46b51d17051a450d85b61bd99eb91b8c64ed5 syslog-support.patch 21892e8b574d36d62f7e720b4cb2a2013765e60e392a40c4d52ebf04541c77fde6d70dce2d5f2014fb1487a64813b9409d9553262f897fbdb602ca05e196d21d garage.toml 86676ad0c1059b3e431261542ea3ed56f12b7957e082685b0dbd80cbc3cc6bbf810c540fe4726b3809010f41c0976b65434fb5990c26f092feb900e86aec251c garage-migrate-to-lmdb a2130fa81ed2c8af266ed1e86d0c72e3aae6995599347e4488c6cd4cc83217fbb65ea9121415985f8cdcd15aaee9b28886b1ccf24755571b3ddf2fc5d8dd5b3a garage.initd f31bb5bde3ff41dc5fa6832c8ff24e1f1027b34513ab5e5c008df13495b53a569d3cb5adefed93cf780f5e488ff760603097785d85e1a884538e802e415205bd garage.confd "