You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.9 KiB

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