diff options
author | Adrian Sinclair | 2019-02-09 15:37:02 -0500 |
---|---|---|
committer | Adrian Sinclair | 2019-02-09 15:37:02 -0500 |
commit | dff8bf9cf047609554a661b87c8627696064d542 (patch) | |
tree | f604af5d1fbdee14b14b60758f7048e1adfc1e8e | |
download | aur-ghost-web.tar.gz |
package
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | PKGBUILD | 34 | ||||
-rw-r--r-- | ghost-web-sysusers.conf | 2 | ||||
-rw-r--r-- | ghost-web.install | 10 | ||||
-rw-r--r-- | ghost-web.service | 14 |
5 files changed, 81 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..16113fa0acf0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = ghost-web + pkgdesc = Full-featured nodejs blogging platform + pkgver = 2.14.0 + pkgrel = 1 + url = https://ghost.org/ + install = ghost-web.install + arch = any + license = GPL + makedepends = npm + depends = nodejs-lts-dubnium + depends = mysql + noextract = ghost-cli-1.9.9.tgz + source = https://registry.npmjs.org/ghost-cli/-/ghost-cli-1.9.9.tgz + source = ghost-web.service + source = ghost-web-sysusers.conf + md5sums = 9444181acef44d357af672ef9817899b + md5sums = 3ad42d4f2ab2a7d4dd02bc9170de2c8b + md5sums = 80dabee626a96ba2403a3bdb4d351d5c + +pkgname = ghost-web + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b5d853879bc3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,34 @@ +# Maintainer: Adrian Sinclair <adrian at adrusi dot com> + +pkgname=ghost-web +pkgver=2.14.0 +pkgrel=1 +pkgdesc="Full-featured nodejs blogging platform" +arch=(any) +url="https://ghost.org/" +license=('GPL') +makedepends=('npm') +depends=('nodejs-lts-dubnium' 'mysql') +install=ghost-web.install +source=("https://registry.npmjs.org/ghost-cli/-/ghost-cli-1.9.9.tgz" + ghost-web.service + ghost-web-sysusers.conf) +noextract=(ghost-cli-1.9.9.tgz) +md5sums=('9444181acef44d357af672ef9817899b' + '3ad42d4f2ab2a7d4dd02bc9170de2c8b' + '80dabee626a96ba2403a3bdb4d351d5c') + +package() { + npm install -g --user root --prefix "$pkgdir"/usr "$srcdir"/ghost-cli-1.9.9.tgz + mv "$pkgdir"/usr/bin/ghost{,-web} + + # Fix permissions + find "$pkgdir"/usr -type d -exec chmod 755 '{}' + + + install -Dm644 ghost-web.service -t "$pkgdir"/usr/lib/systemd/system/ + install -Dm644 ghost-web-sysusers.conf "$pkgdir"/usr/lib/sysusers.d/ghost-web.conf + + mkdir -p "$pkgdir"/var/lib/ghost-web + chmod 775 "$pkgdir"/var/lib/ghost-web +} + diff --git a/ghost-web-sysusers.conf b/ghost-web-sysusers.conf new file mode 100644 index 000000000000..32a2477d6cba --- /dev/null +++ b/ghost-web-sysusers.conf @@ -0,0 +1,2 @@ +u ghost - "ghost blogging platform daemon" - - +u ghost-web - "ghost blogging platform admin" - - diff --git a/ghost-web.install b/ghost-web.install new file mode 100644 index 000000000000..707a44db641a --- /dev/null +++ b/ghost-web.install @@ -0,0 +1,10 @@ +post_install() { + chown ghost-web:ghost-web /var/lib/ghost-web + su -ls /bin/sh ghost-web -c 'ghost-web install 2.14.0 --no-stack --no-setup --dir /var/lib/ghost-web' + + echo "---" + echo "NOTE: the ghost cli tool binary is renamed to \"ghost-web\"." + echo "Run \"su -ls /bin/sh ghost-web -c 'cd /var/lib/ghost-web; ghost-web setup --no-setup-systemd --no-setup-linux-user --no-start'\" to complete installation." + echo "Start the server with \"systemctl start ghost-web\"." + echo "---" +} diff --git a/ghost-web.service b/ghost-web.service new file mode 100644 index 000000000000..201709f7ae5a --- /dev/null +++ b/ghost-web.service @@ -0,0 +1,14 @@ +[Unit] +Description=Ghost systemd service. +Documentation=https://docs.ghost.org + +[Service] +Type=simple +WorkingDirectory=/var/lib/ghost-web +User=ghost +Environment="NODE_ENV=production" +ExecStart=/usr/bin/ghost-web run +Restart=always + +[Install] +WantedBy=multi-user.target |