[vim] enable multibyte feature in vim-full package
[openwrt/svn-archive/archive.git] / utils / vim / 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:=vim
11 PKG_VERSION:=7.1
12 PKG_RELEASE:=3
13 VIMVER:=71
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
17 PKG_MD5SUM:=44c6b4914f38d6f9aa959640b89da329
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER)
20 PKG_BUILD_PARALLEL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/vim/Default
25 SECTION:=utils
26 CATEGORY:=Utilities
27 DEPENDS:=+libncurses
28 TITLE:=Vi IMproved - enhanced vi editor
29 URL:=http://www.vim.org/
30 SUBMENU:=Editors
31 endef
32
33 define Package/vim
34 $(call Package/vim/Default)
35 TITLE+= (Tiny)
36 endef
37
38 define Package/vim-full
39 $(call Package/vim/Default)
40 TITLE+= (Normal)
41 endef
42
43 define Package/vim-runtime
44 $(call Package/vim/Default)
45 TITLE+= (runtime files)
46 endef
47
48 define Package/vim-help
49 $(call Package/vim/Default)
50 TITLE+= (help files)
51 endef
52
53 define Package/vim-full/conffiles
54 /usr/share/vim/vimrc
55 endef
56
57 define Package/vim/conffiles
58 /usr/share/vim/vimrc
59 endef
60
61 define Package/vim/description
62 Vim is an almost compatible version of the UNIX editor Vi.
63 (Tiny build)
64 endef
65
66 define Package/vim-full/description
67 Vim is an almost compatible version of the UNIX editor Vi.
68 (Normal build)
69 endef
70
71 define Package/vim-runtime/description
72 Vim is an almost compatible version of the UNIX editor Vi.
73 (Runtime files)
74 endef
75
76 define Package/vim-help/description
77 Vim is an almost compatible version of the UNIX editor Vi.
78 (Help files)
79 endef
80
81
82 CONFIGURE_ARGS += \
83 --disable-gui \
84 --disable-gtktest \
85 --disable-xim \
86 --without-x \
87 --disable-netbeans \
88 --disable-cscope \
89 --disable-gpm \
90 --with-tlib=ncurses
91
92 ifneq ($(CONFIG_PACKAGE_vim),)
93 define Build/Compile/vim
94 $(call Build/Configure/Default, \
95 --with-features=tiny \
96 --disable-multibyte \
97 )
98 $(MAKE) -C $(PKG_BUILD_DIR) clean
99 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
100 DESTDIR="$(PKG_INSTALL_DIR)" \
101 all
102 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
103 endef
104 endif
105
106 ifneq ($(CONFIG_PACKAGE_vim-full),)
107 define Build/Compile/vim-full
108 $(call Build/Configure/Default, \
109 --with-features=normal \
110 --enable-multibyte \
111 )
112 $(MAKE) -C $(PKG_BUILD_DIR) clean
113 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
114 DESTDIR="$(PKG_INSTALL_DIR)" \
115 all
116 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
117 endef
118 endif
119
120 define Build/Compile/vim-runtime
121 $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
122 (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
123 rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
124 rm -rf $(PKG_INSTALL_DIR)/usr/man
125 endef
126
127 define Build/Configure
128 endef
129
130 define Build/Compile
131 $(call Build/Compile/vim)
132 $(call Build/Compile/vim-full)
133 $(call Build/Compile/vim-runtime)
134 endef
135
136 define Package/vim/install
137 $(INSTALL_DIR) $(1)/usr/bin
138 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
139 $(INSTALL_DIR) $(1)/usr/share/vim
140 $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
141 endef
142
143
144 define Package/vim-full/install
145 $(INSTALL_DIR) $(1)/usr/bin
146 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
147 $(INSTALL_DIR) $(1)/usr/share/vim
148 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
149 endef
150
151 define Package/vim-runtime/install
152 $(CP) $(PKG_INSTALL_DIR)/* $(1)
153 rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
154 endef
155
156 define Package/vim-help/install
157 tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
158 endef
159
160 $(eval $(call BuildPackage,vim))
161 $(eval $(call BuildPackage,vim-full))
162 $(eval $(call BuildPackage,vim-runtime))
163 $(eval $(call BuildPackage,vim-help))
164