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.

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