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.

96 lines
2.3 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.34
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://pkgs.fedoraproject.org/lookaside/pkgs/file/ \
  13. http://download.openpkg.org/components/cache/file/ \
  14. ftp://ftp.astron.com/pub/file/
  15. PKG_HASH:=f15a50dbbfa83fec0bd1161e8e191b092ec832720e30cd14536e044ac623b20a
  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. CONFIGURE_ARGS += \
  41. --enable-shared \
  42. --enable-static \
  43. --disable-libseccomp
  44. MAKE_PATH := src
  45. TARGET_CFLAGS += $(FPIC)
  46. define Build/Compile/magic
  47. ( cd $(PKG_BUILD_DIR)/magic/Magdir; \
  48. for f in `ls`; do \
  49. cat $$$${f}; \
  50. done \
  51. ) > $(PKG_BUILD_DIR)/magic/magic
  52. endef
  53. Hooks/Compile/Post += Build/Compile/magic
  54. define Build/Install/magic
  55. $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/file
  56. $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic $(PKG_INSTALL_DIR)/usr/share/file/
  57. endef
  58. Hooks/Install/Post += Build/Install/magic
  59. define Build/InstallDev
  60. $(INSTALL_DIR) $(1)/usr/include
  61. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
  62. $(INSTALL_DIR) $(1)/usr/lib
  63. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
  64. endef
  65. define Package/file/install
  66. $(INSTALL_DIR) $(1)/usr/bin
  67. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin/
  68. $(INSTALL_DIR) $(1)/usr/share/misc
  69. $(SED) "/^#/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
  70. $(SED) "/^$$$$/d" $(PKG_INSTALL_DIR)/usr/share/file/magic
  71. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/file/magic $(1)/usr/share/misc/
  72. endef
  73. define Package/libmagic/install
  74. $(INSTALL_DIR) $(1)/usr/lib
  75. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
  76. endef
  77. $(eval $(call BuildPackage,file))
  78. $(eval $(call BuildPackage,libmagic))