aports/testing/ombi/APKBUILD
2025-03-28 22:43:07 +00:00

89 lines
2.6 KiB
Text

# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=ombi
pkgver=4.47.1
pkgrel=0
pkgdesc="Friendly media request tool which automatically syncs with your media servers!"
url="https://ombi.io"
arch="x86_64 aarch64 armv7" # limited by dotnet8-sdk
license="GPL-2.0-only"
depends="aspnetcore8-runtime sqlite-libs"
makedepends="dotnet8-sdk yarn"
subpackages="$pkgname-openrc"
install="$pkgname.pre-install"
source="
$pkgname-$pkgver.tar.gz::https://github.com/Ombi-app/Ombi/archive/refs/tags/v$pkgver.tar.gz
ombi.initd
ombi.confd
"
builddir="$srcdir/Ombi-$pkgver"
pkgusers="ombi"
pkggroups="ombi"
options="net" # dotnet and yarn dependencies
export DOTNET_CLI_HOME="$builddir"/dotnetclihome
case $CARCH in
x86_64) _dotnet_arch="x64";;
aarch64) _dotnet_arch="arm64";;
armv7) _dotnet_arch="arm";;
*) _dotnet_arch="$CARCH";;
esac
_backend="$builddir/src/Ombi"
_frontend="$_backend/ClientApp"
_artifacts="$_backend/bin/Release/net8.0"
_runtime="linux-musl-$_dotnet_arch"
build() {
# set backend version
dotnet new tool-manifest
dotnet tool install --local dotnet-setversion
dotnet setversion -r "$pkgver"
# build the backend
dotnet publish "$_backend" \
-c Release \
-r "$_runtime" \
--no-self-contained
# move binaries out of runtime directory
mv "$_artifacts/$_runtime"/publish/* "$_artifacts" -f
rm -r "${_artifacts:?}/${_runtime:?}"
# remove dev config
rm "$_artifacts"/appsettings.Development.json
# build frontend
yarn --cwd "$_frontend" install --network-timeout 120000 --frozen-lockfile
yarn --cwd "$_frontend" build
# move frontend to atrifacts directory
mkdir -p "$_artifacts"/ClientApp
mv "$_frontend"/dist "$_artifacts"/ClientApp
}
check() {
make backend-tests
}
package() {
# setup runtime config file
mkdir -p "$pkgdir"/var/lib/ombi
chown -R "$pkgusers:$pkggroups" "$pkgdir"/var/lib/ombi
local DESTDIR="$pkgdir"/usr/lib/ombi
mkdir -p "$DESTDIR"
cp -af "$_artifacts"/* "$DESTDIR"
chown -R "$pkgusers:$pkggroups" "$DESTDIR"
install -Dm755 "$srcdir"/ombi.initd "$pkgdir"/etc/init.d/ombi
install -Dm644 "$srcdir"/ombi.confd "$pkgdir"/etc/conf.d/ombi
}
sha512sums="
9defc5dc23b3c9117dd86134603b2cd9ad09d94b87b38b0af539f31cb7b668ca128a231eaab03f9edee77dc6712ae32cca5725c7b1fd41f07e6dbba78f42a5dd ombi-4.47.1.tar.gz
a48fac800aa0779c793aa1220cce16ccc55dc064487e11daf17b165fbc565e4c62e7a52e1372395508b199a12d6bf773157125f3cbaa845381cc035547b29afa ombi.initd
7355ae0ffedc179688dc6e4c472bd8963b2cbb851bf00a103febe3138630c1cc8c7af37dc7d2e61bff7dc47214517d5b02bc0e8744894f1ff7272df5f566b8c1 ombi.confd
"