Merge pull request #8361 from jandelgado/add_udptunnel_package
[feed/packages.git] / utils / vim / Makefile
1 #
2 # Copyright (C) 2015 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:=8.1
12 PKG_RELEASE:=2
13 VIMVER:=81
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://ftp.vim.org/pub/vim/unix
17 PKG_HASH:=8b69fbd01c877dd8ecbbeca1dc66e5e927228d631ac4c2174b9307eb5c827c86
18 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
19 PKG_CPE_ID:=cpe:/a:vim:vim
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)$(VIMVER)
22 PKG_BUILD_PARALLEL:=1
23
24 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)$(VIMVER)
25 HOST_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/host-build.mk
29
30 define Package/vim/Default
31 SECTION:=utils
32 CATEGORY:=Utilities
33 DEPENDS:=+libncurses
34 TITLE:=Vi IMproved - enhanced vi editor
35 URL:=http://www.vim.org/
36 SUBMENU:=Editors
37 endef
38
39 define Package/vim
40 $(call Package/vim/Default)
41 TITLE+= (Tiny)
42 endef
43
44 define Package/vim-full
45 $(call Package/vim/Default)
46 TITLE+= (Normal)
47 endef
48
49
50 define Package/vim-fuller
51 $(call Package/vim/Default)
52 TITLE+= (Big)
53 endef
54
55 define Package/vim-runtime
56 $(call Package/vim/Default)
57 TITLE+= (runtime files)
58 endef
59
60 define Package/vim-help
61 $(call Package/vim/Default)
62 TITLE+= (help files)
63 endef
64
65 define Package/xxd
66 SECTION:=utils
67 CATEGORY:=Utilities
68 TITLE:=make a hexdump or do the reverse
69 URL:=http://www.vim.org/
70 endef
71
72 define Package/vim-full/conffiles
73 /usr/share/vim/vimrc
74 /root/.vimrc
75 endef
76
77 define Package/vim/conffiles
78 /usr/share/vim/vimrc
79 /root/.vimrc
80 endef
81
82 define Package/vim/description
83 Vim is an almost compatible version of the UNIX editor Vi.
84 (Tiny build)
85 endef
86
87 define Package/vim-full/description
88 Vim is an almost compatible version of the UNIX editor Vi.
89 (Normal build)
90 endef
91
92
93 define Package/vim-fuller/description
94 Vim is an almost compatible version of the UNIX editor Vi.
95 (Big build)
96 endef
97
98 define Package/vim-runtime/description
99 Vim is an almost compatible version of the UNIX editor Vi.
100 (Runtime files)
101 endef
102
103 define Package/vim-help/description
104 Vim is an almost compatible version of the UNIX editor Vi.
105 (Help files)
106 endef
107
108 define Package/xxd/description
109 xxd creates a hex dump of a given file or standard input, it can also convert
110 a hex dump back to its original binary form.
111 endef
112
113 CONFIGURE_ARGS += \
114 --disable-gui \
115 --disable-gtktest \
116 --disable-xim \
117 --without-x \
118 --disable-netbeans \
119 --disable-cscope \
120 --disable-gpm \
121 --disable-acl \
122 --with-tlib=ncurses \
123 --with-compiledby="non-existent-hostname-compiled"
124
125 CONFIGURE_VARS += \
126 vim_cv_getcwd_broken=no \
127 vim_cv_memmove_handles_overlap=yes \
128 vim_cv_stat_ignores_slash=yes \
129 vim_cv_tgetent=zero \
130 vim_cv_terminfo=yes \
131 vim_cv_toupper_broken=no \
132 vim_cv_tty_group=root \
133 vim_cv_tty_mode=0620
134
135 ifneq ($(HOST_OS),Linux)
136 TARGET_PATH_PKG:=$(CURDIR)/scripts:$(TARGET_PATH_PKG)
137 endif
138
139 define Build/Prepare
140 $(call Build/Prepare/Default)
141 $(MAKE) -C $(PKG_BUILD_DIR)/src autoconf
142 endef
143
144 ifneq ($(CONFIG_PACKAGE_vim),)
145 define Build/Compile/vim
146 $(call Build/Configure/Default, \
147 --with-features=tiny \
148 --disable-multibyte \
149 )
150 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
151 DESTDIR="$(PKG_INSTALL_DIR)" all
152 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
153 endef
154 endif
155
156 ifneq ($(CONFIG_PACKAGE_vim-full),)
157 define Build/Compile/vim-full
158 $(call Build/Configure/Default, \
159 --with-features=normal \
160 --enable-multibyte \
161 )
162 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
163 DESTDIR="$(PKG_INSTALL_DIR)" all
164 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
165 endef
166 endif
167
168 ifneq ($(CONFIG_PACKAGE_vim-fuller),)
169 define Build/Compile/vim-fuller
170 $(call Build/Configure/Default, \
171 --with-features=big \
172 --enable-multibyte \
173 )
174 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
175 DESTDIR="$(PKG_INSTALL_DIR)" all
176 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_big
177 endef
178 endif
179
180
181
182 ifneq ($(CONFIG_PACKAGE_xxd),)
183 define Build/Compile/xxd
184 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
185 DESTDIR="$(PKG_INSTALL_DIR)" all
186 endef
187 endif
188
189 define Build/Compile/vim-runtime
190 $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
191 (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
192 rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
193 rm -rf $(PKG_INSTALL_DIR)/usr/man
194 endef
195
196 define Build/Compile
197 $(call Build/Compile/vim)
198 $(call Build/Compile/vim-full)
199 $(call Build/Compile/vim-fuller)
200 $(call Build/Compile/vim-runtime)
201 $(call Build/Compile/xxd)
202 endef
203
204 define Package/vim/install
205 $(INSTALL_DIR) $(1)/usr/bin
206 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
207 $(INSTALL_DIR) $(1)/usr/share/vim
208 $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
209 endef
210
211 define Package/vim-full/install
212 $(INSTALL_DIR) $(1)/usr/bin
213 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
214 $(INSTALL_DIR) $(1)/usr/share/vim
215 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
216 endef
217
218
219 define Package/vim-fuller/install
220 $(INSTALL_DIR) $(1)/usr/bin
221 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_big $(1)/usr/bin/vim
222 $(INSTALL_DIR) $(1)/usr/share/vim
223 $(CP) -r $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER) $(1)/usr/share/vim
224 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
225 endef
226
227
228
229 define Package/vim-runtime/install
230 $(CP) $(PKG_INSTALL_DIR)/* $(1)
231 rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
232 endef
233
234 define Package/vim-help/install
235 tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
236 endef
237
238 define Package/xxd/install
239 $(INSTALL_DIR) $(1)/usr/bin
240 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xxd/xxd $(1)/usr/bin
241 endef
242
243 $(eval $(call BuildPackage,vim))
244 $(eval $(call BuildPackage,vim-full))
245 $(eval $(call BuildPackage,vim-fuller))
246 $(eval $(call BuildPackage,vim-runtime))
247 $(eval $(call BuildPackage,vim-help))
248 $(eval $(call BuildPackage,xxd))
249 $(eval $(call HostBuild))