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.

58 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_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/grep
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. TITLE:=grep search utility - full version
  24. DEPENDS:=+libpcre
  25. URL:=https://www.gnu.org/software/grep/
  26. endef
  27. define Package/grep/description
  28. The grep command searches one or more input files for lines
  29. containing a match to a specified pattern. By default, grep
  30. prints the matching lines.
  31. endef
  32. define Package/grep/install
  33. $(INSTALL_DIR) $(1)/usr/bin
  34. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/grep $(1)/usr/bin/grep
  35. endef
  36. define Package/grep/postinst
  37. #!/bin/sh
  38. [ -L "$${IPKG_INSTROOT}/bin/grep" ] && rm -f "$${IPKG_INSTROOT}/bin/grep"
  39. exit 0
  40. endef
  41. define Package/grep/prerm
  42. $${IPKG_INSTROOT}/bin/busybox grep -h 2>&1 | grep -q BusyBox && \
  43. ln -sf busybox $${IPKG_INSTROOT}/bin/grep
  44. exit 0
  45. endef
  46. $(eval $(call BuildPackage,grep))