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.

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