1
0

Makefile 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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:=5
  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. 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 -fno-rtti" \
  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-ssl \
  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))))