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.

295 lines
9.0 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.1
  10. PKG_RELEASE:=1
  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:=8e29289e6229b6d2473de202170745ab
  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 @GCC_VERSION_4_8||GCC_VERSION_4_9
  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,alias,Provides bouncer-side command alias support.))
  112. $(eval $(call module,autoattach,Reattaches you to channels on activity.))
  113. $(eval $(call module,autocycle,Cycles a channel when you are the only one in \
  114. there and you don't have op.))
  115. $(eval $(call module,autoop,Auto op the good guys.))
  116. $(eval $(call module,autoreply,Gives a automatic reply if someone messages you \
  117. if you are away.))
  118. $(eval $(call module,autovoice,Autovoices everyone who joins some channel.))
  119. $(eval $(call module,awaynick,Change your nick while you are away.))
  120. $(eval $(call module,awaystore,Stores messages while away$(,) also auto away.))
  121. $(eval $(call module,block-motd,This module blocks the server's Message of the \
  122. Day.))
  123. $(eval $(call module,blockuser,Blocks certain users from using ZNC saying \
  124. their account was disabled.))
  125. $(eval $(call module,bouncedcc,Bounces dcc transfers through the znc server \
  126. instead of sending them directly to the user.))
  127. $(eval $(call module,buffextras,Add nick changes$(,) joins$(,) parts$(,) topic \
  128. changes etc. to your playback buffer.))
  129. $(eval $(call module,cert,Use a SSL certificate for connecting to a server.))
  130. $(eval $(call module,certauth,This module allows users to log in to ZNC via \
  131. SSL client keys.))
  132. $(eval $(call module,chansaver,Keeping config up to date when user joins and \
  133. parts.))
  134. $(eval $(call module,clearbufferonmsg,This module keeps the buffer until the \
  135. next message from the client.))
  136. $(eval $(call module,clientnotify,Notify about new incoming connections to \
  137. your user.))
  138. $(eval $(call module,controlpanel,Allows you to add/remove/edit users and \
  139. settings on the fly via IRC messages.))
  140. $(eval $(call module,crypt,Encryption for channel/private messages.))
  141. $(eval $(call module,ctcpflood,This module tries to block ctcp floods.))
  142. $(eval $(call module,dcc,Allows you to transfer files to and from ZNC.))
  143. $(eval $(call module,disconkick,This module will kick your client from all \
  144. channels where you are$(,) in case if ZNC disconnects from server.))
  145. $(eval $(call module,fail2ban,Block IPs for some time after a failed login.))
  146. $(eval $(call module,flooddetach,This module detaches you from channels which \
  147. are flooded.))
  148. $(eval $(call module,identfile,Places the ident of a user to a file when they \
  149. are trying to connect.))
  150. $(eval $(call module,imapauth,Allow users to authenticate via IMAP.))
  151. $(eval $(call module,keepnick,Tries to get you your primary nick.))
  152. $(eval $(call module,kickrejoin,Implements auto-rejoin-on-kick.))
  153. $(eval $(call module,lastseen,Logs when a user last logged in to ZNC.))
  154. $(eval $(call module,listsockets,This module displays a list of all open \
  155. sockets in ZNC.))
  156. $(eval $(call module,log,Log conversations to file.))
  157. $(eval $(call module,missingmotd,Sends 422 to clients when they login.))
  158. $(eval $(call module,modules_online,This module fakes the online status of \
  159. ZNC-*users.))
  160. $(eval $(call module,nickserv,Auths you with NickServ.))
  161. $(eval $(call module,notes,This modules stores and displays short notes using \
  162. a key/note pairs and shows them to you on connect.))
  163. $(eval $(call module,notify-connect,Sends a notice to all admins when a user \
  164. logs in or out.))
  165. $(eval $(call module,partyline,Allows ZNC users to join internal channels and \
  166. query other ZNC users on the same ZNC.))
  167. $(eval $(call module,perform,Performs commands on connect.))
  168. $(eval $(call module,q,Auths you with Q (and a little more).))
  169. $(eval $(call module,raw,View all of the raw traffic.))
  170. $(eval $(call module,route-replies,Routes back answers to the right client \
  171. when connected with multiple clients.))
  172. $(eval $(call module,sasl,The SASL module allows you to authenticate to an \
  173. IRC network via SASL.))
  174. $(eval $(call module,savebuff,Saves your channel buffers into an encrypted \
  175. file so they can survive restarts and reboots.))
  176. $(eval $(call module,schat,SSL (encrypted) DCC chats.))
  177. $(eval $(call module,send-raw,Allows you to send raw traffic to IRC from \
  178. other users.))
  179. $(eval $(call module,simple-away,This module will automatically set you away \
  180. on IRC while you are disconnected from the bouncer.))
  181. $(eval $(call module,shell,Have your unix shell in a query window right inside \
  182. of your IRC client.))
  183. $(eval $(call module,stickychan,Keeps you sticked to specific channels.))
  184. $(eval $(call module,watch,Monitor activity for specific text patterns from \
  185. specific users and have the text sent to a special query window.))
  186. $(eval $(call webadmin))
  187. $(eval $(call webskin,dark-clouds))
  188. $(eval $(call webskin,forest))
  189. $(eval $(call webskin,ice))
  190. PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
  191. include $(INCLUDE_DIR)/package.mk
  192. CONFIGURE_VARS += \
  193. CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \
  194. CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
  195. LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
  196. LIBS="-lstdc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
  197. CONFIGURE_ARGS += \
  198. --disable-c-ares \
  199. --disable-perl
  200. define Build/Configure
  201. $(call Build/Configure/Default,)
  202. $(call libtool_disable_rpath)
  203. endef
  204. define Build/Compile
  205. $(call Build/Compile/Default,znc)
  206. +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/modules \
  207. $(MAKE_FLAGS) $(ZNC_MODULE_TARGETS)
  208. endef
  209. $(eval $(call BuildPackage,znc))
  210. $(foreach m,$(ZNC_MODULES),$(eval $(call BuildPackage,$(m))))