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.

124 lines
4.4 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:=2
  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. USERID:=prosody=54:prosody=54
  26. endef
  27. define Package/prosody/description
  28. Prosody is an exciting new server for Jabber/XMPP
  29. written in Lua. It aims to be easy to use, and light
  30. on resources
  31. endef
  32. define Package/prosody/conffiles
  33. /etc/prosody/prosody.cfg.lua
  34. endef
  35. TARGET_CFLAGS += $(FPIC)
  36. TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
  37. define Build/Configure
  38. # this is *NOT* GNU autoconf stuff
  39. (cd $(PKG_BUILD_DIR); ./configure \
  40. --prefix=/usr \
  41. --with-lua="$(STAGING_DIR)/host/bin" \
  42. --with-lua-include="$(STAGING_DIR)/usr/include" \
  43. --with-lua-lib="$(STAGING_DIR)/usr/lib" \
  44. --cflags="$(TARGET_CFLAGS)" \
  45. --ldflags="$(TARGET_LDFLAGS) -llua -lm -ldl -shared" \
  46. --c-compiler="$(CC)" \
  47. --linker="$(LD)" \
  48. --datadir="/etc/prosody/data" \
  49. )
  50. endef
  51. # LDFLAGS="$(TARGET_LDFLAGS) -llua -lm -ldl" \
  52. MAKE_FLAGS += \
  53. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -std=gnu99" \
  54. PREFIX="/usr" \
  55. define Package/prosody/install
  56. $(INSTALL_DIR) $(1)/etc/init.d
  57. $(INSTALL_BIN) ./files/prosody.init $(1)/etc/init.d/prosody
  58. $(INSTALL_DIR) $(1)/etc/prosody
  59. #$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/prosody/prosody.cfg.lua $(1)/etc/prosody/
  60. $(INSTALL_CONF) ./files/prosody.cfg.lua $(1)/etc/prosody/
  61. $(INSTALL_DIR) $(1)/etc/prosody/certs
  62. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/prosody/certs/localhost.{crt,key} $(1)/etc/prosody/certs/
  63. $(INSTALL_DIR) $(1)/etc/prosody/data
  64. $(INSTALL_DIR) $(1)/usr/bin
  65. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prosody{,ctl} $(1)/usr/bin/
  66. $(INSTALL_DIR) $(1)/usr/lib/prosody
  67. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/prosody.version $(1)/usr/lib/prosody/
  68. $(INSTALL_DIR) $(1)/usr/lib/prosody/core
  69. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/core/*.lua $(1)/usr/lib/prosody/core/
  70. $(INSTALL_DIR) $(1)/usr/lib/prosody/fallbacks
  71. #$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/fallbacks/*.lua $(1)/usr/lib/prosody/fallbacks/
  72. $(INSTALL_DIR) $(1)/usr/lib/prosody/modules
  73. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/*.lua $(1)/usr/lib/prosody/modules/
  74. $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/adhoc
  75. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/adhoc/*.lua $(1)/usr/lib/prosody/modules/adhoc/
  76. $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/mod_s2s
  77. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/mod_s2s/*.lua $(1)/usr/lib/prosody/modules/mod_s2s/
  78. $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/muc
  79. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/muc/*.lua $(1)/usr/lib/prosody/modules/muc/
  80. $(INSTALL_DIR) $(1)/usr/lib/prosody/modules/storage
  81. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/modules/storage/*.lua $(1)/usr/lib/prosody/modules/storage/
  82. $(INSTALL_DIR) $(1)/usr/lib/prosody/net
  83. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/net/*.lua $(1)/usr/lib/prosody/net/
  84. $(INSTALL_DIR) $(1)/usr/lib/prosody/net/http
  85. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/net/http/*.lua $(1)/usr/lib/prosody/net/http/
  86. $(INSTALL_DIR) $(1)/usr/lib/prosody/util
  87. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/*.lua $(1)/usr/lib/prosody/util/
  88. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/*.so $(1)/usr/lib/prosody/util/
  89. $(INSTALL_DIR) $(1)/usr/lib/prosody/util/sasl
  90. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/sasl/*.lua $(1)/usr/lib/prosody/util/sasl/
  91. #$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/prosody/util/sasl/*.so $(1)/usr/lib/prosody/util/sasl/
  92. endef
  93. define Package/prosody/postinst
  94. #!/bin/sh
  95. [ -n "$${IPKG_INSTROOT}" ] || {
  96. echo "Fixing lua with paxctl if needed!!!"
  97. [ -f /sbin/paxctl ] && {
  98. paxctl -v /usr/bin/ > /dev/null 2>&1
  99. [ $$? -ne 0 ] && {
  100. cp /usr/bin/lua /tmp
  101. paxctl -c -m /tmp/lua > /dev/null 2>&1
  102. cp -f /tmp/lua /usr/bin/lua
  103. }
  104. }
  105. exit 0
  106. }
  107. endef
  108. $(eval $(call BuildPackage,prosody))