diff --git a/PKGBUILD b/PKGBUILD index 4f1afe5..579840b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,34 +1,46 @@ -# This is an example PKGBUILD file. Use this as a start to creating your own, -# and remove these comments. For more information, see 'man PKGBUILD'. -# NOTE: Please fill out the license field for your package! If it is unknown, -# then please put 'unknown'. - # Maintainer: Tobias Reisinger -pkgname=emgauwa-core +pkgname=emgauwa-core-testing pkgver=0.0.1 pkgrel=1 epoch= -pkgdesc='' +pkgdesc="" arch=('any') -url='https://git.serguzim.me/emgauwa/core' +url="https://git.serguzim.me/emgauwa/core" license=('unknown') groups=() depends=('glibc' 'sqlite') makedepends=('make' 'cmake' 'gcc') +conflicts=('emgauwa-core') backup=('etc/emgauwa/core.ini') -source=("https://ci.serguzim.me/archive/emgauwa-core/latest/testing.tar.gz") -sha256sums=('SKIP') +source=("https://ci.serguzim.me/archive/emgauwa-core/latest/$pkgname.tar.gz" + "core.ini" + "emgauwa-core-testing.service" + "emgauwa-core-testing.sysusers" + "emgauwa-core-testing.tmpfiles") +sha256sums=("SKIP" + "e6089a8730c1a24b8c3c78082e9ffa96551cfc712eb1a8da7c544b8899eee14d" + "c781f4d50da8e158551a47a8549981dad05faaf2d632c4fde8b36b48474ab0ec" + "b9cde58b9e9b0605ca4a1eddd78067c55aa3c8d40f80cde0a25c4da9f6f95798" + "0531f10303410afd7e53099e66b124ef2fd14afec9d33c4a0146793375acb6c2") prepare() { - mkdir -p "build" + cd "$pkgname" + mkdir -p "build" } build() { - cd "build" || exit 1 - cmake .. - make + cd "$pkgname/build" || exit 1 + cmake .. + make } package() { - echo "package" + install -Dm755 "${pkgname}/build/core" "${pkgdir}/usr/bin/emgauwa-core" + + install -Dm644 "core.ini" "${pkgdir}/etc/emgauwa/core.ini" + install -Dm644 "${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" + install -Dm644 "${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf" + install -Dm644 "${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf" + + install -Ddm644 "${pkgdir}/var/lib/emgauwa/core" } diff --git a/core.ini b/core.ini new file mode 100644 index 0000000..2bbcd4c --- /dev/null +++ b/core.ini @@ -0,0 +1,11 @@ +[core] +server-port = 80 +database = /var/lib/emgauwa/db.sqlite +not-found-file = 404.html +not-found-file-mime = text/html +not-found-content = 404 - NOT FOUND +not-found-content-type = text/plain + +: 4421 for dev-env; 4420 for testing-env; 4419 for prod-env; 4422 for testing +discovery-port = 4420 +log-level = debug diff --git a/emgauwa-core-testing.service b/emgauwa-core-testing.service new file mode 100644 index 0000000..3e446ee --- /dev/null +++ b/emgauwa-core-testing.service @@ -0,0 +1,12 @@ +[Unit] +Description=Emgauwa Core [Testing] Launcher +After=network.target + +[Service] +Type=simple +WorkingDirectory=/var/lib/emgauwa/core/ +ExecStart=emgauwa-core start -c /etc/emgauwa/core.ini +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/emgauwa-core-testing.sysusers b/emgauwa-core-testing.sysusers new file mode 100644 index 0000000..589d147 --- /dev/null +++ b/emgauwa-core-testing.sysusers @@ -0,0 +1 @@ +u emgauwa - "Emgauwa daemon user" /var/lib/emgauwa /bin/bash diff --git a/emgauwa-core-testing.tmpfiles b/emgauwa-core-testing.tmpfiles new file mode 100644 index 0000000..f1e5fb0 --- /dev/null +++ b/emgauwa-core-testing.tmpfiles @@ -0,0 +1,5 @@ +d /var/lib/emgauwa 0750 +d /var/lib/emgauwa/core 0750 +Z /var/lib/emgauwa - emgauwa emgauwa +z /etc/emgauwa 0755 root emgauwa +z /etc/emgauwa/core.ini 0660 root emgauwa