Browse Source

prosody: import from packages, add myself as the maintainer

This adds the prosody package from the old svn tree. Ive updated
the licensing information and will maintain the package in the
future. This request also updates prosdoy to the latest version 0.9.4.

Signed-off-by: Thomas Heil <heil@terminal-consulting.de>
Thomas Heil 10 years ago
parent
commit
7fbd2bd5ee
3 changed files with 342 additions and 0 deletions
  1. 117
    0
      net/prosody/Makefile
  2. 170
    0
      net/prosody/files/prosody.cfg.lua
  3. 55
    0
      net/prosody/files/prosody.init

+ 117
- 0
net/prosody/Makefile View File

@@ -0,0 +1,117 @@
1
+#
2
+# Copyright (C) 2009-2011 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=prosody
11
+PKG_VERSION:=0.9.4
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=http://prosody.im/downloads/source
16
+PKG_MD5SUM:=94f9a613c834c276352ac5b142fb72e0
17
+PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
18
+PKG_LICENSE:=MIT/X11
19
+
20
+PKG_INSTALL:=1
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+define Package/prosody
25
+  SECTION:=net
26
+  CATEGORY:=Network
27
+  SUBMENU:=Instant Messaging
28
+  DEPENDS:=+luafilesystem +libidn +luaexpat +luasec +libopenssl +libidn +liblua 
29
+  TITLE:=XMPP server
30
+  URL:=http://prosody.im/
31
+endef
32
+
33
+define Package/prosody/description
34
+  Prosody is an exciting new server for Jabber/XMPP
35
+  written in Lua. It aims to be easy to use, and light
36
+  on resources
37
+endef
38
+
39
+define Package/prosody/conffiles
40
+/etc/prosody/prosody.cfg.lua
41
+endef
42
+
43
+TARGET_CFLAGS += $(FPIC) 
44
+
45
+TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib 
46
+
47
+
48
+define Build/Configure
49
+	# this is *NOT* GNU autoconf stuff
50
+	(cd $(PKG_BUILD_DIR); ./configure \
51
+		--prefix=/usr \
52
+		--with-lua="$(STAGING_DIR)/host/bin" \
53
+		--with-lua-include="$(STAGING_DIR)/usr/include" \
54
+		--with-lua-lib="$(STAGING_DIR)/usr/lib" \
55
+		--cflags="$(TARGET_CFLAGS)" \
56
+		--ldflags="$(TARGET_LDFLAGS) -llua -lm -ldl -shared" \
57
+		--c-compiler="$(CC)" \
58
+		--linker="$(LD)" \
59
+		--datadir="/etc/prosody/data" \
60
+	)
61
+endef
62
+#	LDFLAGS="$(TARGET_LDFLAGS) -llua -lm -ldl" \
63
+
64
+MAKE_FLAGS += \
65
+	CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \
66
+	PREFIX="/usr" \
67
+
68
+define Package/prosody/install
69
+	$(INSTALL_DIR) $(1)/etc/init.d
70
+	$(INSTALL_BIN) ./files/prosody.init $(1)/etc/init.d/prosody
71
+	$(INSTALL_DIR) $(1)/etc/prosody
72
+	#$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/prosody/prosody.cfg.lua $(1)/etc/prosody/
73
+	$(INSTALL_CONF) ./files/prosody.cfg.lua $(1)/etc/prosody/
74
+	$(INSTALL_DIR) $(1)/etc/prosody/certs
75
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/prosody/certs/localhost.{crt,key} $(1)/etc/prosody/certs/
76
+	$(INSTALL_DIR) $(1)/etc/prosody/data
77
+	$(INSTALL_DIR) $(1)/usr/bin
78
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prosody{,ctl} $(1)/usr/bin/
79
+	$(INSTALL_DIR) $(1)/usr/lib/prosody
80
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/prosody.version $(1)/usr/lib/prosody/
81
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/core
82
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/core/*.lua $(1)/usr/lib/prosody/core/
83
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/fallbacks
84
+	#$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/fallbacks/*.lua $(1)/usr/lib/prosody/fallbacks/
85
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/modules
86
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/*.lua $(1)/usr/lib/prosody/modules/
87
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/modules/muc
88
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/muc/*.lua $(1)/usr/lib/prosody/modules/muc/
89
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/net
90
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/net/*.lua $(1)/usr/lib/prosody/net/
91
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/net/http
92
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/net/http/*.lua $(1)/usr/lib/prosody/net/http/
93
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/util
94
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/*.lua $(1)/usr/lib/prosody/util/
95
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/*.so $(1)/usr/lib/prosody/util/
96
+	$(INSTALL_DIR) $(1)/usr/lib/prosody/util/sasl
97
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/sasl/*.lua $(1)/usr/lib/prosody/util/sasl/
98
+	#$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/sasl/*.so $(1)/usr/lib/prosody/util/sasl/
99
+endef
100
+
101
+define Package/prosody/postinst
102
+#!/bin/sh
103
+[ -n "$${IPKG_INSTROOT}" ] || {
104
+	echo "Fixing lua with paxctl if needed!!!"
105
+	[ -f /sbin/paxctl ] && {
106
+		paxctl  -v /usr/bin/ > /dev/null  2>&1
107
+		[ $$? -ne 0 ] && {
108
+			cp /usr/bin/lua /tmp
109
+			paxctl -c -m /tmp/lua > /dev/null  2>&1 
110
+			cp -f /tmp/lua /usr/bin/lua
111
+		}
112
+	}
113
+	exit 0
114
+}
115
+endef
116
+
117
+$(eval $(call BuildPackage,prosody))

+ 170
- 0
net/prosody/files/prosody.cfg.lua View File

@@ -0,0 +1,170 @@
1
+-- Prosody Example Configuration File
2
+--
3
+-- Information on configuring Prosody can be found on our
4
+-- website at http://prosody.im/doc/configure
5
+--
6
+-- Tip: You can check that the syntax of this file is correct
7
+-- when you have finished by running: luac -p prosody.cfg.lua
8
+-- If there are any errors, it will let you know what and where
9
+-- they are, otherwise it will keep quiet.
10
+--
11
+-- The only thing left to do is rename this file to remove the .dist ending, and fill in the
12
+-- blanks. Good luck, and happy Jabbering!
13
+
14
+
15
+---------- Server-wide settings ----------
16
+-- Settings in this section apply to the whole server and are the default settings
17
+-- for any virtual hosts
18
+
19
+-- This is a (by default, empty) list of accounts that are admins
20
+-- for the server. Note that you must create the accounts separately
21
+-- (see http://prosody.im/doc/creating_accounts for info)
22
+-- Example: admins = { "user1@example.com", "user2@example.net" }
23
+admins = { }
24
+
25
+-- Enable use of libevent for better performance under high load
26
+-- For more information see: http://prosody.im/doc/libevent
27
+--use_libevent = true;
28
+
29
+-- This is the list of modules Prosody will load on startup.
30
+-- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
31
+-- Documentation on modules can be found at: http://prosody.im/doc/modules
32
+modules_enabled = {
33
+
34
+	-- Generally required
35
+		"roster"; -- Allow users to have a roster. Recommended ;)
36
+		"saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
37
+		"tls"; -- Add support for secure TLS on c2s/s2s connections
38
+		"dialback"; -- s2s dialback support
39
+		"disco"; -- Service discovery
40
+
41
+	-- Not essential, but recommended
42
+		"private"; -- Private XML storage (for room bookmarks, etc.)
43
+		"vcard"; -- Allow users to set vCards
44
+		--"privacy"; -- Support privacy lists
45
+		--"compression"; -- Stream compression
46
+
47
+	-- Nice to have
48
+		"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
49
+		"version"; -- Replies to server version requests
50
+		"uptime"; -- Report how long server has been running
51
+		"time"; -- Let others know the time here on this server
52
+		"ping"; -- Replies to XMPP pings with pongs
53
+		"pep"; -- Enables users to publish their mood, activity, playing music and more
54
+		"register"; -- Allow users to register on this server using a client and change passwords
55
+		"adhoc"; -- Support for "ad-hoc commands" that can be executed with an XMPP client
56
+
57
+	-- Admin interfaces
58
+		"admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
59
+		--"admin_telnet"; -- Opens telnet console interface on localhost port 5582
60
+
61
+	-- Other specific functionality
62
+		"posix"; -- POSIX functionality, sends server to background, enables syslog, etc.
63
+		--"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
64
+		--"httpserver"; -- Serve static files from a directory over HTTP
65
+		--"groups"; -- Shared roster support
66
+		--"announce"; -- Send announcement to all online users
67
+		--"welcome"; -- Welcome users who register accounts
68
+		--"watchregistrations"; -- Alert admins of registrations
69
+		--"motd"; -- Send a message to users when they log in
70
+};
71
+
72
+-- These modules are auto-loaded, should you
73
+-- (for some mad reason) want to disable
74
+-- them then uncomment them below
75
+modules_disabled = {
76
+	-- "presence"; -- Route user/contact status information
77
+	-- "message"; -- Route messages
78
+	-- "iq"; -- Route info queries
79
+	-- "offline"; -- Store offline messages
80
+};
81
+
82
+-- Disable account creation by default, for security
83
+-- For more information see http://prosody.im/doc/creating_accounts
84
+allow_registration = false;
85
+
86
+-- Only allow encrypted streams? Encryption is already used when
87
+-- available. These options will cause Prosody to deny connections that
88
+-- are not encrypted. Note that some servers do not support s2s
89
+-- encryption or have it disabled, including gmail.com and Google Apps
90
+-- domains.
91
+
92
+--c2s_require_encryption = false
93
+--s2s_require_encryption = false
94
+
95
+-- Select the authentication backend to use. The 'internal' providers
96
+-- use Prosody's configured data storage to store the authentication data.
97
+-- To allow Prosody to offer secure authentication mechanisms to clients, the
98
+-- default provider stores passwords in plaintext. If you do not trust your
99
+-- server please see http://prosody.im/doc/modules/mod_auth_internal_hashed
100
+-- for information about using the hashed backend.
101
+-- See http://prosody.im/doc/authentication for other possibilities including
102
+-- Cyrus SASL.
103
+
104
+authentication = "internal_plain"
105
+
106
+-- Select the storage backend to use. By default Prosody uses flat files
107
+-- in its configured data directory, but it also supports more backends
108
+-- through modules. An "sql" backend is included by default, but requires
109
+-- additional dependencies. See http://prosody.im/doc/storage for more info.
110
+
111
+--storage = "sql" -- Default is "internal"
112
+
113
+-- For the "sql" backend, you can uncomment *one* of the below to configure:
114
+--sql = { driver = "SQLite3", database = "prosody.sqlite" } -- Default. 'database' is the filename.
115
+--sql = { driver = "MySQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
116
+--sql = { driver = "PostgreSQL", database = "prosody", username = "prosody", password = "secret", host = "localhost" }
117
+
118
+-- Logging configuration
119
+-- For advanced logging see http://prosody.im/doc/logging
120
+log = {
121
+	info = "/var/log/prosody/prosody.log"; -- Change 'info' to 'debug' for verbose logging
122
+	error = "/var/log/prosody/prosody.err";
123
+	-- "*syslog"; -- Uncomment this for logging to syslog; needs mod_posix
124
+	-- "*console"; -- Log to the console, useful for debugging with daemonize=false
125
+}
126
+
127
+-- Pidfile, used by prosodyctl and the init.d script
128
+pidfile = "/var/run/prosody/prosody.pid"
129
+
130
+-- User and group, used for daemon
131
+prosody_user = "prosody"
132
+prosody_group = "prosody"
133
+
134
+----------- Virtual hosts -----------
135
+-- You need to add a VirtualHost entry for each domain you wish Prosody to serve.
136
+-- Settings under each VirtualHost entry apply *only* to that host.
137
+
138
+VirtualHost "localhost"
139
+
140
+VirtualHost "example.com"
141
+	enabled = false -- Remove this line to enable this host
142
+
143
+	-- Assign this host a certificate for TLS, otherwise it would use the one
144
+	-- set in the global section (if any).
145
+	-- Note that old-style SSL on port 5223 only supports one certificate, and will always
146
+	-- use the global one.
147
+	ssl = {
148
+		key = "/etc/prosody/certs/example.com.key";
149
+		certificate = "/etc/prosody/certs/example.com.crt";
150
+	}
151
+
152
+------ Components ------
153
+-- You can specify components to add hosts that provide special services,
154
+-- like multi-user conferences, and transports.
155
+-- For more information on components, see http://prosody.im/doc/components
156
+
157
+---Set up a MUC (multi-user chat) room server on conference.example.com:
158
+--Component "conference.example.com" "muc"
159
+
160
+-- Set up a SOCKS5 bytestream proxy for server-proxied file transfers:
161
+--Component "proxy.example.com" "proxy65"
162
+
163
+---Set up an external component (default component port is 5347)
164
+--
165
+-- External components allow adding various services, such as gateways/
166
+-- transports to other networks like ICQ, MSN and Yahoo. For more info
167
+-- see: http://prosody.im/doc/components#adding_an_external_component
168
+--
169
+--Component "gateway.example.com"
170
+--	component_secret = "password"

+ 55
- 0
net/prosody/files/prosody.init View File

@@ -0,0 +1,55 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2010-2011 OpenWrt.org
3
+
4
+START=99
5
+
6
+EXTRA_COMMANDS="status"
7
+EXTRA_HELP="	status	Print the status of the service"
8
+
9
+BIN=/usr/bin/prosodyctl
10
+LOG_D=/var/log/prosody
11
+RUN_D=/var/run/prosody
12
+PID_F=$RUN_D/prosody.pid
13
+RUN_USER=prosody
14
+RUN_GROUP=prosody
15
+
16
+start() {
17
+	user_exists prosody 54 || user_add prosody 54
18
+	group_exists prosody 54 || group_add prosody 54
19
+	[ -d /var/run/prosody ] || {
20
+		mkdir -m 0755 -p /var/run/prosody
21
+		chown prosody:prosody /var/run/prosody
22
+	}
23
+	[ -d /var/log/prosody ] || {
24
+		mkdir -m 0755 -p /var/log/prosody
25
+		chown prosody:prosody /var/log/prosody
26
+	}
27
+
28
+	[ -d /var/log/prosody ] && {
29
+		chown -R prosody:prosody /etc/prosody
30
+	}
31
+
32
+	[ -f /sbin/paxctl ] && {
33
+		paxctl  -v /usr/bin/ > /dev/null  2>&1	
34
+		[ $? -ne 0 ] && {
35
+			cp /usr/bin/lua /tmp
36
+			paxctl -c -m /tmp/lua
37
+			cp -f /tmp/lua /usr/bin/lua
38
+		}
39
+	}
40
+
41
+	
42
+	$BIN start
43
+}
44
+
45
+stop() {
46
+	$BIN stop
47
+}
48
+
49
+reload() {
50
+	[ -f $PID_F ] && kill -HUP $(cat $PID_F)
51
+}
52
+
53
+status() {
54
+	$BIN status
55
+}