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.

94 lines
2.1 KiB

  1. #
  2. # Copyright (C) 2010-2015 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:=less
  9. PKG_VERSION:=530
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://www.greenwoodsoftware.com/less
  13. PKG_HASH:=503f91ab0af4846f34f0444ab71c4b286123f0044a4964f1ae781486c617f2e2
  14. PKG_LICENSE:=GPL-3.0
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Julen Landa Alustiza <julen@zokormazo.info>
  17. PKG_CPE_ID:=cpe:/a:gnu:less
  18. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/less/Default
  23. SECTION:=utils
  24. CATEGORY:=Utilities
  25. TITLE:=Pager program similar to more
  26. URL:=http://www.greenwoodsoftware.com/less/
  27. endef
  28. define Package/less/Default/description
  29. Full version of GNU less utility
  30. endef
  31. define Package/less
  32. $(call Package/less/Default)
  33. DEPENDS:=+libncurses
  34. VARIANT:=narrow
  35. endef
  36. define Package/less/description
  37. $(call Package/less/Default/description)
  38. endef
  39. define Package/less-wide
  40. $(call Package/less/Default)
  41. TITLE+= (Unicode)
  42. DEPENDS:=+libncursesw
  43. VARIANT:=wide
  44. endef
  45. define Package/less-wide/description
  46. $(call Package/less/Default/description)
  47. This package contains the Unicode enabled version of less.
  48. endef
  49. ifeq ($(BUILD_VARIANT),narrow)
  50. CONFIGURE_VARS += \
  51. ac_cv_lib_ncursesw_initscr=no
  52. endif
  53. ifeq ($(BUILD_VARIANT),wide)
  54. CONFIGURE_VARS += \
  55. ac_cv_lib_ncursesw_initscr=yes
  56. endif
  57. define Package/less/install
  58. $(INSTALL_DIR) $(1)/bin
  59. $(CP) $(PKG_INSTALL_DIR)/usr/bin/less $(1)/bin/less
  60. endef
  61. define Package/less/postinst
  62. #!/bin/sh
  63. [ -L "$${IPKG_INSTROOT}/usr/bin/less" ] && rm -f "$${IPKG_INSTROOT}/usr/bin/less"
  64. exit 0
  65. endef
  66. define Package/less/postrm
  67. #!/bin/sh
  68. /bin/busybox less -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/bin/less
  69. exit 0
  70. endef
  71. Package/less-wide/install = $(Package/less/install)
  72. Package/less-wide/postinst = $(Package/less/postinst)
  73. Package/less-wide/postrm = $(Package/less/postrm)
  74. $(eval $(call BuildPackage,less))
  75. $(eval $(call BuildPackage,less-wide))