summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dfca99c2a69676d4a96e6be3a545e5c1715474b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Nanaka Hiira <hiira plus archlinux at hiira dot dev>

pkgname='concrnt-shared-config'
pkgdesc='Concrnt shared config file'
pkgver=1.6.0
_pkgver=v${pkgver}
pkgrel=3
arch=('any')
url="https://github.com/totegamma/concurrent"
license=('MIT')

source=("concrnt-${_pkgver}::https://github.com/totegamma/concurrent/archive/refs/tags/${_pkgver}.tar.gz"
        "concrnt.sysusers"
	    "concrnt-shared-config.tmpfiles"
	    # v1.6.0 release tarball does not yet contain LICENSE file
	    "https://raw.githubusercontent.com/totegamma/concurrent/refs/heads/develop/LICENSE")

sha512sums=('742982dc1344449bdaf560cf6f6ea724b3d2d52dbd5031876398961f79e02718c9d4b875557f204349e39b7dca83a8716a32415b812eb68dabef70926e743d95'
            '20f767da477adcebbf3d09af431c5c1d8bbfe0395e8c5c921f1fe2fa012a314f3a0033af0251371e2831b59bb774cfcfe31834d365d4a202019068b377580c5d'
            '1a45f0d730d7f17c1d0bf254a7f59df1648cc69c7f3ab80b5fc74d255f45cdf946677aea0ca61394a0b086e416ee31b5509dc2e156e333c685c284ffc9ea985a'
            '6991f0cdffef328c29368d987a46e2d12d765b743cad04ae4c89469e1644f11f079fb495e5297b79d521f88b40d6fb3c5b972279c95f394bdb07cf4a2037f412')

backup=('etc/concrnt/config/config.yaml'
        'etc/concrnt/static/code-of-conduct.txt'
        'etc/concrnt/static/register-template.json'
        'etc/concrnt/static/tos.txt')

package() {
  install -Dm644 "${srcdir}/concrnt.sysusers" "${pkgdir}/usr/lib/sysusers.d/concrnt.conf"
  install -Dm644 "${srcdir}/concrnt-shared-config.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/concrnt-shared-config.conf"
  install -Dm644 "${srcdir}/concurrent-${pkgver}/_docs/etc/config/config.yaml" "${pkgdir}/etc/concrnt/config/config.yaml"
  install -Dm644 "${srcdir}/concurrent-${pkgver}/_docs/etc/static/code-of-conduct.txt" "${pkgdir}/etc/concrnt/static/code-of-conduct.txt"
  install -Dm644 "${srcdir}/concurrent-${pkgver}/_docs/etc/static/register-template.json" "${pkgdir}/etc/concrnt/static/register-template.json"
  install -Dm644 "${srcdir}/concurrent-${pkgver}/_docs/etc/static/tos.txt" "${pkgdir}/etc/concrnt/static/tos.txt"

  sed -i -E \
    -e "s/(memcached|redis):([0-9]+)/localhost:\2/g" \
    -e "s/([a-z]+):([0-9]+)/localhost:\2/g" \
    -e "s/host=db/host=localhost/" \
    -e "s/user=postgres/user=concrnt/" \
    -e "s/password=postgres/password=concrnt/" \
    -e "s/dbname=concurrent/dbname=concrnt/" \
    "${pkgdir}/etc/concrnt/config/config.yaml"

  install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}