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