9b74838d4c5dccdc1e17475c872e07532892714b
[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-multibyte \
88 --disable-netbeans \
89 --disable-cscope \
90 --disable-gpm \
91 --with-tlib=ncurses
92
93 ifneq ($(CONFIG_PACKAGE_vim),)
94 define Build/Compile/vim
95 $(call Build/Configure/Default, \
96 --with-features=tiny \
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 )
111 $(MAKE) -C $(PKG_BUILD_DIR) clean
112 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
113 DESTDIR="$(PKG_INSTALL_DIR)" \
114 all
115 $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(PKG_BUILD_DIR)/vim_normal
116 endef
117 endif
118
119 define Build/Compile/vim-runtime
120 $(MAKE) -C $(PKG_BUILD_DIR)/src DESTDIR="$(PKG_INSTALL_DIR)" installrtbase
121 (cd $(PKG_INSTALL_DIR) && tar -czf $(PKG_BUILD_DIR)/docs.tgz ./usr/share/vim/vim$(VIMVER)/doc)
122 rm -rf $(PKG_INSTALL_DIR)/usr/share/vim/vim$(VIMVER)/doc
123 rm -rf $(PKG_INSTALL_DIR)/usr/man
124 endef
125
126 define Build/Configure
127 endef
128
129 define Build/Compile
130 $(call Build/Compile/vim)
131 $(call Build/Compile/vim-full)
132 $(call Build/Compile/vim-runtime)
133 endef
134
135 define Package/vim/install
136 $(INSTALL_DIR) $(1)/usr/bin
137 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_tiny $(1)/usr/bin/vim
138 $(INSTALL_DIR) $(1)/usr/share/vim
139 $(INSTALL_CONF) ./files/vimrc $(1)/usr/share/vim/
140 endef
141
142
143 define Package/vim-full/install
144 $(INSTALL_DIR) $(1)/usr/bin
145 $(INSTALL_BIN) $(PKG_BUILD_DIR)/vim_normal $(1)/usr/bin/vim
146 $(INSTALL_DIR) $(1)/usr/share/vim
147 $(INSTALL_CONF) ./files/vimrc.full $(1)/usr/share/vim/vimrc
148 endef
149
150 define Package/vim-runtime/install
151 $(CP) $(PKG_INSTALL_DIR)/* $(1)
152 rm -rf $(1)/usr/share/vim/vim$(VIMVER)/doc
153 endef
154
155 define Package/vim-help/install
156 tar -C $(1) -xzf $(PKG_BUILD_DIR)/docs.tgz
157 endef
158
159 $(eval $(call BuildPackage,vim))
160 $(eval $(call BuildPackage,vim-full))
161 $(eval $(call BuildPackage,vim-runtime))
162 $(eval $(call BuildPackage,vim-help))
163