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.

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