source: packages/net/znc/Makefile @ 26722

Last change on this file since 26722 was 26722, checked in by jogo, 6 years ago

ZNC: Fix webadmin, allow external config and minor fixes

  • Fix the webadmin module and add the themes
  • Allow providing ZNC an external config (closes #9110)
  • Allow specifying the user and group to run ZNC as (needs su when using external config)
  • Allow providing a certificate for incoming SSL connections
  • Reduce buildtime by not rebuilding everything everytime

Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@…>

File size: 8.7 KB
Line 
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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=znc
11PKG_VERSION:=0.098
12PKG_RELEASE:=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=http://znc.in/releases
16PKG_MD5SUM:=5667b4acb1f01309d6eded77abac700c
17
18PKG_BUILD_PARALLEL:=1
19
20
21define Package/znc/default
22  SUBMENU:=Instant Messaging
23  SECTION:=net
24  CATEGORY:=Network
25  TITLE:=ZNC
26  URL:=http://en.znc.in/
27  MAINTAINER:=Jonas Gorski <jonas.gorski+openwrt@gmail.com>
28endef
29
30define Package/znc
31  $(Package/znc/default)
32  DEPENDS:=+libopenssl +uclibcxx
33  MENU:=1
34endef
35
36define Package/znc/description
37        ZNC is an IRC bouncer with many advanced features like detaching,
38        multiple users, per channel playback buffer, SSL, IPv6, transparent DCC
39        bouncing, and c++ module support to name a few.
40endef
41
42define Package/znc/conffiles
43/etc/config/znc
44endef
45
46
47define Package/znc/install
48        $(INSTALL_DIR) $(1)/usr/bin
49        $(INSTALL_BIN) $(PKG_BUILD_DIR)/znc $(1)/usr/bin/
50        $(INSTALL_DIR) $(1)/etc/init.d
51        $(INSTALL_BIN) ./files/znc.init $(1)/etc/init.d/znc
52        $(INSTALL_DIR) $(1)/etc/config
53        $(INSTALL_DATA) ./files/znc.conf $(1)/etc/config/znc
54        $(INSTALL_DIR) $(1)/usr/lib/znc/
55        $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/extra/droproot.so $(1)/usr/lib/znc/
56endef
57
58
59ZNC_MODULES :=
60ZNC_MODULE_TARGETS := extra/droproot.so
61
62define module
63  define Package/znc-mod-$(strip $(1))
64    $(Package/znc/default)
65    TITLE+= ($(strip $(1)) plugin)
66    DEPENDS:=znc
67  endef
68
69  define Package/znc-mod-$(strip $(1))/description
70   $(strip $(2))
71  endef
72
73  define Package/znc-mod-$(strip $(1))/install
74        $(INSTALL_DIR) $$(1)/usr/lib/znc/
75        $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/$(strip $(3))$(subst -,_,$(strip $(1))).so $$(1)/usr/lib/znc/
76        # include webadmin page templates if existing
77        if [ -d $$(PKG_BUILD_DIR)/modules/$(strip $(3))$(subst -,_,$(strip $(1))) ]; then \
78                $(INSTALL_DIR) $$(1)/usr/share/znc/ ;\
79                $(CP) -r $$(PKG_BUILD_DIR)/modules/$(strip $(3))$(subst -,_,$(strip $(1))) $$(1)/usr/share/znc/ ;\
80        fi
81  endef
82
83  ZNC_MODULES += znc-mod-$(strip $(1))
84  $(if $(CONFIG_PACKAGE_znc-mod-$(strip $(1))),ZNC_MODULE_TARGETS += $(strip $(3))$(subst -,_,$(strip $(1))).so)
85endef
86
87define webadmin
88  define Package/znc-mod-webadmin
89    $(Package/znc/default)
90    TITLE+= (webadmin plugin)
91    DEPENDS:=znc
92  endef
93
94  define Package/znc-mod-webadmin/description
95   Allows you to add/remove/edit users and settings on the fly via a web browser.
96  endef
97
98  define Package/znc-mod-webadmin/install
99        $(INSTALL_DIR) $$(1)/usr/lib/znc/
100        $(INSTALL_BIN) $$(PKG_BUILD_DIR)/modules/webadmin.so $$(1)/usr/lib/znc/
101        $(INSTALL_DIR) $$(1)/usr/share/znc/
102        $(CP) -r $$(PKG_BUILD_DIR)/modules/webadmin $$(1)/usr/share/znc/
103        $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/
104        $(CP) -r $$(PKG_BUILD_DIR)/webskins/_default_ $$(1)/usr/share/znc/webskins/
105  endef
106
107  ZNC_MODULES += znc-mod-webadmin
108  $(if $(CONFIG_PACKAGE_znc-mod-webadmin),ZNC_MODULE_TARGETS += webadmin.so)
109endef
110
111define webskin
112  define Package/znc-webskin-$(strip $(1))
113    $(Package/znc/default)
114    TITLE+= ($(strip $(1)) webskin)
115    DEPENDS:=znc-mod-webadmin
116  endef
117
118  define Package/znc-webskin-$(strip $(1))/description
119    $(strip $(1)) webskin for webadmin
120  endef
121
122  define Package/znc-webskin-$(strip $(1))/install
123        $(INSTALL_DIR) $$(1)/usr/share/znc/webskins/
124        $(CP) -r $$(PKG_BUILD_DIR)/webskins/$(strip $(1)) $$(1)/usr/share/znc/webskins/
125  endef
126  ZNC_MODULES += znc-webskin-$(strip $(1))
127endef
128
129, := ,
130
131$(eval $(call module,admin,Allows you to add/remove/edit users and settings on \
132        the fly via IRC messages.))
133
134$(eval $(call module,adminlog,Log user connects and disconnects and failed \
135        logins to file or syslog.))
136
137$(eval $(call module,autoattach,Reattaches you to channels on activity.))
138
139$(eval $(call module,autocycle,Cycles a channel when you are the only one in \
140        there and you don't have op.))
141
142$(eval $(call module,autoop,Auto op the good guys.))
143
144$(eval $(call module,autoreply,Gives a automatic reply if someone messages you \
145        if you are away.))
146
147$(eval $(call module,away,Stores messages while away$(,) also auto away.))
148
149$(eval $(call module,awaynick,Change your nick while you are away.))
150
151$(eval $(call module,blockuser,Blocks certain users from using ZNC saying \
152        their account was disabled.))
153
154$(eval $(call module,buffextras,Add nick changes$(,) joins$(,) parts$(,) topic \
155        changes etc. to your playback buffer.))
156
157$(eval $(call module,certauth,This module allows users to log in via SSL \
158        client keys.))
159
160$(eval $(call module,chansaver,Keeping config up to date when user joins and \
161        parts.))
162
163$(eval $(call module,clientnotify,Notify about new incoming connections to \
164        your user.))
165
166$(eval $(call module,crypt,Encryption for channel/private messages.))
167
168$(eval $(call module,disconkick,This module will kick your client from all \
169        channels where you are$(,) in case if ZNC disconnects from server.))
170
171$(eval $(call module,fail2ban,Block IPs for some time after a failed login.))
172
173$(eval $(call module,fixfreenode,This module blocks some freenode-specific \
174        feature which results in plus (+) and minus (-) signs being displayed in \
175        front of every message from a client.))
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,autovoice,Autovoices everyone who joins some channel., \
216        extra/))
217
218$(eval $(call module,block-motd,This module blocks the server's Message of the \
219        Day.,extra/))
220
221$(eval $(call module,clearbufferonmsg,This module keeps the buffer until the \
222        next message from the client.,extra/))
223
224$(eval $(call module,ctcpflood,This module tries to block ctcp floods.,extra/))
225
226$(eval $(call module,fakeonline,This module fakes the online status of \
227        ZNC-*users.,extra/))
228
229$(eval $(call module,flooddetach,This module detaches you from channels which \
230        are flooded.,extra/))
231
232$(eval $(call module,listsockets,This module displays a list of all open \
233        sockets in ZNC.,extra/))
234
235$(eval $(call module,log,Log conversations to file.,extra/))
236
237$(eval $(call module,motdfile,Reads a MOTD from a file and displays it to \
238        users when they login.,extra/))
239
240$(eval $(call module,notify-connect,Sends a notice to all admins when a user \
241        logs in or out.,extra/))
242
243$(eval $(call module,send-raw,Allows you to send raw traffic to IRC from \
244        other users.,extra/))
245
246$(eval $(call module,shell,Have your unix shell in a query window right inside \
247        of your IRC client.,extra/))
248
249$(eval $(call webadmin))
250
251$(eval $(call webskin,dark-clouds))
252$(eval $(call webskin,forest))
253$(eval $(call webskin,ice))
254
255PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
256
257include $(INCLUDE_DIR)/package.mk
258
259CONFIGURE_VARS += \
260        CXX="$(STAGING_DIR)/host/bin/g++-uc" \
261        CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
262        CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
263        LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
264        LIBS="-luClibc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
265
266CONFIGURE_ARGS += \
267        --disable-c-ares \
268        --enable-extra \
269        --disable-perl
270
271MAKE_FLAGS += \
272        CXX="$(STAGING_DIR)/host/bin/g++-uc"
273
274define Build/Configure
275        $(call Build/Configure/Default,)
276        $(call libtool_disable_rpath)
277endef
278
279define Build/Compile
280        $(call Build/Compile/Default,znc)
281        $(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/modules \
282                $(MAKE_FLAGS) $(ZNC_MODULE_TARGETS)
283endef
284
285$(eval $(call BuildPackage,znc))
286$(foreach m,$(ZNC_MODULES),$(eval $(call BuildPackage,$(m))))
Note: See TracBrowser for help on using the repository browser.