dcallagh-exheres

My personal Exherbo repository
git clone https://code.djc.id.au/git/dcallagh-exheres/
commit 1c3f4d5c815991669a82601f3506f35570d9e3de
parent ff80583e5b7c9f3dabb4b4c8304a7ed004079787
Author: Dan Callaghan <djc@djc.id.au>
Date:   Mon,  4 Jul 2011 21:30:03 +1000

prosody

Diffstat:
Ametadata/accounts/groups/prosody.conf | 0
Ametadata/accounts/users/prosody.conf | 4++++
Mmetadata/categories.conf | 1+
Apackages/net-im/prosody/files/prosody-0.8.2-enable-posix.patch | 34++++++++++++++++++++++++++++++++++
Apackages/net-im/prosody/files/systemd/prosody.service | 12++++++++++++
Apackages/net-im/prosody/prosody-0.8.2.exheres-0 | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 108 insertions(+), 0 deletions(-)
diff --git a/metadata/accounts/groups/prosody.conf b/metadata/accounts/groups/prosody.conf
diff --git a/metadata/accounts/users/prosody.conf b/metadata/accounts/users/prosody.conf
@@ -0,0 +1,4 @@
+gecos = Prosody XMPP server
+home = /dev/null
+shell = /sbin/nologin
+primary_group = prosody
diff --git a/metadata/categories.conf b/metadata/categories.conf
@@ -11,6 +11,7 @@ gnome-extra
 gnome-platform
 mail-client
 net-libs
+net-im
 net-misc
 sys-apps
 sys-auth
diff --git a/packages/net-im/prosody/files/prosody-0.8.2-enable-posix.patch b/packages/net-im/prosody/files/prosody-0.8.2-enable-posix.patch
@@ -0,0 +1,34 @@
+diff -ur prosody-0.8.2.orig/prosody.cfg.lua.dist prosody-0.8.2/prosody.cfg.lua.dist
+--- prosody-0.8.2.orig/prosody.cfg.lua.dist	2011-06-13 07:21:40.000000000 +1000
++++ prosody-0.8.2/prosody.cfg.lua.dist	2011-07-04 21:25:52.959240265 +1000
+@@ -59,7 +59,7 @@
+ 		--"admin_telnet"; -- Opens telnet console interface on localhost port 5582
+ 
+ 	-- Other specific functionality
+-		--"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
++		"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
+ 		--"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
+ 		--"httpserver"; -- Serve static files from a directory over HTTP
+ 		--"groups"; -- Shared roster support
+@@ -69,6 +69,8 @@
+ 		--"motd"; -- Send a message to users when they log in
+ };
+ 
++daemonize = false; -- will refuse to daemonize under systemd
++
+ -- These modules are auto-loaded, should you
+ -- (for some mad reason) want to disable
+ -- them then uncomment them below
+@@ -123,9 +125,9 @@
+ -- Logging configuration
+ -- For advanced logging see http://prosody.im/doc/logging
+ log = {
+-	info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging
+-	error = "prosody.err";
+-	-- "*syslog"; -- Uncomment this for logging to syslog
++	--info = "prosody.log"; -- Change 'info' to 'debug' for verbose logging
++	--error = "prosody.err";
++	"*syslog"; -- Uncomment this for logging to syslog
+ 	-- "*console"; -- Log to the console, useful for debugging with daemonize=false
+ }
+ 
diff --git a/packages/net-im/prosody/files/systemd/prosody.service b/packages/net-im/prosody/files/systemd/prosody.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Prosody XMPP server
+After=syslog.target
+
+[Service]
+Type=simple
+User=prosody
+Group=prosody
+ExecStart=/usr/bin/prosody
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packages/net-im/prosody/prosody-0.8.2.exheres-0 b/packages/net-im/prosody/prosody-0.8.2.exheres-0
@@ -0,0 +1,57 @@
+# Copyright 2011 Dan Callaghan <djc@djc.id.au>
+# Distributed under the terms of the GNU General Public License v2
+
+require systemd-service
+
+SUMMARY="Flexible, lightweight XMPP server written in Lua"
+DESCRIPTION="
+Prosody is a modern flexible communications server for Jabber/XMPP written in Lua. It aims to be 
+easy to set up and configure, and light on resources. For developers it aims to be easy to extend 
+and give a flexible system on which to rapidly develop added functionality, or prototype new 
+protocols.
+"
+HOMEPAGE="http://prosody.im/"
+DOWNLOADS="http://prosody.im/downloads/source/${PNV}.tar.gz"
+
+LICENCES="MIT"
+SLOT="0"
+PLATFORMS="~amd64 ~x86"
+
+DEPENDENCIES="
+    build+run:
+        dev-lang/lua[>=5.1]
+        dev-libs/openssl
+        net-dns/libidn
+        user/prosody
+        group/prosody
+    run:
+        dev-lua/luafilesystem[=1*]
+        dev-lua/luasocket[=2.0*]
+        dev-lua/luaexpat[=1.2*]
+    recommendation:
+        dev-lua/luasec[>=0.3.3] [[ description = [ This module is needed for SSL/TLS support. ] ]]
+    suggestion:
+        dev-lua/lua-zlib        [[ description = [ This module is used for compressing XMPP streams when mod_compression is enabled. ] ]]
+        dev-lua/luadbi[>=0.5]   [[ description = [ This module is used by mod_storage_sql for connecting to SQL databases. ] ]]
+"
+
+BUGS_TO="djc@djc.id.au"
+
+DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}/${PNV}-enable-posix.patch" )
+
+src_configure() {
+    # not real autoconf, so can't use econf
+    edo ./configure --prefix=/usr \
+            --sysconfdir=/etc/prosody \
+            --datadir=/var/lib/prosody \
+            --with-lua-include=/usr/include/lua5.1 \
+            --require-config
+}
+
+src_install() {
+    default
+    install_systemd_files
+    edo chown prosody:prosody "${IMAGE}/var/lib/prosody"
+    keepdir /var/lib/prosody
+}
+