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.

313 lines
9.3 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.7.1
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://znc.in/releases \
  13. https://znc.in/releases/archive
  14. PKG_HASH:=44cfea7158ea05dc2547c7c6bc22371e66c869def90351de0ab90a9c200d39c4
  15. PKG_MAINTAINER:=Jonas Gorski <jonas.gorski@gmail.com>
  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:=https://znc.in/
  27. USERID:=znc:znc
  28. endef
  29. define Package/znc
  30. $(Package/znc/default)
  31. DEPENDS:=+libopenssl +libpthread +libstdcpp +ZNC_ICU:icu +zlib
  32. MENU:=1
  33. endef
  34. define Package/znc/description
  35. ZNC is an IRC bouncer with many advanced features like detaching,
  36. multiple users, per channel playback buffer, SSL, IPv6, transparent DCC
  37. bouncing, and c++ module support to name a few.
  38. endef
  39. define Package/znc/config
  40. source "$(SOURCE)/Config.in"
  41. endef
  42. define Package/znc/conffiles
  43. /etc/config/znc
  44. endef
  45. define Package/znc/install
  46. $(INSTALL_DIR) $(1)/usr/bin
  47. $(INSTALL_BIN) $(PKG_BUILD_DIR)/znc $(1)/usr/bin/
  48. $(INSTALL_DIR) $(1)/etc/init.d
  49. $(INSTALL_BIN) ./files/znc.init $(1)/etc/init.d/znc
  50. $(INSTALL_DIR) $(1)/etc/config
  51. $(INSTALL_DATA) ./files/znc.conf $(1)/etc/config/znc
  52. $(INSTALL_DIR) $(1)/usr/lib/znc/
  53. endef
  54. ZNC_MODULES :=
  55. ZNC_MODULE_TARGETS :=
  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,playback,Avoid repetitive playback buffers on re-connect \
  173. with supported clients (e.g. mutter, colluquy)))
  174. $(eval $(call module,q,Auths you with Q (and a little more).))
  175. $(eval $(call module,raw,View all of the raw traffic.))
  176. $(eval $(call module,route-replies,Routes back answers to the right client \
  177. when connected with multiple clients.))
  178. $(eval $(call module,sasl,The SASL module allows you to authenticate to an \
  179. IRC network via SASL.))
  180. $(eval $(call module,savebuff,Saves your channel buffers into an encrypted \
  181. file so they can survive restarts and reboots.))
  182. $(eval $(call module,schat,SSL (encrypted) DCC chats.))
  183. $(eval $(call module,send-raw,Allows you to send raw traffic to IRC from \
  184. other users.))
  185. $(eval $(call module,simple-away,This module will automatically set you away \
  186. on IRC while you are disconnected from the bouncer.))
  187. $(eval $(call module,shell,Have your unix shell in a query window right inside \
  188. of your IRC client.))
  189. $(eval $(call module,stickychan,Keeps you sticked to specific channels.))
  190. $(eval $(call module,watch,Monitor activity for specific text patterns from \
  191. specific users and have the text sent to a special query window.))
  192. $(eval $(call webadmin))
  193. $(eval $(call webskin,dark-clouds))
  194. $(eval $(call webskin,forest))
  195. $(eval $(call webskin,ice))
  196. PKG_CONFIG_DEPENDS += $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
  197. include $(INCLUDE_DIR)/package.mk
  198. CONFIGURE_VARS += \
  199. CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin" \
  200. CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
  201. LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
  202. LIBS="-lstdc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
  203. CONFIGURE_ARGS += \
  204. $(if $(CONFIG_ZNC_ICU), --enable-charset, --disable-charset) \
  205. --disable-cyrus \
  206. --disable-debug \
  207. --enable-largefile \
  208. --disable-perl \
  209. --enable-poll \
  210. --disable-python \
  211. --enable-openssl \
  212. --disable-swig \
  213. --disable-tcl \
  214. --enable-tdns \
  215. --enable-zlib
  216. define Build/Configure
  217. $(call Build/Configure/Default,)
  218. $(call libtool_disable_rpath)
  219. endef
  220. define Build/Compile
  221. $(call Build/Compile/Default,znc)
  222. +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/modules \
  223. $(MAKE_FLAGS) $(ZNC_MODULE_TARGETS)
  224. endef
  225. $(eval $(call BuildPackage,znc))
  226. $(foreach m,$(ZNC_MODULES),$(eval $(call BuildPackage,$(m))))