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.

100 lines
2.4 KiB

  1. #
  2. # Copyright (C) 2007-2014 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:=file
  9. PKG_VERSION:=5.36
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://src.fedoraproject.org/lookaside/pkgs/file/ \
  13. http://download.openpkg.org/components/cache/file/ \
  14. ftp://ftp.astron.com/pub/file/
  15. PKG_HASH:=fb608290c0fd2405a8f63e5717abf6d03e22e183fb21884413d1edd918184379
  16. PKG_LICENSE:=BSD-2c
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/file/Default
  22. TITLE:=File type determination
  23. URL:=https://darwinsys.com/file/
  24. MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
  25. endef
  26. define Package/file
  27. $(call Package/file/Default)
  28. SECTION:=utils
  29. CATEGORY:=Utilities
  30. TITLE+= utility
  31. DEPENDS:=+libmagic
  32. endef
  33. define Package/libmagic
  34. $(call Package/file/Default)
  35. SECTION:=libs
  36. CATEGORY:=Libraries
  37. TITLE+= library
  38. DEPENDS:=+zlib
  39. endef
  40. TARGET_CFLAGS += $(FPIC)
  41. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  42. CONFIGURE_ARGS += \
  43. --enable-shared \
  44. --enable-static \
  45. --disable-libseccomp \
  46. --disable-rpath \
  47. --disable-warnings \
  48. --without-pic
  49. MAKE_PATH := src
  50. define Build/Compile/magic
  51. ( cd $(PKG_BUILD_DIR)/magic/Magdir; \
  52. for f in `ls`; do \
  53. cat $$$${f}; \
  54. done \
  55. ) > $(PKG_BUILD_DIR)/magic/magic
  56. endef
  57. Hooks/Compile/Post += Build/Compile/magic
  58. define Build/Install/magic
  59. $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/file
  60. $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic $(PKG_INSTALL_DIR)/usr/share/file/
  61. endef
  62. Hooks/Install/Post += Build/Install/magic
  63. define Build/InstallDev
  64. $(INSTALL_DIR) $(1)/usr/include
  65. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
  66. $(INSTALL_DIR) $(1)/usr/lib
  67. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
  68. endef
  69. define Package/file/install
  70. $(INSTALL_DIR) $(1)/usr/bin
  71. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin/
  72. $(INSTALL_DIR) $(1)/usr/share/misc
  73. $(SED) "/^#/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
  74. $(SED) "/^$$$$/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
  75. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/file/magic $(1)/usr/share/misc/
  76. endef
  77. define Package/libmagic/install
  78. $(INSTALL_DIR) $(1)/usr/lib
  79. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
  80. endef
  81. $(eval $(call BuildPackage,file))
  82. $(eval $(call BuildPackage,libmagic))