[package] polipo: Add maintainer to Makefile
[openwrt/svn-archive/archive.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/libmagic
24 SECTION:=libs
25 CATEGORY:=Libraries
26 DEPENDS:=+zlib
27 TITLE:=Determines file type using 'magic' numbers
28 URL:=ftp://ftp.astron.com/pub/file/
29 endef
30
31 define Package/file
32 SECTION:=utils
33 CATEGORY:=Utilities
34 DEPENDS:=+libmagic
35 TITLE:=Determines file type using 'magic' numbers
36 URL:=ftp://ftp.astron.com/pub/file/
37 endef
38
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.
44
45 Starting with version 4, the file command is not much more than
46 a wrapper around the "magic" library.
47 endef
48
49 MAKE_PATH:=src
50
51 TARGET_CFLAGS += $(FPIC)
52
53 define Build/Configure
54 $(call Build/Configure/Default, \
55 --enable-shared \
56 --enable-static \
57 --disable-rpath \
58 --without-libiconv-prefix \
59 --without-libintl-prefix \
60 )
61 endef
62
63 define Build/Prepare
64 $(call Build/Prepare/Default)
65 chmod -R u+w $(PKG_BUILD_DIR)
66 endef
67
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/
73 endef
74
75 define Package/libmagic/install
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
78 endef
79
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
86 endef
87
88 $(eval $(call BuildPackage,libmagic))
89 $(eval $(call BuildPackage,file))