summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenOokamiHoro2017-02-01 18:40:05 +0800
committerKenOokamiHoro2017-02-01 18:40:05 +0800
commit849d27a8047e8fecfda4b40179e0a2b072043d62 (patch)
treebebe3a036f07de665cf24618347ca04e0900bafb
downloadaur-849d27a8047e8fecfda4b40179e0a2b072043d62.tar.gz
Version 0.6.1
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD44
-rw-r--r--parsoid.install41
-rw-r--r--parsoid.service20
4 files changed, 133 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..859fc338c813
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,28 @@
+# Generated by mksrcinfo v8
+# Wed Feb 1 10:39:47 UTC 2017
+pkgbase = parsoid
+ pkgdesc = A bidirectional wikitext parser and runtime
+ pkgver = 0.6.1
+ pkgrel = 1
+ url = https://www.mediawiki.org/wiki/Parsoid
+ install = parsoid.install
+ arch = any
+ license = GPL2
+ depends = nodejs
+ depends = npm
+ optdepends = mediawiki: MediaWiki engine
+ provides = parsoid
+ conflicts = parsoid-git
+ replaces = parsoid-git
+ options = !strip
+ backup = usr/share/webapps/parsoid/localsettings.js
+ backup = usr/share/webapps/parsoid/config.yaml
+ source = https://github.com/wikimedia/parsoid/archive/v0.6.1.zip
+ source = parsoid.service
+ source = parsoid.install
+ sha512sums = 72617f5badf0160dff0a0691712307dd2b68164e10618a1809e688908f5b5d6621c18228234e48120856337ea04cbabd46644a5c3201eb1826e3add5fe00918a
+ sha512sums = b4f8a2fc5119fa4741d79c66b5bb2282b274018ad548d383c6007fbe66d14ee1de6744a2cdcf1f8453ca055f48716598b42d3faecd29b81f61c06a54df64ed7d
+ sha512sums = 3b6fdba7a211ccfb038cd1fbe38214b439ce873d6c5bf99187e0c2be19052c2f28ebd322ddf5696f676ee426f177fec828399f859bda6cc4592518e9fa5bbdf5
+
+pkgname = parsoid
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d56c0948fc0d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Contributor: Jonas Heinrich <onny@project-insanity.org>
+# Maintainer: Horo <horo@yoitsu.moe>
+
+pkgname=parsoid
+pkgver=0.6.1
+pkgrel=1
+pkgdesc="A bidirectional wikitext parser and runtime"
+arch=('any')
+url="https://www.mediawiki.org/wiki/Parsoid"
+license=('GPL2')
+depends=('nodejs' 'npm')
+optdepends=(
+ 'mediawiki: MediaWiki engine'
+)
+conflicts=('parsoid-git')
+replaces=('parsoid-git')
+provides=('parsoid')
+backup=(usr/share/webapps/parsoid/localsettings.js
+ usr/share/webapps/parsoid/config.yaml)
+source=("https://github.com/wikimedia/parsoid/archive/v${pkgver}.zip"
+ "parsoid.service"
+ "parsoid.install")
+sha512sums=("72617f5badf0160dff0a0691712307dd2b68164e10618a1809e688908f5b5d6621c18228234e48120856337ea04cbabd46644a5c3201eb1826e3add5fe00918a"
+ "b4f8a2fc5119fa4741d79c66b5bb2282b274018ad548d383c6007fbe66d14ee1de6744a2cdcf1f8453ca055f48716598b42d3faecd29b81f61c06a54df64ed7d"
+ "3b6fdba7a211ccfb038cd1fbe38214b439ce873d6c5bf99187e0c2be19052c2f28ebd322ddf5696f676ee426f177fec828399f859bda6cc4592518e9fa5bbdf5")
+options=('!strip')
+install="parsoid.install"
+prepare() {
+ cp -R $srcdir/parsoid-${pkgver} $srcdir/parsoid
+}
+build() {
+ cd $srcdir/parsoid
+ npm install
+}
+package() {
+ mkdir -p "${pkgdir}/usr/share/webapps/${pkgname}"
+ cd $srcdir/parsoid
+ cp localsettings.example.js localsettings.js
+ cp config.example.yaml config.yaml
+ cp -R . "${pkgdir}/usr/share/webapps/${pkgname}/"
+ install -Dm644 "${srcdir}/parsoid.service" "${pkgdir}/usr/lib/systemd/system/parsoid.service"
+ install -D "COPYING.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
diff --git a/parsoid.install b/parsoid.install
new file mode 100644
index 000000000000..7f739124a41e
--- /dev/null
+++ b/parsoid.install
@@ -0,0 +1,41 @@
+# Colored makepkg-like functions
+all_off="$(tput sgr0)"
+bold="${all_off}$(tput bold)"
+blue="${bold}$(tput setaf 4)"
+yellow="${bold}$(tput setaf 3)"
+
+msg_blue() {
+ printf "${blue}==>${bold} $1${all_off}\n"
+}
+
+note() {
+ printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
+}
+
+_update() {
+ if ! getent passwd parsoid &>/dev/null; then
+ msg_blue "Adding user 'parsoid'"
+ useradd -m -r -U -d /usr/share/webapps/parsoid -s /bin/false parsoid &>/dev/null
+ chown -R parsoid /usr/share/webapps/parsoid
+ chgrp -R parsoid /usr/share/webapps/parsoid
+ fi
+}
+
+post_install() {
+ _update
+ echo ">> Before run Parsoid, modify /usr/share/webapps/parsoid/config.yaml ."
+ echo ">> Reference comments in this file for help ."
+}
+
+post_upgrade() {
+ _update
+ note "Parsoid now use 'config.yaml' as config file."
+}
+
+post_remove() {
+ if getent passwd parsoid &>/dev/null; then
+ msg_blue "Removing user 'parsoid'"
+ userdel -rf parsoid &>/dev/null
+ fi
+}
+
diff --git a/parsoid.service b/parsoid.service
new file mode 100644
index 000000000000..895d8e43debb
--- /dev/null
+++ b/parsoid.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Mediawiki Parsoid web service on node.js
+Documentation=http://www.mediawiki.org/wiki/Parsoid
+Wants=local-fs.target network.target
+After=local-fs.target network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=simple
+User=parsoid
+Group=parsoid
+WorkingDirectory=/usr/share/webapps/parsoid
+ExecStart=/usr/bin/node /usr/share/webapps/parsoid/bin/server.js
+KillMode=process
+Restart=on-success
+PrivateTmp=true
+StandardOutput=syslog
+