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