summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Poulin2016-02-12 18:01:24 -0500
committerMaxime Poulin2016-02-12 18:01:24 -0500
commit72ce7c1c277a83f6b6d07170e4cf9a674aedcb82 (patch)
treeacbf1962a1588b6319606d317448d457899e6b58
downloadaur-72ce7c1c277a83f6b6d07170e4cf9a674aedcb82.tar.gz
Initial package of TheLounge IRC client
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD43
-rw-r--r--install10
-rw-r--r--system.service16
-rw-r--r--user.service9
5 files changed, 101 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..3b0388d59f4
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+# Generated by mksrcinfo v8
+# ven fév 12 22:51:11 UTC 2016
+pkgbase = thelounge
+ pkgdesc = Web-based IRC client - Official community for of Shout
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://thelounge.github.io//
+ install = install
+ arch = any
+ license = MIT
+ makedepends = npm
+ depends = nodejs
+ noextract = thelounge-1.0.0.tgz
+ backup = etc/thelounge/config.js
+ source = http://registry.npmjs.org/thelounge/-/thelounge-1.0.0.tgz
+ source = system.service
+ source = user.service
+ sha256sums = c809b71ded3fe87826117e42ed79383e654fc23e5b0587c041dbd1f141140822
+ sha256sums = SKIP
+ sha256sums = SKIP
+
+pkgname = thelounge
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c3833625a8e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Maxime Poulin <maxpoulin64@gmail.com>
+pkgname='thelounge'
+_npmname='thelounge'
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Web-based IRC client - Official community for of Shout"
+url='https://thelounge.github.io//'
+arch=('any')
+license=('MIT')
+depends=('nodejs')
+makedepends=('npm')
+install=install
+backup=('etc/thelounge/config.js')
+source=(
+ "http://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz"
+ "system.service"
+ "user.service"
+)
+noextract=("$_npmname-$pkgver.tgz")
+sha256sums=(
+ 'c809b71ded3fe87826117e42ed79383e654fc23e5b0587c041dbd1f141140822'
+ 'SKIP'
+ 'SKIP'
+)
+
+package() {
+ local _etc="$pkgdir/etc/$pkgname"
+
+ npm install -g --prefix "$pkgdir/usr" "$srcdir/$_npmname-$pkgver.tgz"
+
+ install -dm700 "$_etc" "$_etc/users"
+ install -Dm600 \
+ "$pkgdir/usr/lib/node_modules/$_npmname/defaults/config.js" \
+ "$_etc/config.js"
+
+ install -Dm644 "$srcdir/system.service" \
+ "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+ install -Dm644 "$srcdir/user.service" \
+ "$pkgdir/usr/lib/systemd/user/$pkgname.service"
+
+ grep -FRlZ "$startdir" "$pkgdir" | \
+ xargs -0 -- sed -i "s|$startdir|/tmp/build|g"
+}
diff --git a/install b/install
new file mode 100644
index 00000000000..b6ac4f39e6c
--- /dev/null
+++ b/install
@@ -0,0 +1,10 @@
+post_install() {
+ groupadd thelounge &>/dev/null
+ useradd -g thelounge -d /etc/thelounge -s /bin/false thelounge &> /dev/null
+ chown -R thelounge:thelounge /etc/thelounge &> /dev/null
+}
+
+pre_remove() {
+ getent passwd thelounge &>/dev/null && userdel thelounge &> /dev/null
+}
+
diff --git a/system.service b/system.service
new file mode 100644
index 00000000000..81610389b21
--- /dev/null
+++ b/system.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=The Lounge IRC client
+After=network.target
+
+[Service]
+User=thelounge
+Group=thelounge
+Type=simple
+ExecStart=/usr/bin/lounge --home /etc/thelounge
+ProtectSystem=yes
+ProtectHome=yes
+NoNewPrivileges=yes
+PrivateTmp=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/user.service b/user.service
new file mode 100644
index 00000000000..ccd41dc9d1a
--- /dev/null
+++ b/user.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=The Lounge IRC client
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/lounge
+
+[Install]
+WantedBy=default.target