Use Makefile.external for syndicate-server

This commit is contained in:
Tony Garnock-Jones 2022-07-23 14:59:29 +02:00
parent d6840d75e2
commit a51b349137
14 changed files with 51 additions and 200 deletions

View File

@ -1 +1,7 @@
VERSION
buildlog.*
protocols/
syndicate-rs/
syndicate-server.aarch64
syndicate-server.armv7
syndicate-server.x86_64

View File

@ -1 +0,0 @@
APKBUILD.released

View File

@ -0,0 +1,27 @@
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=syndicate-server
pkgver=$(cat VERSION)
pkgrel=$(date '+%Y%m%d%H%M%S')
pkgdesc="Syndicate server"
url="https://syndicate-lang.org/"
arch="all"
license="GPLv3"
depends=""
makedepends=""
source=""
builddir="$srcdir/"
options="!check"
build() {
:
}
package() {
mkdir -p "$pkgdir/usr/bin"
cp -p "$startdir/syndicate-server.${CARCH}" "$pkgdir/usr/bin/syndicate-server"
mkdir -p "$pkgdir/usr/share/syndicate-server/schemas"
cp "$startdir/protocols/schema-bundle.bin" "$pkgdir/usr/share/syndicate-server/schemas/schema-bundle.prb"
cp "$startdir/protocols/schemas"/*.prs "$pkgdir/usr/share/syndicate-server/schemas/."
}

View File

@ -1,27 +0,0 @@
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=syndicate-server
pkgver=0.0.0
pkgrel=$(date '+%Y%m%d%H%M%S')
pkgdesc="Syndicate server"
url="https://syndicate-lang.org/"
arch="all"
license="GPLv3"
depends=""
makedepends=""
source=""
builddir="$srcdir/"
options="!check"
build() {
:
}
package() {
mkdir -p "$pkgdir/usr/bin"
cp -p ../syndicate-server.${CARCH} "$pkgdir/usr/bin/syndicate-server"
mkdir -p "$pkgdir/usr/share/syndicate-server/schemas"
cp ../protocols/schema-bundle.bin "$pkgdir/usr/share/syndicate-server/schemas/schema-bundle.prb"
cp ../protocols/schemas/*.prs "$pkgdir/usr/share/syndicate-server/schemas/."
}

View File

@ -1,30 +0,0 @@
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
pkgname=syndicate-server
pkgver=0.26.0
pkgrel=0
pkgdesc="Syndicate server"
url="https://syndicate-lang.org/"
arch="all"
license="GPLv3"
depends=""
makedepends="openssl-dev"
source="$pkgname-$pkgver.tar.gz::https://git.syndicate-lang.org/syndicate-lang/syndicate-rs/archive/syndicate-server-v$pkgver.tar.gz"
builddir="$srcdir/syndicate-rs/syndicate-server"
options="!check"
build() {
cargo build --release
}
package() {
install -Dm755 "../target/release/syndicate-server" "$pkgdir/usr/bin/syndicate-server"
mkdir -p "$pkgdir/usr/share/syndicate-server/schemas"
cp protocols/schema-bundle.bin "$pkgdir/usr/share/syndicate-server/schemas/schema-bundle.prb"
cp protocols/schemas/*.prs "$pkgdir/usr/share/syndicate-server/schemas/."
}
sha512sums="
dcbaf2d964f3d32341b500cd4fb63a04b7990c4409b7c5be79d5510bcc15878cb4e34cfc2b279272e10db328f0187ac81aa3e1a752e1bf88d58d8aaf00862f17 syndicate-server-0.26.0.tar.gz
"

View File

@ -0,0 +1,14 @@
# -*- makefile -*-
prepare: syndicate-rs
rm -f syndicate-server.$(ARCH)
$(MAKE) -C syndicate-rs $(ARCH)-binary-release
cp -p syndicate-rs/target/$(ARCH)-*/release/syndicate-server syndicate-server.$(ARCH)
(cd syndicate-rs/syndicate-server && cargo metadata --format-version 1) \
| preserves-tool convert --output-format unquoted \
--select '. "packages" / [. "name" = "syndicate-server"] . "version"' \
> VERSION
rsync -a syndicate-rs/syndicate-server/protocols .
syndicate-rs:
git clone https://git.syndicate-lang.org/syndicate-lang/syndicate-rs

View File

@ -1,8 +0,0 @@
all: schema-bundle.bin
clean:
rm -f schema-bundle.bin
schema-bundle.bin: schemas/*.prs
preserves-schemac schemas > $@.tmp
mv $@.tmp $@

View File

@ -1,10 +0,0 @@
´³bundle·µ³ documentation„´³schema·³version³ definitions·³Url´³orµµ±present´³dict·³url´³named³url´³atom³String„„„„„µ±invalid´³dict·³url´³named³url³any„„„„µ±absent´³dict·„„„„„³IOList´³orµµ±bytes´³atom³
ByteString„„µ±string´³atom³String„„µ±nested´³seqof´³refµ„³IOList„„„„„³Metadata´³rec´³lit³metadata„´³tupleµ´³named³object³any„´³named³info´³dictof´³atom³Symbol„³any„„„„„³ Description´³orµµ±present´³dict·³ description´³named³ description´³refµ„³IOList„„„„„µ±invalid´³dict·³ description´³named³ description³any„„„„µ±absent´³dict·„„„„„„³ embeddedType€„„µ³externalServices„´³schema·³version³ definitions·³Process´³orµµ±simple´³refµ„³ CommandLine„„µ±full´³refµ„³ FullProcess„„„„³Service´³refµ„³ DaemonService„³ClearEnv´³orµµ±present´³dict·³clearEnv´³named³clearEnv´³atom³Boolean„„„„„µ±invalid´³dict·³clearEnv´³named³clearEnv³any„„„„µ±absent´³dict·„„„„„³EnvValue´³orµµ±set´³atom³String„„µ±remove´³lit€„„µ±invalid³any„„„³Protocol´³orµµ±none´³lit³none„„µ±binarySyndicate´³lit³application/syndicate„„µ± textSyndicate´³lit³text/syndicate„„„„³
ProcessDir´³orµµ±present´³dict·³dir´³named³dir´³atom³String„„„„„µ±invalid´³dict·³dir´³named³dir³any„„„„µ±absent´³dict·„„„„„³
ProcessEnv´³orµµ±present´³dict·³env´³named³env´³dictof´³refµ„³ EnvVariable„´³refµ„³EnvValue„„„„„„µ±invalid´³dict·³env´³named³env³any„„„„µ±absent´³dict·„„„„„³ CommandLine´³orµµ±shell´³atom³String„„µ±full´³refµ„³FullCommandLine„„„„³ EnvVariable´³orµµ±string´³atom³String„„µ±symbol´³atom³Symbol„„µ±invalid³any„„„³ FullProcess´³andµ´³dict·³argv´³named³argv´³refµ„³ CommandLine„„„„´³named³env´³refµ„³
ProcessEnv„„´³named³dir´³refµ„³
ProcessDir„„´³named³clearEnv´³refµ„³ClearEnv„„„„³ ReadyOnStart´³orµµ±present´³dict·³ readyOnStart´³named³ readyOnStart´³atom³Boolean„„„„„µ±invalid´³dict·³ readyOnStart´³named³ readyOnStart³any„„„„µ±absent´³dict·„„„„„³ RestartField´³orµµ±present´³dict·³restart´³named³restart´³refµ„³ RestartPolicy„„„„„µ±invalid´³dict·³restart´³named³restart³any„„„„µ±absent´³dict·„„„„„³ DaemonProcess´³rec´³lit³daemon„´³tupleµ´³named³id³any„´³named³config´³refµ„³DaemonProcessSpec„„„„„³ DaemonService´³rec´³lit³daemon„´³tupleµ´³named³id³any„„„„³ ProtocolField´³orµµ±present´³dict·³protocol´³named³protocol´³refµ„³Protocol„„„„„µ±invalid´³dict·³protocol´³named³protocol³any„„„„µ±absent´³dict·„„„„„³ RestartPolicy´³orµµ±always´³lit³always„„µ±onError´³lit³on-error„„µ±all´³lit³all„„µ±never´³lit³never„„„„³FullCommandLine´³ tuplePrefixµ´³named³program´³atom³String„„„´³named³args´³seqof´³atom³String„„„„³DaemonProcessSpec´³orµµ±simple´³refµ„³ CommandLine„„µ±oneShot´³rec´³lit³one-shot„´³tupleµ´³named³setup´³refµ„³ CommandLine„„„„„„µ±full´³refµ„³FullDaemonProcess„„„„³FullDaemonProcess´³andµ´³named³process´³refµ„³ FullProcess„„´³named³ readyOnStart´³refµ„³ ReadyOnStart„„´³named³restart´³refµ„³ RestartField„„´³named³protocol´³refµ„³ ProtocolField„„„„„³ embeddedType´³refµ³ EntityRef„³Cap„„„µ³internalServices„´³schema·³version³ definitions·³ ConfigEnv´³dictof´³atom³Symbol„³any„³ DebtReporter´³rec´³lit³ debt-reporter„´³tupleµ´³named³intervalSeconds´³atom³Double„„„„„³ ConfigWatcher´³rec´³lit³config-watcher„´³tupleµ´³named³path´³atom³String„„´³named³env´³refµ„³ ConfigEnv„„„„„³TcpRelayListener´³rec´³lit³relay-listener„´³tupleµ´³named³addr´³refµ³TransportAddress„³Tcp„„´³named³
gatekeeper´³embedded´³refµ³
gatekeeper„³Resolve„„„„„„³UnixRelayListener´³rec´³lit³relay-listener„´³tupleµ´³named³addr´³refµ³TransportAddress„³Unix„„´³named³
gatekeeper´³embedded´³refµ³
gatekeeper„³Resolve„„„„„„„³ embeddedType´³refµ³ EntityRef„³Cap„„„„„

View File

@ -1,11 +0,0 @@
version 1 .
; Assertion. Describes `object`.
Metadata = <metadata @object any @info { symbol: any ...:... }> .
; Projections of the `info` in a `Metadata` record.
Description = @present { description: IOList } / @invalid { description: any } / @absent {} .
Url = @present { url: string } / @invalid { url: any } / @absent {} .
; Data type. From preserves' `conventions.md`.
IOList = @bytes bytes / @string string / @nested [IOList ...] .

View File

@ -1,55 +0,0 @@
version 1 .
embeddedType EntityRef.Cap .
Service = DaemonService .
DaemonService = <daemon @id any> .
DaemonProcess = <daemon @id any @config DaemonProcessSpec>.
DaemonProcessSpec = @simple CommandLine / @oneShot <one-shot @setup CommandLine> / @full FullDaemonProcess .
FullDaemonProcess = @process FullProcess & @readyOnStart ReadyOnStart & @restart RestartField & @protocol ProtocolField .
ReadyOnStart = @present { readyOnStart: bool } / @invalid { readyOnStart: any } / @absent {} .
RestartField = @present { restart: RestartPolicy } / @invalid { restart: any } / @absent {} .
ProtocolField = @present { protocol: Protocol } / @invalid { protocol: any } / @absent {} .
Process = @simple CommandLine / @full FullProcess .
FullProcess =
& { argv: CommandLine }
& @env ProcessEnv
& @dir ProcessDir
& @clearEnv ClearEnv
.
ProcessEnv = @present { env: { EnvVariable: EnvValue ...:... } } / @invalid { env: any } / @absent {} .
ProcessDir = @present { dir: string } / @invalid { dir: any } / @absent {} .
ClearEnv = @present { clearEnv: bool } / @invalid { clearEnv: any } / @absent {} .
CommandLine = @shell string / @full FullCommandLine .
FullCommandLine = [@program string, @args string ...] .
EnvVariable = @string string / @symbol symbol / @invalid any .
EnvValue = @set string / @remove #f / @invalid any .
RestartPolicy =
/ ; Whether the process terminates normally or abnormally, restart it
; without affecting any peer processes within the service.
=always
/ ; If the process terminates normally, leave everything alone; if it
; terminates abnormally, restart it without affecting peers.
@onError =on-error
/ ; If the process terminates normally, leave everything alone; if it
; terminates abnormally, restart the whole daemon (all processes
; within the daemon).
=all
/ ; Treat both normal and abnormal termination as normal termination; that is, never restart,
; and enter state "complete" even if the process fails.
=never
.
Protocol =
/ ; stdin is /dev/null, output and error are logged
=none
/ ; stdin and stdout are *binary* Syndicate-protocol channels
@binarySyndicate =application/syndicate
/ ; stdin and stdout are *text* Syndicate-protocol channels
@textSyndicate =text/syndicate
.

View File

@ -1,10 +0,0 @@
version 1 .
embeddedType EntityRef.Cap .
DebtReporter = <debt-reporter @intervalSeconds double>.
TcpRelayListener = <relay-listener @addr TransportAddress.Tcp @gatekeeper #!gatekeeper.Resolve> .
UnixRelayListener = <relay-listener @addr TransportAddress.Unix @gatekeeper #!gatekeeper.Resolve> .
ConfigWatcher = <config-watcher @path string @env ConfigEnv>.
ConfigEnv = { symbol: any ...:... }.

View File

@ -1,15 +0,0 @@
#!/bin/sh
cd "$(dirname "$0")"
set -e
build() {
make -C ~/src/syndicate-rs $1-binary-debug 2>&1 | tee buildlog.$1
cp -p ~/src/syndicate-rs/target/$1-*/debug/syndicate-server syndicate-server.$1
}
cp -r ~/src/syndicate-rs/syndicate-server/protocols .
build x86_64 &
#build armv7 &
#build aarch64 &
wait

View File

@ -1,15 +0,0 @@
#!/bin/sh
cd "$(dirname "$0")"
set -e
build() {
make -C ~/src/syndicate-rs $1-binary-release 2>&1 | tee buildlog.$1
cp -p ~/src/syndicate-rs/target/$1-*/release/syndicate-server syndicate-server.$1
}
cp -r ~/src/syndicate-rs/syndicate-server/protocols .
build x86_64 &
build armv7 &
build aarch64 &
wait

View File

@ -1,5 +1,5 @@
buildlog.*
synit-pid1.x86_64
synit-pid1.armv7
synit-pid1.aarch64
VERSION
buildlog.*
synit-pid1.aarch64
synit-pid1.armv7
synit-pid1.x86_64

View File

@ -1,14 +0,0 @@
#!/bin/sh
cd "$(dirname "$0")"
set -e
build() {
make -C ../../../synit-pid1 $1-binary-release 2>&1 | tee buildlog.$1
cp -p ../../../synit-pid1/target/$1-*/release/synit-pid1 synit-pid1.$1
}
build x86_64 &
build armv7 &
build aarch64 &
wait