# Maintainer: MetroWind
pkgname=card-collection-git
pkgver=r1.g0000000
pkgrel=1
pkgdesc='Server for card collection games'
arch=('x86_64')
url='https://git.xeno.darksair.org/card-collection.git'
license=('WTFPL')
depends=('curl' 'gcc-libs' 'glibc' 'openssl' 'sqlite' 'imagemagick')
makedepends=('cmake' 'git')
provides=('card-collection')
conflicts=('card-collection')
backup=('etc/card-collection.toml')
source=(
'card-collection::git+https://git.xeno.darksair.org/card-collection.git'
'card-collection.service'
'card-collection.sysusers'
'card-collection.tmpfiles'
'config.toml'
)
sha256sums=(
'SKIP'
'8700310846e1d023e4b2dc4f9c95cb3457687de6c5783e80e02414161475a6d6'
'b6af9d7d42667160a0cbc477c3ceee0c3de1fa5a9284bb7dd3f28601c363db77'
'c55d9a3954e2d2697b992eba298a74432337482d4a728ae8bf96075b53ac71a1'
'25836bedfb562e2030fe814ebe79604d47110fa9fb6cbd1512e976526fe2f0ce'
)
pkgver()
{
cd "$srcdir/card-collection"
printf 'r%s.g%s' \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short=7 HEAD)"
}
build()
{
cd "$srcdir"
cmake -S card-collection -B build \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCARD-COLLECTION_BUILD_TESTS=OFF \
-Wno-dev
cmake --build build
}
package()
{
cd "$srcdir"
install -Dm755 build/card_collection "$pkgdir/usr/bin/card_collection"
install -d "$pkgdir/var/lib/card-collection"
cp -a card-collection/templates "$pkgdir/var/lib/card-collection/"
cp -a card-collection/static "$pkgdir/var/lib/card-collection/"
install -Dm644 config.toml "$pkgdir/etc/card-collection.toml"
install -Dm644 card-collection.service \
"$pkgdir/usr/lib/systemd/system/card-collection.service"
install -Dm644 card-collection.sysusers \
"$pkgdir/usr/lib/sysusers.d/card-collection.conf"
install -Dm644 card-collection.tmpfiles \
"$pkgdir/usr/lib/tmpfiles.d/card-collection.conf"
}