diff options
author | YuutaW | 2020-07-22 10:33:21 -0700 |
---|---|---|
committer | YuutaW | 2020-07-22 10:33:21 -0700 |
commit | d925e2005496b3718eb5b7a5b6c5870472448c32 (patch) | |
tree | cd8bc37a23a23e396454259ebcd96f9fb895c82a | |
download | aur-d925e2005496b3718eb5b7a5b6c5870472448c32.tar.gz |
First Commit
Signed-off-by: YuutaW <i@yuuta.moe>
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 62 | ||||
-rw-r--r-- | rsshub.conf | 3 | ||||
-rw-r--r-- | rsshub.service | 16 |
5 files changed, 104 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..13db36cc5986 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = rsshub-git + pkgdesc = Everything is RSSible + pkgver = cf97ab46 + pkgrel = 1 + url = https://rsshub.app/ + arch = any + license = MIT + makedepends = npm + depends = nodejs + backup = etc/rsshub/rsshub.conf + source = rsshub-git::git+https://github.com/DIYgod/RSSHub.git + source = rsshub.conf + source = rsshub.service + md5sums = SKIP + md5sums = 6621493e94958b1d3ac8d031bff36eb4 + md5sums = 54c5973da069e43632e62ebeef50329b + +pkgname = rsshub-git + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..f1a111de3e52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.zst +pkg/ +src/ +rsshub-git/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b4f05b5b7f1a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,62 @@ +# Maintainer: YuutaW <i@yuuta.moe> +pkgname='rsshub-git' +pkgver=cf97ab46 +pkgrel=1 +epoch= +pkgdesc="Everything is RSSible" +arch=('any') +url="https://rsshub.app/" +license=('MIT') +depends=('nodejs') +makedepends=('npm') +checkdepends=() +optdepends=() +backup=('etc/rsshub/rsshub.conf') +source=("$pkgname::git+https://github.com/DIYgod/RSSHub.git" + "rsshub.conf" + "rsshub.service") +noextract=() +md5sums=('SKIP' + '6621493e94958b1d3ac8d031bff36eb4' + '54c5973da069e43632e62ebeef50329b') +pkgver() { + cd "$srcdir/$pkgname" + git describe --always | sed 's|-|.|g' +} + +prepare() { + cd "$srcdir/$pkgname" + # Remove unnecessary directory + rm -rf .github + rm -rf docs + rm -rf test +} + +build() { + cd "$srcdir/$pkgname" + npm install --production --cache "${srcdir}/npm-cache" + + # Cleanup node modules, as Dockerfile does. + chmod +x ./tools/clean-nm.sh + ./tools/clean-nm.sh +} + +package() { + cd "$srcdir/$pkgname" + mkdir -p $pkgdir/opt/rsshub + cp -R ./* $pkgdir/opt/rsshub/ + chown -R root:root "${pkgdir}/opt/" + find "${pkgdir}/opt" -type d -exec chmod 755 {} + + + mkdir -p $pkgdir/etc/rsshub + install -Dm644 $srcdir/rsshub.conf $pkgdir/etc/rsshub/rsshub.conf + + mkdir -p $pkgdir/usr/share/licenses/rsshub/ + install -Dm644 ./LICENSE $pkgdir/usr/share/licenses/rsshub/LICENSE + + # TODO: We still have several JS which contains the $srcdir + find "$pkgdir" -type f -name package.json -print0 | xargs -0 sed -i "/_where/d" + + mkdir -p $pkgdir/usr/lib/systemd/system + install -Dm644 $srcdir/rsshub.service $pkgdir/usr/lib/systemd/system/rsshub.service +} diff --git a/rsshub.conf b/rsshub.conf new file mode 100644 index 000000000000..50f8674ac4a8 --- /dev/null +++ b/rsshub.conf @@ -0,0 +1,3 @@ +HTTP_BASIC_AUTH_NAME=usernam3 +HTTP_BASIC_AUTH_PASS=passw0rd +PORT=1200 diff --git a/rsshub.service b/rsshub.service new file mode 100644 index 000000000000..58aeab0d1f89 --- /dev/null +++ b/rsshub.service @@ -0,0 +1,16 @@ +[Unit] +Description=Everything is RSSible +After=network.target network-online.target + +[Service] +User=nobody +Group=nobody +EnvironmentFile=/etc/rsshub/rsshub.conf +Environment=NO_LOGFILES=true +ExecStart=/usr/bin/node /opt/rsshub/lib/index.js +KillMode=mixed +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE + +[Install] +WantedBy=multi-user.target |