2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
17 PKG_MD5SUM:=a61ef3aa8339d5987148089afde25f60
19 include $(INCLUDE_DIR)/package.mk
21 define Package/libmagic
25 TITLE:=Determines file type using "magic" numbers
26 URL:=ftp://ftp.astron.com/pub/file/
33 TITLE:=Determines file type using "magic" numbers
34 URL:=ftp://ftp.astron.com/pub/file/
37 define Package/file/description
38 File tests each argument in an attempt to classify it. There
39 are three sets of tests, performed in this order: filesystem
40 tests, magic number tests, and language tests. The first test
41 that succeeds causes the file type to be printed.
43 Starting with version 4, the file command is not much more than
44 a wrapper around the "magic" library.
51 --without-libiconv-prefix \
52 --without-libintl-prefix \
55 -C $(PKG_BUILD_DIR)/src \
56 DESTDIR="$(PKG_INSTALL_DIR)" \
59 define Build/InstallDev
60 mkdir -p $(1)/usr/include
61 $(CP) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
63 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
66 define Package/libmagic/install
67 $(INSTALL_DIR) $(1)/usr/lib
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
71 define Package/file/install
72 $(INSTALL_DIR) $(1)/usr/bin
73 $(INSTALL_DIR) $(1)/usr/share/file
74 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin
75 $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/Magdir/linux $(1)/usr/share/file/magic
76 $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic.mime $(1)/usr/share/file/magic.mime
79 $(eval $(call BuildPackage,libmagic))
80 $(eval $(call BuildPackage,file))