diff options
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | PKGBUILD | 50 | ||||
| -rw-r--r-- | config.toml | 13 | ||||
| -rw-r--r-- | scrapbook-sysusers.conf | 1 |
4 files changed, 70 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..813091e --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +* +!.gitignore +!PKGBUILD +!scrapbook-sysusers.conf +!scrapbook.conf +!config.toml
\ No newline at end of file diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..c3220bf --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,50 @@ +# Maintainer: Leonardo Bishop <me@leonardobishop.net> +_pkgname=scrapbook +pkgname="${_pkgname}-git" +pkgdesc="Static site web server" +pkgver=r23.67a9340 +pkgrel=1 +makedepends=('go' 'make' 'git') +arch=('x86_64') +url="https://git.leonardobishop.net/scrapbook/" +license=('AGPL-3.0-or-later') +conflicts=("${_pkgname}") +provides=("${_pkgname}=${pkgver}") +source=(scrapbook::git+https://git.leonardobishop.net/scrapbook + scrapbook.service + scrapbook-sysusers.conf + config.toml) +sha256sums=('SKIP' + 'c5ac3b2166f17bf9e4473641e7e98270b987f2e782691ed55fa38e801ce1294d' + 'c44b4233a0069488682e7fc02ed268bc91c2b01465ce89af742ef94a9407a80b' + 'b3857bcf4616443ba52ad4bdff250129da0c96fb0937ba7a36214dfe1c85d285') + +pkgver() { + cd "scrapbook" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" +} + +prepare() { + export GOPATH="$srcdir/build" + + cd "scrapbook" + go mod download +} + +build() { + export GOPATH="$srcdir/build" + export SYS_CONF_DIR="/etc/scrapbook" + export SYS_DATA_DIR="/var/lib/scrapbook" + + cd "scrapbook" + make +} + +package() { + install -Dm755 "$srcdir/scrapbook/scrapbook" "$pkgdir/usr/bin/scrapbook" + install -Dm644 "$srcdir/scrapbook.service" "$pkgdir/usr/lib/systemd/system/scrapbook.service" + install -Dm644 "$srcdir/scrapbook-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/scrapbook.conf" + install -d "${pkgdir}/etc/scrapbook" + install -Dm644 "$srcdir/config.toml" "$pkgdir/etc/scrapbook/config.toml" + install -d "${pkgdir}/var/lib/scrapbook" +} diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..a557edc --- /dev/null +++ b/config.toml @@ -0,0 +1,13 @@ +[Listen] +Address = '0.0.0.0' +Port = 80 + +[Command] +Host = '' +Secret = '' + +[[API]] +Enable = true + +[[Web]] +Enable = true diff --git a/scrapbook-sysusers.conf b/scrapbook-sysusers.conf new file mode 100644 index 0000000..c4b2124 --- /dev/null +++ b/scrapbook-sysusers.conf @@ -0,0 +1 @@ +u scrapbook - "Static site web server" |
