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