e68b289501af04534dfbc5e4d3fdb74d4df9c2b4
[feed/packages.git] / utils / nano / Makefile
1 #
2 # Copyright (C) 2007-2016 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:=nano
11 PKG_VERSION:=7.2
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/nano
16 PKG_HASH:=86f3442768bd2873cec693f83cdf80b4b444ad3cc14760b74361474fc87a4526
17
18 PKG_LICENSE:=GPL-3.0-or-later
19 PKG_LICENSE_FILES:=COPYING
20 PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
21 PKG_CPE_ID:=cpe:/a:gnu:nano
22
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/nano/Default
29 SUBMENU:=Editors
30 SECTION:=utils
31 CATEGORY:=Utilities
32 URL:=https://www.nano-editor.org/
33 DEPENDS:=+libncurses
34 endef
35
36 define Package/nano
37 $(call Package/nano/Default)
38 TITLE:=GNU nano text editor (minimal features)
39 VARIANT:=tiny
40 DEFAULT_VARIANT:=1
41 endef
42
43 define Package/nano-plus
44 $(call Package/nano/Default)
45 TITLE:=GNU nano text editor (more features, Unicode)
46 VARIANT:=plus
47 endef
48
49 define Package/nano-full
50 $(call Package/nano/Default)
51 TITLE:=GNU nano text editor (all features, Unicode)
52 VARIANT:=full
53 endef
54
55 define Package/nano/description
56 Nano is a small and simple text editor for use on the terminal.
57
58 Nano started as an enhanced clone of the Pico text editor.
59 Nowadays Nano wants to be a generally useful editor with sensible
60 defaults (linewise scrolling, no automatic line breaking).
61
62 Nano is an official GNU package.
63 endef
64
65 define Package/nano-plus/description
66 nano-plus - Additional features enabled, larger size than default nano.
67 (multibuffer, Unicode/UTF-8, help, justify, nanorc, some key bindings)
68
69 $(call Package/nano/description)
70 endef
71
72 define Package/nano-full/description
73 nano-full - all features, including syntax highlighting (also uci),
74 multibuffer, Unicode/UTF-8, nanorc, some key bindings.
75 (libmagic-based file type detection is disabled)
76
77 Example /etc/nanorc is included. nanorc documentation at
78 https://www.nano-editor.org/dist/latest/nanorc.5.html
79
80 $(call Package/nano/description)
81 endef
82
83 ifeq ($(BUILD_VARIANT),full)
84 # full variant with almost all features included
85 CONFIGURE_ARGS += \
86 --disable-extra \
87 --disable-libmagic \
88 --enable-utf8
89 else ifeq ($(BUILD_VARIANT),plus)
90 # plus variant with some features included
91 CONFIGURE_ARGS += \
92 --enable-help \
93 --enable-linenumbers \
94 --enable-multibuffer \
95 --enable-nanorc \
96 --enable-utf8 \
97 --disable-browser \
98 --disable-color \
99 --disable-comment \
100 --disable-extra \
101 --disable-histories \
102 --disable-justify \
103 --disable-libmagic \
104 --disable-mouse \
105 --disable-operatingdir \
106 --disable-speller \
107 --disable-tabcomp \
108 --disable-wordcomp
109 else
110 # default tiny variant
111 CONFIGURE_ARGS += \
112 --enable-tiny \
113 --enable-linenumbers \
114 --disable-color \
115 --disable-utf8
116 endif
117
118 CONFIGURE_VARS += \
119 ac_cv_header_regex_h=no \
120
121 define Package/nano-plus/conffiles
122 /etc/nanorc
123 endef
124
125 define Package/nano-full/conffiles
126 /etc/nanorc
127 endef
128
129 define Package/nano/install
130 $(INSTALL_DIR) $(1)/usr/bin
131 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
132 endef
133
134 define Package/nano-plus/install
135 $(call Package/nano/install,$1)
136 endef
137
138 define Package/nano-full/install
139 $(call Package/nano/install,$1)
140 $(INSTALL_DIR) $(1)/etc $(1)/usr/share/nano
141 $(INSTALL_DATA) ./files/nanorc $(1)/etc/nanorc
142 $(INSTALL_DATA) ./files/uci.nanorc $(1)/usr/share/nano
143 $(CP) $(PKG_INSTALL_DIR)/usr/share/nano/* $(1)/usr/share/nano
144 endef
145
146 $(eval $(call BuildPackage,nano))
147 $(eval $(call BuildPackage,nano-plus))
148 $(eval $(call BuildPackage,nano-full))
149