2010-02-18 13:10:21 +00:00
|
|
|
#
|
2010-02-19 00:14:01 +00:00
|
|
|
# Copyright (C) 2007-2010 OpenWrt.org
|
2007-01-10 17:06:20 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=file
|
2008-11-28 17:34:44 +00:00
|
|
|
PKG_VERSION:=4.26
|
2010-02-19 00:14:01 +00:00
|
|
|
PKG_RELEASE:=2
|
2007-01-10 17:06:20 +00:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
|
2008-11-28 17:34:44 +00:00
|
|
|
PKG_MD5SUM:=74cd5466416136da30a4e69f74dbc7a0
|
2007-01-10 17:06:20 +00:00
|
|
|
|
2010-02-19 00:14:01 +00:00
|
|
|
PKG_FIXUP:=libtool
|
2010-02-18 13:10:21 +00:00
|
|
|
PKG_INSTALL:=1
|
|
|
|
|
2007-01-10 17:06:20 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2010-04-06 09:26:42 +00:00
|
|
|
define Package/file/Default
|
|
|
|
TITLE:=File type determination
|
2007-01-10 17:06:20 +00:00
|
|
|
URL:=ftp://ftp.astron.com/pub/file/
|
|
|
|
endef
|
|
|
|
|
2007-07-13 14:12:55 +00:00
|
|
|
define Package/file
|
2010-04-06 09:26:42 +00:00
|
|
|
$(call package/file/Default)
|
2007-07-13 14:12:55 +00:00
|
|
|
SECTION:=utils
|
|
|
|
CATEGORY:=Utilities
|
2010-04-06 09:26:42 +00:00
|
|
|
TITLE+= utility
|
2007-07-13 14:12:55 +00:00
|
|
|
DEPENDS:=+libmagic
|
|
|
|
endef
|
|
|
|
|
2010-04-06 09:26:42 +00:00
|
|
|
define Package/libmagic
|
|
|
|
$(call package/file/Default)
|
|
|
|
SECTION:=libs
|
|
|
|
CATEGORY:=Libraries
|
|
|
|
TITLE+= library
|
|
|
|
DEPENDS:=+zlib
|
2007-01-10 17:06:20 +00:00
|
|
|
endef
|
|
|
|
|
2010-04-06 09:26:42 +00:00
|
|
|
CONFIGURE_ARGS += \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
|
|
|
|
|
|
|
MAKE_PATH := src
|
2010-02-18 13:10:21 +00:00
|
|
|
|
2008-08-06 22:43:15 +00:00
|
|
|
TARGET_CFLAGS += $(FPIC)
|
|
|
|
|
2010-04-06 09:26:42 +00:00
|
|
|
define Build/Compile/magic
|
|
|
|
( cd $(PKG_BUILD_DIR)/magic/Magdir; \
|
|
|
|
for f in `ls`; do \
|
|
|
|
cat $$$${f}; \
|
|
|
|
done \
|
|
|
|
) > $(PKG_BUILD_DIR)/magic/magic
|
2010-02-18 13:10:21 +00:00
|
|
|
endef
|
2010-04-06 09:26:42 +00:00
|
|
|
Hooks/Compile/Post += Build/Compile/magic
|
2007-09-18 09:09:31 +00:00
|
|
|
|
2010-04-06 09:26:42 +00:00
|
|
|
define Build/Install/magic
|
|
|
|
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/file
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic $(PKG_INSTALL_DIR)/usr/share/file/
|
2008-10-08 16:31:20 +00:00
|
|
|
endef
|
2010-04-06 09:26:42 +00:00
|
|
|
Hooks/Install/Post += Build/Install/magic
|
2008-10-08 16:31:20 +00:00
|
|
|
|
2007-01-10 17:06:20 +00:00
|
|
|
define Build/InstallDev
|
2009-12-18 11:06:19 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/include
|
2007-10-07 03:20:26 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
|
2009-12-18 11:06:19 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
2007-10-07 03:20:26 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
|
2007-01-10 17:06:20 +00:00
|
|
|
endef
|
|
|
|
|
2007-07-13 14:12:55 +00:00
|
|
|
define Package/file/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
2010-04-06 09:26:42 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin/
|
2007-07-13 14:12:55 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/share/file
|
2010-04-06 09:26:42 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/share/file/magic $(1)/usr/share/file/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/libmagic/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/lib
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
|
2007-07-13 14:12:55 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,file))
|
2010-04-06 09:26:42 +00:00
|
|
|
$(eval $(call BuildPackage,libmagic))
|