2022-12-28 14:24:04 +00:00
|
|
|
# Maintainer: Oscar Krause <oscar.krause@collinwebdesigns.de>
|
2022-12-30 06:33:17 +00:00
|
|
|
# Contributor: samicrusader <hi@samicrusader.me>
|
2022-12-28 20:13:20 +00:00
|
|
|
|
2022-12-28 14:24:04 +00:00
|
|
|
pkgname=fastapi-dls
|
2022-12-30 06:33:17 +00:00
|
|
|
pkgver=1.1
|
2022-12-28 14:57:55 +00:00
|
|
|
pkgrel=1
|
2022-12-28 20:13:20 +00:00
|
|
|
pkgdesc='NVIDIA DLS server implementation with FastAPI'
|
|
|
|
arch=('any')
|
|
|
|
url='https://git.collinwebdesigns.de/oscar.krause/fastapi-dls'
|
|
|
|
license=('MIT')
|
|
|
|
depends=('python' 'python-jose' 'python-starlette' 'python-httpx' 'python-fastapi' 'python-dotenv' 'python-dateutil' 'python-sqlalchemy' 'python-pycryptodome' 'uvicorn' 'python-markdown' 'openssl')
|
|
|
|
provider=("$pkgname")
|
|
|
|
install="$pkgname.install"
|
2023-01-26 06:17:16 +00:00
|
|
|
backup=('etc/default/fastapi-dls')
|
2024-01-18 12:06:45 +00:00
|
|
|
source=('git+file:///tmp/builds/oscar.krause/fastapi-dls' # https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
|
2022-12-28 20:13:20 +00:00
|
|
|
"$pkgname.default"
|
2022-12-30 06:33:17 +00:00
|
|
|
"$pkgname.service"
|
|
|
|
"$pkgname.tmpfiles")
|
2022-12-28 20:13:20 +00:00
|
|
|
sha256sums=('SKIP'
|
2022-12-30 06:33:17 +00:00
|
|
|
'fbd015449a30c0ae82733289a56eb98151dcfab66c91b37fe8e202e39f7a5edb'
|
|
|
|
'2719338541104c537453a65261c012dda58e1dbee99154cf4f33b526ee6ca22e'
|
|
|
|
'3dc60140c08122a8ec0e7fa7f0937eb8c1288058890ba09478420fc30ce9e30c')
|
2022-12-28 14:57:55 +00:00
|
|
|
|
2022-12-29 11:12:26 +00:00
|
|
|
pkgver() {
|
2023-03-20 09:09:50 +00:00
|
|
|
echo -e "VERSION=$VERSION\nCOMMIT=$CI_COMMIT_SHA" > $srcdir/$pkgname/version.env
|
2022-12-29 11:12:26 +00:00
|
|
|
source $srcdir/$pkgname/version.env
|
2023-03-20 09:09:50 +00:00
|
|
|
echo $VERSION
|
2022-12-29 11:12:26 +00:00
|
|
|
}
|
|
|
|
|
2022-12-28 20:13:20 +00:00
|
|
|
check() {
|
|
|
|
cd "$srcdir/$pkgname/test"
|
|
|
|
mkdir "$srcdir/$pkgname/app/cert"
|
|
|
|
openssl genrsa -out "$srcdir/$pkgname/app/cert/instance.private.pem" 2048
|
|
|
|
openssl rsa -in "$srcdir/$pkgname/app/cert/instance.private.pem" -outform PEM -pubout -out "$srcdir/$pkgname/app/cert/instance.public.pem"
|
|
|
|
python "$srcdir/$pkgname/test/main.py"
|
|
|
|
rm -rf "$srcdir/$pkgname/app/cert"
|
2022-12-28 14:24:04 +00:00
|
|
|
}
|
2022-12-28 16:00:35 +00:00
|
|
|
|
2022-12-28 20:13:20 +00:00
|
|
|
package() {
|
|
|
|
install -d "$pkgdir/usr/share/doc/$pkgname"
|
|
|
|
install -d "$pkgdir/var/lib/$pkgname/cert"
|
|
|
|
cp -r "$srcdir/$pkgname/doc"/* "$pkgdir/usr/share/doc/$pkgname/"
|
|
|
|
install -Dm644 "$srcdir/$pkgname/README.md" "$pkgdir/usr/share/doc/$pkgname/README.md"
|
2022-12-29 08:15:33 +00:00
|
|
|
install -Dm644 "$srcdir/$pkgname/version.env" "$pkgdir/usr/share/doc/$pkgname/version.env"
|
2022-12-28 16:00:35 +00:00
|
|
|
|
2022-12-28 20:13:20 +00:00
|
|
|
sed -i "s/README.md/\/usr\/share\/doc\/$pkgname\/README.md/g" "$srcdir/$pkgname/app/main.py"
|
|
|
|
sed -i "s/join(dirname(__file__), 'cert\//join('\/var\/lib\/$pkgname', 'cert\//g" "$srcdir/$pkgname/app/main.py"
|
|
|
|
install -Dm755 "$srcdir/$pkgname/app/main.py" "$pkgdir/opt/$pkgname/main.py"
|
|
|
|
install -Dm755 "$srcdir/$pkgname/app/orm.py" "$pkgdir/opt/$pkgname/orm.py"
|
2022-12-29 07:48:34 +00:00
|
|
|
install -Dm755 "$srcdir/$pkgname/app/util.py" "$pkgdir/opt/$pkgname/util.py"
|
2022-12-28 20:13:20 +00:00
|
|
|
install -Dm644 "$srcdir/$pkgname.default" "$pkgdir/etc/default/$pkgname"
|
|
|
|
install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
|
2022-12-30 06:33:17 +00:00
|
|
|
install -Dm644 "$srcdir/$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
|
2022-12-28 20:13:20 +00:00
|
|
|
}
|