summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 02a5dbdb3375e82933525b727e233344c8741fb0 (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
# Maintainer: tarball <bootctl@gmail.com>

pkgname=silverbullet
pkgver=0.3.4
pkgrel=1
pkgdesc='A clean Markdown-based writing/note taking application'
arch=(any)
url='https://github.com/silverbulletmd/silverbullet'
license=(MIT)
depends=(deno)
source=(
  "$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz"
  "$pkgname.service"
)
sha256sums=('147a0d4c6f804480827ac49397e023f0459cf4cb67e0248bfc7621913f306117'
            '5309053371a003f3c32365eb15dbd38118ab2409a0a5737854261f821fe253a3')

build() {
  cd "$pkgname-$pkgver"
  deno task build
  deno task bundle
}

package() {
  install -dm755 "$pkgdir/etc/default"

  cat >"$pkgdir/etc/default/$pkgname" <<EOF
HOST=localhost
PORT=3000
EOF

  install -Dm644 "$pkgname.service" \
    "$pkgdir/usr/lib/systemd/system/$pkgname.service"

  cd "$pkgname-$pkgver"

  install -Dm644 "dist/$pkgname.js" \
    "$pkgdir/usr/lib/$pkgname/$pkgname.js"

  install -Dm644 LICENSE.md \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}