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.

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