upgrade ethtool
[packages.git] / libs / file / Makefile
1 #
2 # Copyright (C) 2007-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=file
11 PKG_VERSION:=4.26
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
16 PKG_MD5SUM:=74cd5466416136da30a4e69f74dbc7a0
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/file/Default
24   TITLE:=File type determination
25   URL:=ftp://ftp.astron.com/pub/file/
26 endef
27
28 define Package/file
29 $(call package/file/Default)
30   SECTION:=utils
31   CATEGORY:=Utilities
32   TITLE+= utility
33   DEPENDS:=+libmagic
34 endef
35
36 define Package/libmagic
37 $(call package/file/Default)
38   SECTION:=libs
39   CATEGORY:=Libraries
40   TITLE+= library
41   DEPENDS:=+zlib
42 endef
43
44 CONFIGURE_ARGS += \
45         --enable-shared \
46         --enable-static \
47
48 MAKE_PATH := src
49
50 TARGET_CFLAGS += $(FPIC)
51
52 define Build/Compile/magic
53         ( cd $(PKG_BUILD_DIR)/magic/Magdir; \
54                 for f in `ls`; do \
55                         cat $$$${f}; \
56                 done \
57         ) > $(PKG_BUILD_DIR)/magic/magic
58 endef
59 Hooks/Compile/Post += Build/Compile/magic
60
61 define Build/Install/magic
62         $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/share/file
63         $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/magic $(PKG_INSTALL_DIR)/usr/share/file/
64 endef
65 Hooks/Install/Post += Build/Install/magic
66
67 define Build/InstallDev
68         $(INSTALL_DIR) $(1)/usr/include
69         $(CP) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
70         $(INSTALL_DIR) $(1)/usr/lib
71         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
72 endef
73
74 define Package/file/install
75         $(INSTALL_DIR) $(1)/usr/bin
76         $(CP) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin/
77         $(INSTALL_DIR) $(1)/usr/share/file
78         $(CP) $(PKG_INSTALL_DIR)/usr/share/file/magic $(1)/usr/share/file/
79 endef
80
81 define Package/libmagic/install
82         $(INSTALL_DIR) $(1)/usr/lib
83         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
84 endef
85
86 $(eval $(call BuildPackage,file))
87 $(eval $(call BuildPackage,libmagic))