diff options
author | Py64 | 2015-12-09 17:08:42 +0100 |
---|---|---|
committer | Py64 | 2015-12-09 17:08:42 +0100 |
commit | 2b4cb913677dcdda74caf032120f9b6adb155e7f (patch) | |
tree | b01926d6ec2aecb2af2f867a1aeb08b19ced158b | |
download | aur-2b4cb913677dcdda74caf032120f9b6adb155e7f.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | PKGBUILD | 54 | ||||
-rw-r--r-- | httpjs.install | 9 | ||||
-rw-r--r-- | httpjs.patch | 15 | ||||
-rw-r--r-- | httpjs.service | 18 | ||||
-rw-r--r-- | httpjs.sh | 2 |
6 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..986f2209f08f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +# Generated by mksrcinfo v8 +# Wed Dec 9 16:06:00 UTC 2015 +pkgbase = httpjs-git + pkgdesc = Lightweight web server + pkgver = r35.a4a958e + pkgrel = 1 + url = https://httpjs.wolflinux.org + install = httpjs.install + arch = i686 + arch = x86_64 + license = custom + makedepends = git + makedepends = npm + depends = nodejs + depends = zlib + depends = openssl + provides = httpjs + conflicts = httpjs + replaces = httpjs + backup = etc/httpjs/GoFile + source = git+https://github.com/HTTPjs/HTTPjs.git + source = httpjs.patch + source = httpjs.sh + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + +pkgname = httpjs-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..463cbc1ad9db --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,54 @@ +# Maintainer: Py64 <py64.wolflinux@gmail.com> + +pkgname=httpjs-git +pkgver=r35.a4a958e +pkgrel=1 +pkgdesc='Lightweight web server' +arch=('i686' 'x86_64') +url='https://httpjs.wolflinux.org' +license=('custom') +depends=('nodejs' 'zlib' 'openssl') +makedepends=('git' 'npm') +backup=('etc/httpjs/GoFile') +conflicts=('httpjs') +replaces=('httpjs') +provides=('httpjs') +install=httpjs.install +source=("git+https://github.com/HTTPjs/HTTPjs.git" 'httpjs.patch' 'httpjs.sh') +md5sums=('SKIP' 'SKIP' 'SKIP') + +pkgver() { + cd "$srcdir/HTTPjs" + ( set -o pipefail + git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) +} + +package() { + cd "$srcdir/HTTPjs" + mkdir "$pkgdir/usr" "$pkgdir/usr/bin" "$pkgdir/srv" \ + "$pkgdir/var" "$pkgdir/var/log" "$pkgdir/var/log/httpjs" \ + "$pkgdir/srv/http" "$pkgdir/usr/share" "$pkgdir/usr/share/httpjs" \ + "$pkgdir/usr/share/httpjs/errors" "$pkgdir/etc" "$pkgdir/etc/httpjs" \ + "$pkgdir/var/lib" "$pkgdir/var/lib/httpjs" \ + "$pkgdir/var/lib/httpjs/letsencrypt-client" "$pkgdir/var/lib/httpjs/js" \ + "$pkgdir/var/lib/httpjs/js/node_modules" + patch < "$srcdir/httpjs.patch" + cp lib/*.js "$pkgdir/var/lib/httpjs/js/" + cp http.js "$pkgdir/var/lib/httpjs/httpjs" + cp "$srcdir/httpjs.sh" "$pkgdir/usr/bin/httpjs" + chmod +x "$pkgdir/usr/bin/httpjs" + cp GoFile.example "$pkgdir/etc/httpjs" + cp GoFile.example "$pkgdir/etc/httpjs/GoFile" + cp public/index.html "$pkgdir/srv/http" + cp error-pages/*.html "$pkgdir/usr/share/httpjs/errors" + + echo "Installing dependencies..." + npm install --prefix "$pkgdir/var/lib/httpjs/js/" stream-buffers@3.0.0 \ + fastcgi-parser@0.1.x \ + mmmagic@0.4.1 \ + spdy@3.0.0 \ + js-yaml@3.4.6 \ + streamifier@0.1.1 +} diff --git a/httpjs.install b/httpjs.install new file mode 100644 index 000000000000..a9f4178ae609 --- /dev/null +++ b/httpjs.install @@ -0,0 +1,9 @@ +post_install() { + echo "Installing dependencies..." + npm install -g stream-buffers@3.0.0 \ + fastcgi-parser@0.1.x \ + mmmagic@0.4.1 \ + spdy@3.0.0 \ + js-yaml@3.4.6 + echo "You can run HTTPjs with httpjs command." +} diff --git a/httpjs.patch b/httpjs.patch new file mode 100644 index 000000000000..d835578efbef --- /dev/null +++ b/httpjs.patch @@ -0,0 +1,15 @@ +--- http.js 2015-12-09 16:01:12.418503712 +0100 ++++ http.js.new 2015-12-09 16:02:41.956760729 +0100 +@@ -14,9 +14,9 @@ + url = require("url"), + path = require("path"), + iniparser = require('iniparser'), +- php = require("./lib/php.js"), +- out = require("./lib/out.js"), +- fsd = require("./lib/fsaccess.js"), ++ php = require("/var/lib/httpjs/js/php.js"), ++ out = require("/var/lib/httpjs/js/out.js"), ++ fsd = require("/var/lib/httpjs/js/fsaccess.js"), + zlib = require("zlib"), + httpserver = null, + phpserver = null, diff --git a/httpjs.service b/httpjs.service new file mode 100644 index 000000000000..76e32cb3db5e --- /dev/null +++ b/httpjs.service @@ -0,0 +1,18 @@ +[Unit] +Description=A web server written in NodeJS +After=network.target + +[Service] +Type=forking +PIDFile=/run/httpjs.pid +PrivateDevices=yes +SyslogLevel=err + +ExecStart=/home/py64/GIT/HTTPjs/http.js --pid /run/httpjs.pid +ExecReload=/usr/bin/kill -HUP $MAINPID +KillSignal=SIGQUIT +KillMode=mixed + +[Install] +WantedBy=multi-user.target + diff --git a/httpjs.sh b/httpjs.sh new file mode 100644 index 000000000000..40d8390c9923 --- /dev/null +++ b/httpjs.sh @@ -0,0 +1,2 @@ +#!/bin/bash +NODE_PATH="/usr/lib/node_modules:/var/lib/httpjs/js/node_modules" node /var/lib/httpjs/httpjs $@ |