2 # Copyright (C) 2007-2014 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
:=https
://sources.lede-project.org
/ \
16 http
://pkgs.fedoraproject.org
/lookaside
/pkgs
/file
/ \
17 http
://download.openpkg.org
/components
/cache
/file
/ \
18 ftp
://ftp.astron.com
/pub
/file
/
19 PKG_HASH
:=3735381563f69fb4239470b8c51b876a80425348b8285a7cded8b61d6b890eca
22 PKG_LICENSE_FILES
:=COPYING
28 include $(INCLUDE_DIR
)/package.mk
30 define Package
/file
/Default
31 TITLE
:=File type determination
32 URL
:=ftp
://ftp.astron.com
/pub
/file
/
33 MAINTAINER
:=Marko Ratkaj
<marko.ratkaj@sartura.hr
>
37 $(call Package
/file
/Default
)
44 define Package
/libmagic
45 $(call Package
/file
/Default
)
58 TARGET_CFLAGS
+= $(FPIC
)
60 define Build
/Compile
/magic
61 ( cd
$(PKG_BUILD_DIR
)/magic
/Magdir
; \
65 ) > $(PKG_BUILD_DIR
)/magic
/magic
67 Hooks
/Compile
/Post
+= Build
/Compile
/magic
69 define Build
/Install
/magic
70 $(INSTALL_DIR
) $(PKG_INSTALL_DIR
)/usr
/share
/file
71 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/magic
/magic
$(PKG_INSTALL_DIR
)/usr
/share
/file
/
73 Hooks
/Install
/Post
+= Build
/Install
/magic
75 define Build
/InstallDev
76 $(INSTALL_DIR
) $(1)/usr
/include
77 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/include/magic.h
$(1)/usr
/include/
78 $(INSTALL_DIR
) $(1)/usr
/lib
79 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/libmagic.
{a
,so
*} $(1)/usr
/lib
/
82 define Package
/file
/install
83 $(INSTALL_DIR
) $(1)/usr
/bin
84 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/file
$(1)/usr
/bin
/
85 $(INSTALL_DIR
) $(1)/usr
/share
/misc
86 $(SED
) "/^#/d" $(PKG_INSTALL_DIR
)/usr
/share
/file
/magic
87 $(SED
) "/^$$$$/d" $(PKG_INSTALL_DIR
)/usr
/share
/file
/magic
88 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/file
/magic
$(1)/usr
/share
/misc
/
90 # For some reason both "magic" and "magic.mgc" MUST exist
91 ln
-sf magic
$(1)/usr
/share
/misc
/magic.mgc
94 define Package
/libmagic
/install
95 $(INSTALL_DIR
) $(1)/usr
/lib
96 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libmagic.so.
* $(1)/usr
/lib
/
99 $(eval
$(call BuildPackage
,file
))
100 $(eval
$(call BuildPackage
,libmagic
))