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