69a411fec14728cbb7a1e0c0879682c1dce9cd80
[openwrt/svn-archive/archive.git] / net / weechat / Makefile
1 #
2 # Copyright (C) 2006-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:=weechat
11 PKG_VERSION:=0.2.6
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.weechat.org/files/src
16 PKG_MD5SUM:=ccdecf663b0050a23049acb4b9a76193
17
18 PKG_FIXUP = libtool
19 PKG_CONFIG_DEPENDS = CONFIG_PACKAGE_weechat-mod-lua
20
21 include $(INCLUDE_DIR)/package.mk
22 include $(INCLUDE_DIR)/nls.mk
23
24 define Package/weechat/Default
25 SUBMENU:=Instant Messaging
26 SECTION:=net
27 CATEGORY:=Network
28 TITLE:=Lightweight IRC client
29 URL:=http://www.weechat.org/
30 endef
31
32 define Package/weechat/Default/description
33 Weechat is fast, light & extensible IRC client.
34 endef
35
36
37 define Package/weechat
38 $(call Package/weechat/Default)
39 MENU=1
40 DEPENDS:=+libgnutls +libncurses $(ICONV_DEPENDS)
41 endef
42
43 define Package/weechat/description
44 $(call Package/weechat/Default/description)
45 endef
46
47
48 define Package/weechat-mod-charset
49 $(call Package/weechat/Default)
50 TITLE+= (charset plugin)
51 DEPENDS:=weechat
52 endef
53
54 define Package/weechat-mod-charset/description
55 $(call Package/weechat/Default/description)
56 This packages contains a charset plugin for Weechat.
57 endef
58
59
60 define Package/weechat-mod-lua
61 $(call Package/weechat/Default)
62 TITLE+= (Lua plugin)
63 DEPENDS:=weechat +liblua @BROKEN
64 endef
65
66 define Package/weechat-mod-lua/description
67 $(call Package/weechat/Default/description)
68 This packages contains an Lua scripting plugin for Weechat.
69 endef
70
71
72 CONFIGURE_ARGS+= \
73 --with-debug=0 \
74 --without-doc-xsl-prefix \
75 --with-libiconv-prefix="$(ICONV_PREFIX)" \
76 --without-libintl-prefix \
77 --disable-aspell \
78 --disable-perl \
79 --disable-python \
80 --disable-ruby \
81 LUACONFIG="" \
82 ac_cv_path_LIBGNUTLS_CONFIG="pkg-config gnutls" \
83
84 TARGET_LDFLAGS += \
85 -L$(ICONV_PREFIX)/lib \
86 -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
87
88 ifneq ($(CONFIG_PACKAGE_weechat-mod-lua),)
89 CONFIGURE_ARGS+= \
90 --enable-lua \
91 --enable-plugins \
92 --with-plugins="lua" \
93 --with-lua-inc="$(STAGING_DIR)/usr/include" \
94 --with-lua-lib="$(STAGING_DIR)/usr/lib"
95 CONFIGURE_VARS+= \
96 LIBS="-ldl -lm"
97 TARGET_LDFLAGS += -lcrypt
98 else
99 CONFIGURE_ARGS+= \
100 --disable-lua
101 endif
102
103 define Build/Compile
104 $(MAKE) -C $(PKG_BUILD_DIR) \
105 $(LUA_FLAGS) \
106 DESTDIR="$(PKG_INSTALL_DIR)" \
107 LUACONFIG="" \
108 all install
109 endef
110
111 define Package/weechat/install
112 $(INSTALL_DIR) $(1)/usr/bin
113 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/weechat-curses $(1)/usr/bin/
114 $(INSTALL_DIR) $(1)/usr/lib/weechat/plugins
115 endef
116
117 define BuildPlugin
118
119 define Package/weechat-mod-$(1)/install
120 $(INSTALL_DIR) $$(1)/usr/lib/weechat/plugins
121 $(CP) $(PKG_INSTALL_DIR)/usr/lib/weechat/plugins/$(1).so* $$(1)/usr/lib/weechat/plugins/
122 endef
123
124 $$(eval $$(call BuildPackage,weechat-mod-$(1)))
125 endef
126
127 $(eval $(call BuildPackage,weechat))
128 $(eval $(call BuildPlugin,charset))
129 $(eval $(call BuildPlugin,lua))