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.

289 lines
8.7 KiB

  1. #
  2. # Copyright (C) 2009-2010 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:=znc
  9. PKG_VERSION:=1.4
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://znc.in/releases \
  13. http://znc.in/releases/archive
  14. PKG_MD5SUM:=630cb74db34d2d5451ba30b47869f6bb
  15. PKG_MAINTAINER:=Jonas Gorski <jogo@openwrt.org>
  16. PKG_LICENSE:=Apache-2.0
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_USE_MIPS16:=0
  19. PKG_BUILD_PARALLEL:=1
  20. define Package/znc/default
  21. SUBMENU:=Instant Messaging
  22. SECTION:=net
  23. CATEGORY:=Network
  24. TITLE:=ZNC
  25. URL:=http://en.znc.in/
  26. endef
  27. define Package/znc
  28. $(Package/znc/default)
  29. DEPENDS:=+libopenssl +libpthread +libstdcpp
  30. MENU:=1
  31. endef
  32. define Package/znc/description
  33. ZNC is an IRC bouncer with many advanced features like detaching,
  34. multiple users, per channel playback buffer, SSL, IPv6, transparent DCC
  35. bouncing, and c++ module support to name a few.
  36. endef
  37. define Package/znc/conffiles
  38. /etc/config/znc
  39. endef
  40. define Package/znc/install
  41. $(INSTALL_DIR) $(1)/usr/bin
  42. $(INSTALL_BIN) $(PKG_BUILD_DIR)/znc $(1)/usr/bin/
  43. $(INSTALL_DIR) $(1)/etc/init.d
  44. $(INSTALL_BIN) ./files/znc.init $(1)/etc/init.d/znc
  45. $(INSTALL_DIR) $(1)/etc/config
  46. $(INSTALL_DATA) ./files/znc.conf $(1)/etc/config/znc
  47. $(INSTALL_DIR) $(1)/usr/lib/znc/
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/droproot.so $(1)/usr/lib/znc/
  49. endef
  50. ZNC_MODULES :=
  51. ZNC_MODULE_TARGETS := droproot.so
  52. define module
  53. define Package/znc-mod-$(strip $(1))
  54. $(Package/znc/default)
  55. TITLE+= ($(strip $(1)) plugin)
  56. DEPENDS:=znc
  57. endef
  58. define Package/znc-mod-$(strip $(1))/description
  59. $(strip $(2))
  60. endef
  61. define Package/znc-mod-$(strip $(1))/install
  62. $(INSTALL_DIR) $$(1)/usr/lib/znc/
  63. $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/$(subst -,_,$(strip $(1))).so $$(1)/usr/lib/znc/
  64. # include webadmin page templates if existing
  65. if [ -d $$(PKG_BUILD_DIR)/modules/data/$(subst -,_,$(strip $(1))) ]; then \
  66. $(INSTALL_DIR) $$(1)/usr/share/znc/modules ;\
  67. $(CP) -r $$(PKG_BUILD_DIR)/modules/data/$(subst -,_,$(strip $(1))) $$(1)/usr/share/znc/modules ;\
  68. fi
  69. endef
  70. ZNC_MODULES += znc-mod-$(strip $(1))
  71. $(if $(CONFIG_PACKAGE_znc-mod-$(strip $(1))),ZNC_MODULE_TARGETS += $(subst -,_,$(strip $(1))).so)
  72. endef
  73. define webadmin
  74. define Package/znc-mod-webadmin
  75. $(Package/znc/default)
  76. TITLE+= (webadmin plugin)
  77. DEPENDS:=znc
  78. endef
  79. define Package/znc-mod-webadmin/description
  80. Allows you to add/remove/edit users and settings on the fly via a web browser.
  81. endef
  82. define Package/znc-mod-webadmin/install
  83. $(INSTALL_DIR) $$(1)/usr/lib/znc/
  84. $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/webadmin.so $$(1)/usr/lib/znc/
  85. $(INSTALL_DIR) $$(1)/usr/share/znc/modules
  86. $(CP) -r $$(PKG_BUILD_DIR)/modules/data/webadmin $$(1)/usr/share/znc/modules
  87. $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/
  88. $(CP) -r $$(PKG_BUILD_DIR)/webskins/_default_ $$(1)/usr/share/znc/webskins/
  89. endef
  90. ZNC_MODULES += znc-mod-webadmin
  91. $(if $(CONFIG_PACKAGE_znc-mod-webadmin),ZNC_MODULE_TARGETS += webadmin.so)
  92. endef
  93. define webskin
  94. define Package/znc-webskin-$(strip $(1))
  95. $(Package/znc/default)
  96. TITLE+= ($(strip $(1)) webskin)
  97. DEPENDS:=znc-mod-webadmin
  98. endef
  99. define Package/znc-webskin-$(strip $(1))/description
  100. $(strip $(1)) webskin for webadmin
  101. endef
  102. define Package/znc-webskin-$(strip $(1))/install
  103. $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/
  104. $(CP) -r $$(PKG_BUILD_DIR)/webskins/$(strip $(1)) $$(1)/usr/share/znc/webskins/
  105. endef
  106. ZNC_MODULES += znc-webskin-$(strip $(1))
  107. endef
  108. , := ,
  109. $(eval $(call module,adminlog,Log user connects and disconnects and failed \
  110. logins to file or syslog.))
  111. $(eval $(call module,autoattach,Reattaches you to channels on activity.))
  112. $(eval $(call module,autocycle,Cycles a channel when you are the only one in \
  113. there and you don't have op.))
  114. $(eval $(call module,autoop,Auto op the good guys.))
  115. $(eval $(call module,autoreply,Gives a automatic reply if someone messages you \
  116. if you are away.))
  117. $(eval $(call module,autovoice,Autovoices everyone who joins some channel.))
  118. $(eval $(call module,awaynick,Change your nick while you are away.))
  119. $(eval $(call module,awaystore,Stores messages while away$(,) also auto away.))
  120. $(eval $(call module,block-motd,This module blocks the server's Message of the \
  121. Day.))
  122. $(eval $(call module,blockuser,Blocks certain users from using ZNC saying \
  123. their account was disabled.))
  124. $(eval $(call module,bouncedcc,Bounces dcc transfers through the znc server \
  125. instead of sending them directly to the user.))
  126. $(eval $(call module,buffextras,Add nick changes$(,) joins$(,) parts$(,) topic \
  127. changes etc. to your playback buffer.))
  128. $(eval $(call module,cert,Use a SSL certificate for connecting to a server.))
  129. $(eval $(call module,certauth,This module allows users to log in to ZNC via \
  130. SSL client keys.))
  131. $(eval $(call module,chansaver,Keeping config up to date when user joins and \
  132. parts.))
  133. $(eval $(call module,clearbufferonmsg,This module keeps the buffer until the \
  134. next message from the client.))
  135. $(eval $(call module,clientnotify,Notify about new incoming connections to \
  136. your user.))
  137. $(eval $(call module,controlpanel,Allows you to add/remove/edit users and \
  138. settings on the fly via IRC messages.))
  139. $(eval $(call module,crypt,Encryption for channel/private messages.))
  140. $(eval $(call module,ctcpflood,This module tries to block ctcp floods.))
  141. $(eval $(call module,dcc,Allows you to transfer files to and from ZNC.))
  142. $(eval $(call module,disconkick,This module will kick your client from all \
  143. channels where you are$(,) in case if ZNC disconnects from server.))
  144. $(eval $(call module,fail2ban,Block IPs for some time after a failed login.))
  145. $(eval $(call module,flooddetach,This module detaches you from channels which \
  146. are flooded.))
  147. $(eval $(call module,identfile,Places the ident of a user to a file when they \
  148. are trying to connect.))
  149. $(eval $(call module,keepnick,Tries to get you your primary nick.))
  150. $(eval $(call module,kickrejoin,Implements auto-rejoin-on-kick.))
  151. $(eval $(call module,lastseen,Logs when a user last logged in to ZNC.))
  152. $(eval $(call module,listsockets,This module displays a list of all open \
  153. sockets in ZNC.))
  154. $(eval $(call module,log,Log conversations to file.))
  155. $(eval $(call module,modules_online,This module fakes the online status of \
  156. ZNC-*users.))
  157. $(eval $(call module,nickserv,Auths you with NickServ.))
  158. $(eval $(call module,notes,This modules stores and displays short notes using \
  159. a key/note pairs and shows them to you on connect.))
  160. $(eval $(call module,notify-connect,Sends a notice to all admins when a user \
  161. logs in or out.))
  162. $(eval $(call module,partyline,Allows ZNC users to join internal channels and \
  163. query other ZNC users on the same ZNC.))
  164. $(eval $(call module,perform,Performs commands on connect.))
  165. $(eval $(call module,q,Auths you with Q (and a little more).))
  166. $(eval $(call module,raw,View all of the raw traffic.))
  167. $(eval $(call module,route-replies,Routes back answers to the right client \
  168. when connected with multiple clients.))
  169. $(eval $(call module,sasl,The SASL module allows you to authenticate to an \
  170. IRC network via SASL.))
  171. $(eval $(call module,savebuff,Saves your channel buffers into an encrypted \
  172. file so they can survive restarts and reboots.))
  173. $(eval $(call module,schat,SSL (encrypted) DCC chats.))
  174. $(eval $(call module,send-raw,Allows you to send raw traffic to IRC from \
  175. other users.))
  176. $(eval $(call module,simple-away,This module will automatically set you away \
  177. on IRC while you are disconnected from the bouncer.))
  178. $(eval $(call module,shell,Have your unix shell in a query window right inside \
  179. of your IRC client.))
  180. $(eval $(call module,stickychan,Keeps you sticked to specific channels.))
  181. $(eval $(call module,watch,Monitor activity for specific text patterns from \
  182. specific users and have the text sent to a special query window.))
  183. $(eval $(call webadmin))
  184. $(eval $(call webskin,dark-clouds))
  185. $(eval $(call webskin,forest))
  186. $(eval $(call webskin,ice))
  187. PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
  188. include $(INCLUDE_DIR)/package.mk
  189. CONFIGURE_VARS += \
  190. CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \
  191. CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
  192. LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
  193. LIBS="-lstdc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
  194. CONFIGURE_ARGS += \
  195. --disable-c-ares \
  196. --disable-perl
  197. define Build/Configure
  198. $(call Build/Configure/Default,)
  199. $(call libtool_disable_rpath)
  200. endef
  201. define Build/Compile
  202. $(call Build/Compile/Default,znc)
  203. +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/modules \
  204. $(MAKE_FLAGS) $(ZNC_MODULE_TARGETS)
  205. endef
  206. $(eval $(call BuildPackage,znc))
  207. $(foreach m,$(ZNC_MODULES),$(eval $(call BuildPackage,$(m))))