Browse Source

add: webmention.io

master
chimo 2 years ago
parent
commit
b0081d5ed9
4 changed files with 109 additions and 0 deletions
  1. +64
    -0
      webmention.io/APKBUILD
  2. +8
    -0
      webmention.io/start.patch
  3. +9
    -0
      webmention.io/webmention.confd
  4. +28
    -0
      webmention.io/webmention.initd

+ 64
- 0
webmention.io/APKBUILD View File

@ -0,0 +1,64 @@
# Maintainer: Chimo <chimo@chromic.org>
# NOTE: Opt Deps:
# - mariadb
# - nginx
# - redis
#
#
# NOTE: After installing this, configure steps:
#
# `cp config.yml.template config.yml`
# create dbUser/db
# `bundle exec rake db:bootstrap`
pkgname="webmention.io"
pkgver=0.0.1_git20190617
_gitver="928f09e234128c0ba9411ee08a97462b22e26d00"
pkgrel=0
pkgdesc="Easily enable webmentions and pingbacks on any web page"
url="https://github.com/aaronpk/webmention.io"
arch="x86_64"
license="BSD"
depends="
libxml2
libxslt
ruby
ruby-bundler
ruby-bigdecimal
ruby-webrick
"
makedepends="build-base ruby-dev mariadb-dev libxml2-dev linux-headers"
subpackages="$pkgname-openrc"
options="!check"
source="
$pkgname-$pkgver.tar.gz::https://github.com/aaronpk/webmention.io/archive/$_gitver.tar.gz
webmention.initd
webmention.confd
start.patch
"
builddir="$srcdir/$pkgname-$_gitver"
build() {
cd "$builddir"
# Change 0.4.2 to 0.4.10 for mysql2 dependency
# for compatibility with our version of mariadb
sed -i -E "s/^(gem 'mysql2',\s+)'0\.4\.2'/\1'0.4.10'/" Gemfile
# Update Gemfile.lock, etc
BUNDLE_PATH=./vendor bundle update mysql2 --patch
}
package() {
installdir="$pkgdir/usr/share/webapps"
mkdir -p "$installdir"
cp -r "$srcdir/$pkgname-$_gitver" "$installdir"/"$pkgname"
install -Dm755 "$srcdir"/webmention.initd \
"$pkgdir"/etc/init.d/webmention
install -Dm644 "$srcdir"/webmention.confd \
"$pkgdir"/etc/conf.d/webmention
}
sha512sums="69c9a73d6b462b08da53a8294a9a32c7c521a548fc935d1c804b1017c4088a13f2688fd1ffecc4b3a868668742332c245d010a911ec5944d317de5ff75a5cd0c webmention.io-0.0.1_git20190617.tar.gz
59848c9cbd3332d303d882842aec67d7785acab3f9b8007350a2a711777cf91a201b876d727fa5fdc55a36dca64c374fc1b010cc8e610f848957bdfec0f46cdf webmention.initd
f61afc419ae21e52bd959da17cf0b9e86306c6971d69b71687687f0680824d01c23705d92cafaa49108c9821f133ec63c6950d2cf2e225f1298e6f34009f1aa3 webmention.confd
141ccbf7eecd08d88dc5d3c2f2560c905811338f403dcbd917cac22686afe920803e048c2bf5693c7bc6f3f6beb8d25870c70ec82f3ae446453dfc701a89e501 start.patch"

+ 8
- 0
webmention.io/start.patch View File

@ -0,0 +1,8 @@
diff --unified --recursive --text a/start.sh b/start.sh
--- a/start.sh 2019-07-22 19:42:04.608929915 -0400
+++ b/start.sh 2019-07-22 19:42:42.499335342 -0400
@@ -1,3 +1,3 @@
#!/bin/bash
-bundle exec shotgun -s thin -P public -p 9019
+bundle exec thin -a 127.0.0.1 -p 9019 --threaded start

+ 9
- 0
webmention.io/webmention.confd View File

@ -0,0 +1,9 @@
# Run the daemon as this user:
WEBMENTION_USER=nobody
# If no, use an external sql server
# LOCAL_DB=yes
# If no, use an external redis server
# LOCAL_REDIS=yes

+ 28
- 0
webmention.io/webmention.initd View File

@ -0,0 +1,28 @@
#!/sbin/openrc-run
name="webmention"
description="Easily enable webmentions and pingbacks on any web page"
supervisor=supervise-daemon
WEBMENTION_USER=${WEBMENTION_USER:-nobody}
LOGS=/var/log/webmention.log
LOCAL_DB=${LOCAL_DB:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
supervise_daemon_args="-d /usr/share/webapps/webmention.io -1 $LOGS -2 $LOGS"
command="/bin/sh"
command_args="/usr/share/webapps/webmention.io/start.sh"
command_user="$WEBMENTION_USER:$WEBMENTION_USER"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
[ "$LOCAL_DB" = "yes" ] && need mariadb
[ "$LOCAL_REDIS" = "yes" ] && need redis
}
start_pre() {
checkpath -f "$LOGS" -m 644 -o "$WEBMENTION_USER:$WEBMENTION_USER"
export BUNDLE_PATH=/usr/share/webapps/webmention.io/vendor
export PATH=$PATH:/usr/share/webapps/webmention.io/vendor/bin
export RACK_ENV="production"
}

Loading…
Cancel
Save