2 # Copyright (C) 2007-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=ftp
://ftp.astron.com
/pub
/file
/
16 PKG_MD5SUM
:=74cd5466416136da30a4e69f74dbc7a0
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/libmagic
27 TITLE
:=Determines file type using
'magic' numbers
28 URL
:=ftp
://ftp.astron.com
/pub
/file
/
35 TITLE
:=Determines file type using
'magic' numbers
36 URL
:=ftp
://ftp.astron.com
/pub
/file
/
39 define Package
/file
/description
40 File tests each argument in an attempt to classify it. There
41 are three sets of tests
, performed in this order
: filesystem
42 tests
, magic number tests
, and language tests. The first
test
43 that succeeds causes the file type to be printed.
45 Starting with version
4, the file command is not much more than
46 a wrapper around the
"magic" library.
51 TARGET_CFLAGS
+= $(FPIC
)
53 define Build
/Configure
54 $(call Build
/Configure
/Default
, \
58 --without-libiconv-prefix \
59 --without-libintl-prefix \
64 $(call Build
/Prepare
/Default
)
65 chmod
-R u
+w
$(PKG_BUILD_DIR
)
68 define Build
/InstallDev
69 $(INSTALL_DIR
) $(1)/usr
/include
70 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/magic.h
$(1)/usr
/include/
71 $(INSTALL_DIR
) $(1)/usr
/lib
72 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libmagic.
{a
,so
*} $(1)/usr
/lib
/
75 define Package
/libmagic
/install
76 $(INSTALL_DIR
) $(1)/usr
/lib
77 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libmagic.so.
* $(1)/usr
/lib
/
80 define Package
/file
/install
81 $(INSTALL_DIR
) $(1)/usr
/bin
82 $(INSTALL_DIR
) $(1)/usr
/share
/file
83 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/file
$(1)/usr
/bin
84 (cd
$(PKG_BUILD_DIR
)/magic
/Magdir
; rm -f magic.mime
; for file in
`ls`; do cat
$$$${file} >> magic.mime
; done
)
85 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/magic
/Magdir
/magic.mime
$(1)/usr
/share
/file
/magic
88 $(eval
$(call BuildPackage
,libmagic
))
89 $(eval
$(call BuildPackage
,file
))