Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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:=7.2
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNU/nano
  13. PKG_HASH:=86f3442768bd2873cec693f83cdf80b4b444ad3cc14760b74361474fc87a4526
  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-linenumbers \
  75. --enable-multibuffer \
  76. --enable-nanorc \
  77. --enable-utf8 \
  78. --disable-browser \
  79. --disable-color \
  80. --disable-comment \
  81. --disable-extra \
  82. --disable-histories \
  83. --disable-justify \
  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_DATA) ./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))