[packages_10.03.1] collectd: backport r29404
[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.3
12 PKG_RELEASE:=1
13 VIMVER:=73
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.vim.org/pub/vim/unix/
17 PKG_MD5SUM:=5b9510a17074e2b37d8bb38ae09edbf2
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 CONFIGURE_VARS += \
93 vim_cv_getcwd_broken=no \
94 vim_cv_memmove_handles_overlap=yes \
95 vim_cv_stat_ignores_slash=yes \
96 vim_cv_tgetent=zero \
97 vim_cv_terminfo=yes \
98 vim_cv_toupper_broken=no \
99 vim_cv_tty_group=root \
100 vim_cv_tty_mode=0620
101
102 ifneq ($(CONFIG_PACKAGE_vim),)
103 define Build/Compile/vim
104 $(call Build/Configure/Default, \
105 --with-features=tiny \
106 --disable-multibyte \
107 )
108 $(MAKE) -C $(PKG_BUILD_DIR) clean
109 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
110 DESTDIR="$(PKG_INSTALL_DIR)" \
111 all
112 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_tiny
113 endef
114 endif
115
116 ifneq ($(CONFIG_PACKAGE_vim-full),)
117 define Build/Compile/vim-full
118 $(call Build/Configure/Default, \
119 --with-features=normal \
120 --enable-multibyte \
121 )
122 $(MAKE) -C $(PKG_BUILD_DIR) clean
123 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
124 DESTDIR="$(PKG_INSTALL_DIR)" \
125 all
126 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
127 endef
128 endif
129
130 define Build/Compile/vim-runtime
131 $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
132 (cd $(PKG_INSTALL_DIR) && tar -cf $(PKG_BUILD_DIR)/docs.tar ./usr/share/vim/vim$(VIMVER)/doc)
133 rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
134 rm -rf $(PKG_INSTALL_DIR)/usr/man
135 endef
136
137 define Build/Configure
138 endef
139
140 define Build/Compile
141 $(call Build/Compile/vim)
142 $(call Build/Compile/vim-full)
143 $(call Build/Compile/vim-runtime)
144 endef
145
146 define Package/vim/install
147 $(INSTALL_DIR) $(1)/usr/bin
148 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
149 $(INSTALL_DIR) $(1)/usr/share/vim
150 $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
151 endef
152
153
154 define Package/vim-full/install
155 $(INSTALL_DIR) $(1)/usr/bin
156 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
157 $(INSTALL_DIR) $(1)/usr/share/vim
158 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
159 endef
160
161 define Package/vim-runtime/install
162 $(CP) $(PKG_INSTALL_DIR)/* $(1)
163 rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
164 endef
165
166 define Package/vim-help/install
167 tar -C $(1) -xf $(PKG_BUILD_DIR)/docs.tar
168 endef
169
170 $(eval $(call BuildPackage,vim))
171 $(eval $(call BuildPackage,vim-full))
172 $(eval $(call BuildPackage,vim-runtime))
173 $(eval $(call BuildPackage,vim-help))
174