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.

59 lines
1.3 KiB

  1. #
  2. # Copyright (C) 2010-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:=grep
  9. PKG_VERSION:=3.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNU/grep
  13. PKG_HASH:=b960541c499619efd6afe1fa795402e4733c8e11ebf9fafccc0bb4bccdc5b514
  14. PKG_MAINTAINER:=Julen Landa Alustiza <julen@zokormazo.info>
  15. PKG_LICENSE:=GPL-3.0
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:gnu:grep
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/grep
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=grep search utility - full version
  25. DEPENDS:=+libpcre
  26. URL:=https://www.gnu.org/software/grep/
  27. endef
  28. define Package/grep/description
  29. The grep command searches one or more input files for lines
  30. containing a match to a specified pattern. By default, grep
  31. prints the matching lines.
  32. endef
  33. define Package/grep/install
  34. $(INSTALL_DIR) $(1)/usr/bin
  35. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/grep $(1)/usr/bin/grep
  36. endef
  37. define Package/grep/postinst
  38. #!/bin/sh
  39. [ -L "$${IPKG_INSTROOT}/bin/grep" ] && rm -f "$${IPKG_INSTROOT}/bin/grep"
  40. exit 0
  41. endef
  42. define Package/grep/prerm
  43. $${IPKG_INSTROOT}/bin/busybox grep -h 2>&1 | grep -q BusyBox && \
  44. ln -sf busybox $${IPKG_INSTROOT}/bin/grep
  45. exit 0
  46. endef
  47. $(eval $(call BuildPackage,grep))