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.

60 lines
1.3 KiB

  1. #
  2. # Copyright (C) 2010-2012 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:=2.21
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNU/grep
  13. PKG_MD5SUM:=43c48064d6409862b8a850db83c8038a
  14. PKG_LICENSE:=GPL-3.0
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_MAINTAINER:=Julen Landa Alustiza <julen@zokormazo.info>
  17. PKG_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. TARGET_CFLAGS+=--std=gnu99
  21. define Package/grep
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. TITLE:=grep search utility - full version
  25. DEPENDS:=+libpcre
  26. URL:=http://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))