You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
3.5 KiB

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