# Contributor: Fabricio Silva <hi@fabricio.dev>
maintainer="Fabricio Silva <hi@fabricio.dev>"
pkgname=recyclarr
pkgver=7.4.1
pkgrel=0
pkgdesc="Automatically sync TRaSH guides to your Sonarr and Radarr instances"
url="https://github.com/recyclarr/recyclarr"
arch="x86_64 aarch64 armv7" # limited by dotnet
license="MIT"
options="net !check !strip" # net for nuget | strip breaks the package
subpackages="$pkgname-doc"
depends="dotnet9-runtime git"
makedepends="dotnet9-sdk"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/recyclarr/recyclarr/archive/refs/tags/v$pkgver.tar.gz
	0001-disable-gitversion.patch
	"
provides="recyclarr-cli=$pkgver-r$pkgrel" # backwards compatibility
replaces="recyclarr-cli"

build() {
	dotnet publish src/Recyclarr.Cli \
		-p:Version="$pkgver-r$pkgrel.alpine" \
		-p:IncludeSourceRevisionInInformationalVersion=false \
		-p:DisableGitVersionTask=true \
		-p:PublishSingleFile=true \
		--no-self-contained \
		--use-current-runtime \
		--configuration Release \
		--output publish
}

package() {
	install -Dm755 publish/recyclarr -t "$pkgdir"/usr/bin
	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
667823ee6c0a13ff4c22d49f0fe597445f2e2944177fcd8aa5a04812f7537ec92e32c55a5465b642ba1f99988b1b05d29897f42ff31575979d63e9768b5d40f2  recyclarr-7.4.1.tar.gz
3726dec80790b38b333816e2ab9b3563b50b5bacc91ac416ca5605a068759ef4e33a203bfe9f677fb3f7d81fe33288331b1808be00561e4bc457aed7c0be3c1c  0001-disable-gitversion.patch
"
