Merge pull request #840 from cjkoenig/update_liburcu
[feed/packages.git] / net / znc / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=znc
11 PKG_VERSION:=1.4
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://znc.in/releases \
16 http://znc.in/releases/archive
17 PKG_MD5SUM:=630cb74db34d2d5451ba30b47869f6bb
18
19 PKG_MAINTAINER:=Jonas Gorski <jogo@openwrt.org>
20 PKG_LICENSE:=Apache-2.0
21 PKG_LICENSE_FILES:=LICENSE
22
23 PKG_BUILD_PARALLEL:=1
24
25
26 define Package/znc/default
27 SUBMENU:=Instant Messaging
28 SECTION:=net
29 CATEGORY:=Network
30 TITLE:=ZNC
31 URL:=http://en.znc.in/
32 endef
33
34 define Package/znc
35 $(Package/znc/default)
36 DEPENDS:=+libopenssl +libpthread +libstdcpp
37 MENU:=1
38 endef
39
40 define Package/znc/description
41 ZNC is an IRC bouncer with many advanced features like detaching,
42 multiple users, per channel playback buffer, SSL, IPv6, transparent DCC
43 bouncing, and c++ module support to name a few.
44 endef
45
46 define Package/znc/conffiles
47 /etc/config/znc
48 endef
49
50
51 define Package/znc/install
52 $(INSTALL_DIR) $(1)/usr/bin
53 $(INSTALL_BIN) $(PKG_BUILD_DIR)/znc $(1)/usr/bin/
54 $(INSTALL_DIR) $(1)/etc/init.d
55 $(INSTALL_BIN) ./files/znc.init $(1)/etc/init.d/znc
56 $(INSTALL_DIR) $(1)/etc/config
57 $(INSTALL_DATA) ./files/znc.conf $(1)/etc/config/znc
58 $(INSTALL_DIR) $(1)/usr/lib/znc/
59 $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/droproot.so $(1)/usr/lib/znc/
60 endef
61
62
63 ZNC_MODULES :=
64 ZNC_MODULE_TARGETS := droproot.so
65
66 define module
67 define Package/znc-mod-$(strip $(1))
68 $(Package/znc/default)
69 TITLE+= ($(strip $(1)) plugin)
70 DEPENDS:=znc
71 endef
72
73 define Package/znc-mod-$(strip $(1))/description
74 $(strip $(2))
75 endef
76
77 define Package/znc-mod-$(strip $(1))/install
78 $(INSTALL_DIR) $$(1)/usr/lib/znc/
79 $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/$(subst -,_,$(strip $(1))).so $$(1)/usr/lib/znc/
80 # include webadmin page templates if existing
81 if [ -d $$(PKG_BUILD_DIR)/modules/data/$(subst -,_,$(strip $(1))) ]; then \
82 $(INSTALL_DIR) $$(1)/usr/share/znc/modules ;\
83 $(CP) -r $$(PKG_BUILD_DIR)/modules/data/$(subst -,_,$(strip $(1))) $$(1)/usr/share/znc/modules ;\
84 fi
85 endef
86
87 ZNC_MODULES += znc-mod-$(strip $(1))
88 $(if $(CONFIG_PACKAGE_znc-mod-$(strip $(1))),ZNC_MODULE_TARGETS += $(subst -,_,$(strip $(1))).so)
89 endef
90
91 define webadmin
92 define Package/znc-mod-webadmin
93 $(Package/znc/default)
94 TITLE+= (webadmin plugin)
95 DEPENDS:=znc
96 endef
97
98 define Package/znc-mod-webadmin/description
99 Allows you to add/remove/edit users and settings on the fly via a web browser.
100 endef
101
102 define Package/znc-mod-webadmin/install
103 $(INSTALL_DIR) $$(1)/usr/lib/znc/
104 $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/webadmin.so $$(1)/usr/lib/znc/
105 $(INSTALL_DIR) $$(1)/usr/share/znc/modules
106 $(CP) -r $$(PKG_BUILD_DIR)/modules/data/webadmin $$(1)/usr/share/znc/modules
107 $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/
108 $(CP) -r $$(PKG_BUILD_DIR)/webskins/_default_ $$(1)/usr/share/znc/webskins/
109 endef
110
111 ZNC_MODULES += znc-mod-webadmin
112 $(if $(CONFIG_PACKAGE_znc-mod-webadmin),ZNC_MODULE_TARGETS += webadmin.so)
113 endef
114
115 define webskin
116 define Package/znc-webskin-$(strip $(1))
117 $(Package/znc/default)
118 TITLE+= ($(strip $(1)) webskin)
119 DEPENDS:=znc-mod-webadmin
120 endef
121
122 define Package/znc-webskin-$(strip $(1))/description
123 $(strip $(1)) webskin for webadmin
124 endef
125
126 define Package/znc-webskin-$(strip $(1))/install
127 $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/
128 $(CP) -r $$(PKG_BUILD_DIR)/webskins/$(strip $(1)) $$(1)/usr/share/znc/webskins/
129 endef
130 ZNC_MODULES += znc-webskin-$(strip $(1))
131 endef
132
133 , := ,
134
135 $(eval $(call module,adminlog,Log user connects and disconnects and failed \
136 logins to file or syslog.))
137
138 $(eval $(call module,autoattach,Reattaches you to channels on activity.))
139
140 $(eval $(call module,autocycle,Cycles a channel when you are the only one in \
141 there and you don't have op.))
142
143 $(eval $(call module,autoop,Auto op the good guys.))
144
145 $(eval $(call module,autoreply,Gives a automatic reply if someone messages you \
146 if you are away.))
147
148 $(eval $(call module,autovoice,Autovoices everyone who joins some channel.))
149
150 $(eval $(call module,awaynick,Change your nick while you are away.))
151
152 $(eval $(call module,awaystore,Stores messages while away$(,) also auto away.))
153
154 $(eval $(call module,block-motd,This module blocks the server's Message of the \
155 Day.))
156
157 $(eval $(call module,blockuser,Blocks certain users from using ZNC saying \
158 their account was disabled.))
159
160 $(eval $(call module,bouncedcc,Bounces dcc transfers through the znc server \
161 instead of sending them directly to the user.))
162
163 $(eval $(call module,buffextras,Add nick changes$(,) joins$(,) parts$(,) topic \
164 changes etc. to your playback buffer.))
165
166 $(eval $(call module,cert,Use a SSL certificate for connecting to a server.))
167
168 $(eval $(call module,certauth,This module allows users to log in to ZNC via \
169 SSL client keys.))
170
171 $(eval $(call module,chansaver,Keeping config up to date when user joins and \
172 parts.))
173
174 $(eval $(call module,clearbufferonmsg,This module keeps the buffer until the \
175 next message from the client.))
176
177 $(eval $(call module,clientnotify,Notify about new incoming connections to \
178 your user.))
179
180 $(eval $(call module,controlpanel,Allows you to add/remove/edit users and \
181 settings on the fly via IRC messages.))
182
183 $(eval $(call module,crypt,Encryption for channel/private messages.))
184
185 $(eval $(call module,ctcpflood,This module tries to block ctcp floods.))
186
187 $(eval $(call module,dcc,Allows you to transfer files to and from ZNC.))
188
189 $(eval $(call module,disconkick,This module will kick your client from all \
190 channels where you are$(,) in case if ZNC disconnects from server.))
191
192 $(eval $(call module,fail2ban,Block IPs for some time after a failed login.))
193
194 $(eval $(call module,flooddetach,This module detaches you from channels which \
195 are flooded.))
196
197 $(eval $(call module,identfile,Places the ident of a user to a file when they \
198 are trying to connect.))
199
200 $(eval $(call module,keepnick,Tries to get you your primary nick.))
201
202 $(eval $(call module,kickrejoin,Implements auto-rejoin-on-kick.))
203
204 $(eval $(call module,lastseen,Logs when a user last logged in to ZNC.))
205
206 $(eval $(call module,listsockets,This module displays a list of all open \
207 sockets in ZNC.))
208
209 $(eval $(call module,log,Log conversations to file.))
210
211 $(eval $(call module,modules_online,This module fakes the online status of \
212 ZNC-*users.))
213
214 $(eval $(call module,nickserv,Auths you with NickServ.))
215
216 $(eval $(call module,notes,This modules stores and displays short notes using \
217 a key/note pairs and shows them to you on connect.))
218
219 $(eval $(call module,notify-connect,Sends a notice to all admins when a user \
220 logs in or out.))
221
222 $(eval $(call module,partyline,Allows ZNC users to join internal channels and \
223 query other ZNC users on the same ZNC.))
224
225 $(eval $(call module,perform,Performs commands on connect.))
226
227 $(eval $(call module,q,Auths you with Q (and a little more).))
228
229 $(eval $(call module,raw,View all of the raw traffic.))
230
231 $(eval $(call module,route-replies,Routes back answers to the right client \
232 when connected with multiple clients.))
233
234 $(eval $(call module,sasl,The SASL module allows you to authenticate to an \
235 IRC network via SASL.))
236
237 $(eval $(call module,savebuff,Saves your channel buffers into an encrypted \
238 file so they can survive restarts and reboots.))
239
240 $(eval $(call module,schat,SSL (encrypted) DCC chats.))
241
242 $(eval $(call module,send-raw,Allows you to send raw traffic to IRC from \
243 other users.))
244
245 $(eval $(call module,simple-away,This module will automatically set you away \
246 on IRC while you are disconnected from the bouncer.))
247
248 $(eval $(call module,shell,Have your unix shell in a query window right inside \
249 of your IRC client.))
250
251 $(eval $(call module,stickychan,Keeps you sticked to specific channels.))
252
253 $(eval $(call module,watch,Monitor activity for specific text patterns from \
254 specific users and have the text sent to a special query window.))
255
256 $(eval $(call webadmin))
257
258 $(eval $(call webskin,dark-clouds))
259 $(eval $(call webskin,forest))
260 $(eval $(call webskin,ice))
261
262 PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
263
264 include $(INCLUDE_DIR)/package.mk
265
266 CONFIGURE_VARS += \
267 CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \
268 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
269 LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
270 LIBS="-lstdc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
271
272 CONFIGURE_ARGS += \
273 --disable-c-ares \
274 --disable-perl
275
276 define Build/Configure
277 $(call Build/Configure/Default,)
278 $(call libtool_disable_rpath)
279 endef
280
281 define Build/Compile
282 $(call Build/Compile/Default,znc)
283 +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/modules \
284 $(MAKE_FLAGS) $(ZNC_MODULE_TARGETS)
285 endef
286
287 $(eval $(call BuildPackage,znc))
288 $(foreach m,$(ZNC_MODULES),$(eval $(call BuildPackage,$(m))))