# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DOTNET_PKG_COMPAT="8.0"
NUGETS="
	anglesharp.xml@1.0.0
	anglesharp@1.1.2
	autofac.extensions.dependencyinjection@9.0.0
	autofac@8.0.0
	bencodenet@4.0.0
	commandlineparser@2.9.1
	dotnet4.socksproxy@1.4.0.1
	flaresolverrsharp@3.0.7
	microsoft.aspnetcore.antiforgery@2.2.0
	microsoft.aspnetcore.authentication.abstractions@2.2.0
	microsoft.aspnetcore.authentication.cookies@2.2.0
	microsoft.aspnetcore.authentication.core@2.2.0
	microsoft.aspnetcore.authentication@2.2.0
	microsoft.aspnetcore.authorization.policy@2.2.0
	microsoft.aspnetcore.authorization@2.2.0
	microsoft.aspnetcore.connections.abstractions@2.2.0
	microsoft.aspnetcore.cors@2.2.0
	microsoft.aspnetcore.cryptography.internal@2.2.0
	microsoft.aspnetcore.dataprotection.abstractions@2.2.0
	microsoft.aspnetcore.dataprotection@2.2.0
	microsoft.aspnetcore.diagnostics.abstractions@2.2.0
	microsoft.aspnetcore.diagnostics@2.2.0
	microsoft.aspnetcore.hostfiltering@2.2.0
	microsoft.aspnetcore.hosting.abstractions@2.1.1
	microsoft.aspnetcore.hosting.abstractions@2.2.0
	microsoft.aspnetcore.hosting.server.abstractions@2.1.1
	microsoft.aspnetcore.hosting.server.abstractions@2.2.0
	microsoft.aspnetcore.hosting@2.2.0
	microsoft.aspnetcore.html.abstractions@2.2.0
	microsoft.aspnetcore.http.abstractions@2.1.1
	microsoft.aspnetcore.http.abstractions@2.2.0
	microsoft.aspnetcore.http.extensions@2.2.0
	microsoft.aspnetcore.http.features@2.1.1
	microsoft.aspnetcore.http.features@2.2.0
	microsoft.aspnetcore.http@2.1.22
	microsoft.aspnetcore.http@2.2.0
	microsoft.aspnetcore.http@2.2.2
	microsoft.aspnetcore.httpoverrides@2.2.0
	microsoft.aspnetcore.jsonpatch@2.2.0
	microsoft.aspnetcore.jsonpatch@8.0.11
	microsoft.aspnetcore.localization@2.2.0
	microsoft.aspnetcore.mvc.abstractions@2.2.0
	microsoft.aspnetcore.mvc.analyzers@2.2.0
	microsoft.aspnetcore.mvc.apiexplorer@2.2.0
	microsoft.aspnetcore.mvc.core@2.2.0
	microsoft.aspnetcore.mvc.cors@2.2.0
	microsoft.aspnetcore.mvc.dataannotations@2.2.0
	microsoft.aspnetcore.mvc.formatters.json@2.2.0
	microsoft.aspnetcore.mvc.localization@2.2.0
	microsoft.aspnetcore.mvc.newtonsoftjson@8.0.11
	microsoft.aspnetcore.mvc.razor.extensions@2.2.0
	microsoft.aspnetcore.mvc.razor@2.2.0
	microsoft.aspnetcore.mvc.razorpages@2.2.0
	microsoft.aspnetcore.mvc.taghelpers@2.2.0
	microsoft.aspnetcore.mvc.viewfeatures@2.2.0
	microsoft.aspnetcore.mvc@2.2.0
	microsoft.aspnetcore.razor.design@2.2.0
	microsoft.aspnetcore.razor.language@2.2.0
	microsoft.aspnetcore.razor.runtime@2.2.0
	microsoft.aspnetcore.razor@2.2.0
	microsoft.aspnetcore.responsecaching.abstractions@2.2.0
	microsoft.aspnetcore.responsecompression@2.2.0
	microsoft.aspnetcore.rewrite@2.2.0
	microsoft.aspnetcore.routing.abstractions@2.1.1
	microsoft.aspnetcore.routing.abstractions@2.2.0
	microsoft.aspnetcore.routing@2.2.0
	microsoft.aspnetcore.server.iis@2.2.0
	microsoft.aspnetcore.server.iisintegration@2.2.0
	microsoft.aspnetcore.server.kestrel.core@2.2.0
	microsoft.aspnetcore.server.kestrel.https@2.2.0
	microsoft.aspnetcore.server.kestrel.transport.abstractions@2.2.0
	microsoft.aspnetcore.server.kestrel.transport.sockets@2.2.0
	microsoft.aspnetcore.server.kestrel@2.2.0
	microsoft.aspnetcore.staticfiles@2.2.0
	microsoft.aspnetcore.webutilities@2.1.1
	microsoft.aspnetcore.webutilities@2.2.0
	microsoft.aspnetcore@2.2.0
	microsoft.bcl.asyncinterfaces@6.0.0
	microsoft.bcl.asyncinterfaces@7.0.0
	microsoft.bcl.asyncinterfaces@8.0.0
	microsoft.bcl.timeprovider@8.0.0
	microsoft.codeanalysis.analyzers@1.1.0
	microsoft.codeanalysis.common@2.8.0
	microsoft.codeanalysis.csharp@2.8.0
	microsoft.codeanalysis.razor@2.2.0
	microsoft.csharp@4.5.0
	microsoft.csharp@4.7.0
	microsoft.diasymreader.native@1.7.0
	microsoft.dotnet.platformabstractions@2.1.0
	microsoft.extensions.caching.abstractions@2.2.0
	microsoft.extensions.caching.memory@2.2.0
	microsoft.extensions.configuration.abstractions@2.1.0
	microsoft.extensions.configuration.abstractions@2.1.1
	microsoft.extensions.configuration.abstractions@2.2.0
	microsoft.extensions.configuration.abstractions@8.0.0
	microsoft.extensions.configuration.binder@2.1.0
	microsoft.extensions.configuration.binder@2.2.0
	microsoft.extensions.configuration.commandline@2.2.0
	microsoft.extensions.configuration.environmentvariables@2.2.0
	microsoft.extensions.configuration.fileextensions@2.2.0
	microsoft.extensions.configuration.json@2.2.0
	microsoft.extensions.configuration.usersecrets@2.2.0
	microsoft.extensions.configuration@2.1.0
	microsoft.extensions.configuration@2.2.0
	microsoft.extensions.configuration@8.0.0
	microsoft.extensions.dependencyinjection.abstractions@2.1.0
	microsoft.extensions.dependencyinjection.abstractions@2.1.1
	microsoft.extensions.dependencyinjection.abstractions@2.2.0
	microsoft.extensions.dependencyinjection.abstractions@8.0.0
	microsoft.extensions.dependencyinjection@2.2.0
	microsoft.extensions.dependencyinjection@8.0.0
	microsoft.extensions.dependencymodel@2.1.0
	microsoft.extensions.fileproviders.abstractions@2.1.1
	microsoft.extensions.fileproviders.abstractions@2.2.0
	microsoft.extensions.fileproviders.composite@2.2.0
	microsoft.extensions.fileproviders.physical@2.2.0
	microsoft.extensions.filesystemglobbing@2.2.0
	microsoft.extensions.hosting.abstractions@2.1.1
	microsoft.extensions.hosting.abstractions@2.2.0
	microsoft.extensions.localization.abstractions@2.2.0
	microsoft.extensions.localization@2.2.0
	microsoft.extensions.logging.abstractions@2.1.0
	microsoft.extensions.logging.abstractions@2.1.1
	microsoft.extensions.logging.abstractions@2.2.0
	microsoft.extensions.logging.abstractions@8.0.0
	microsoft.extensions.logging.configuration@2.2.0
	microsoft.extensions.logging.console@2.2.0
	microsoft.extensions.logging.debug@2.2.0
	microsoft.extensions.logging.eventsource@2.2.0
	microsoft.extensions.logging@2.1.0
	microsoft.extensions.logging@2.2.0
	microsoft.extensions.logging@8.0.0
	microsoft.extensions.objectpool@2.1.1
	microsoft.extensions.objectpool@2.2.0
	microsoft.extensions.options.configurationextensions@2.2.0
	microsoft.extensions.options@2.1.0
	microsoft.extensions.options@2.1.1
	microsoft.extensions.options@2.2.0
	microsoft.extensions.options@8.0.0
	microsoft.extensions.primitives@2.1.0
	microsoft.extensions.primitives@2.1.1
	microsoft.extensions.primitives@2.2.0
	microsoft.extensions.primitives@8.0.0
	microsoft.extensions.webencoders@2.2.0
	microsoft.net.http.headers@2.1.1
	microsoft.net.http.headers@2.2.0
	microsoft.netcore.platforms@1.1.0
	microsoft.netcore.platforms@5.0.0
	microsoft.netframework.referenceassemblies.net462@1.0.3
	microsoft.netframework.referenceassemblies@1.0.3
	microsoft.win32.registry@4.5.0
	mimemapping@1.0.1.50
	mono.posix@7.1.0-final.1.21458.1
	mono.unix@7.1.0-final.1.21458.1
	netstandard.library@2.0.3
	newtonsoft.json.bson@1.0.1
	newtonsoft.json.bson@1.0.2
	newtonsoft.json@10.0.1
	newtonsoft.json@11.0.2
	newtonsoft.json@13.0.3
	newtonsoft.json@9.0.1
	nlog.extensions.logging@5.3.15
	nlog.web.aspnetcore@5.3.15
	nlog@5.3.4
	polly.core@8.5.0
	polly@8.5.0
	sharpziplib@1.4.2
	system.appcontext@4.3.0
	system.buffers@4.4.0
	system.buffers@4.5.0
	system.buffers@4.5.1
	system.collections.concurrent@4.3.0
	system.collections.immutable@1.3.1
	system.collections.immutable@1.5.0
	system.collections@4.3.0
	system.componentmodel.annotations@4.5.0
	system.console@4.3.0
	system.diagnostics.debug@4.3.0
	system.diagnostics.diagnosticsource@4.5.0
	system.diagnostics.diagnosticsource@7.0.2
	system.diagnostics.eventlog@8.0.1
	system.diagnostics.fileversioninfo@4.3.0
	system.diagnostics.stacktrace@4.3.0
	system.diagnostics.tools@4.3.0
	system.dynamic.runtime@4.3.0
	system.globalization@4.3.0
	system.io.compression@4.3.0
	system.io.filesystem.accesscontrol@5.0.0
	system.io.filesystem.primitives@4.3.0
	system.io.filesystem@4.3.0
	system.io.pipelines@4.5.2
	system.io.pipelines@4.6.0
	system.io.pipelines@5.0.1
	system.linq.expressions@4.3.0
	system.linq@4.3.0
	system.memory@4.5.0
	system.memory@4.5.1
	system.memory@4.5.3
	system.memory@4.5.4
	system.memory@4.5.5
	system.numerics.vectors@4.4.0
	system.numerics.vectors@4.5.0
	system.reflection.metadata@1.4.2
	system.reflection.metadata@1.6.0
	system.reflection@4.3.0
	system.resources.resourcemanager@4.3.0
	system.runtime.compilerservices.unsafe@4.5.0
	system.runtime.compilerservices.unsafe@4.5.1
	system.runtime.compilerservices.unsafe@4.5.2
	system.runtime.compilerservices.unsafe@4.5.3
	system.runtime.compilerservices.unsafe@6.0.0
	system.runtime.extensions@4.3.0
	system.runtime.interopservices.runtimeinformation@4.0.0
	system.runtime.interopservices.runtimeinformation@4.3.0
	system.runtime.interopservices@4.3.0
	system.runtime.numerics@4.3.0
	system.runtime@4.3.0
	system.security.accesscontrol@4.5.0
	system.security.accesscontrol@5.0.0
	system.security.cryptography.algorithms@4.3.0
	system.security.cryptography.cng@4.5.0
	system.security.cryptography.encoding@4.3.0
	system.security.cryptography.primitives@4.3.0
	system.security.cryptography.protecteddata@8.0.0
	system.security.cryptography.x509certificates@4.3.0
	system.security.cryptography.xml@4.5.0
	system.security.permissions@4.5.0
	system.security.principal.windows@4.5.0
	system.security.principal.windows@5.0.0
	system.serviceprocess.servicecontroller@8.0.1
	system.text.encoding.codepages@8.0.0
	system.text.encoding.extensions@4.3.0
	system.text.encoding@4.3.0
	system.text.encodings.web@4.5.0
	system.text.encodings.web@4.5.1
	system.text.encodings.web@8.0.0
	system.text.json@8.0.5
	system.threading.tasks.extensions@4.5.1
	system.threading.tasks.extensions@4.5.2
	system.threading.tasks.extensions@4.5.4
	system.threading.tasks.parallel@4.3.0
	system.threading.tasks@4.3.0
	system.threading.thread@4.3.0
	system.threading@4.3.0
	system.valuetuple@4.3.0
	system.valuetuple@4.5.0
	system.xml.readerwriter@4.3.0
	system.xml.xdocument@4.3.0
	system.xml.xmldocument@4.3.0
	system.xml.xpath.xdocument@4.3.0
	system.xml.xpath@4.3.0
	yamldotnet@13.0.1
"

inherit dotnet-pkg systemd

DESCRIPTION="API Support for your favorite torrent trackers"
HOMEPAGE="https://github.com/Jackett/Jackett"
SRC_URI="
	https://github.com/Jackett/Jackett/archive/v${PV}.tar.gz -> jackett-${PV}.tar.gz
	${NUGET_URIS}
"
S="${WORKDIR}/Jackett-${PV}/src"

DOTNET_PKG_PROJECTS=( Jackett.Server )
DOTNET_PKG_BAD_PROJECTS=( Jackett.Tray Jackett.Test Jackett.IntegrationTests )
DOTNET_PKG_BUILD_EXTRA_ARGS=( "-p:Version=${PV}" )

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND+="
	acct-user/jackett
	acct-group/jackett
	!www-apps/jackett-bin
"

src_install() {
	systemd_dounit "${FILESDIR}/jackett.service"
	dotnet-pkg_src_install
}