source: packages/libs/file/Makefile @ 14746

Last change on this file since 14746 was 14746, checked in by nbd, 8 years ago

file: cannot use quotes in package titles

  • Property copyright set to Copyright (C) 2007 OpenWrt.org
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1#
2# Copyright (C) 2007 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id$
8
9include $(TOPDIR)/rules.mk
10
11PKG_NAME:=file
12PKG_VERSION:=4.26
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
17PKG_MD5SUM:=74cd5466416136da30a4e69f74dbc7a0
18
19include $(INCLUDE_DIR)/package.mk
20
21define Package/libmagic
22  SECTION:=libs
23  CATEGORY:=Libraries
24  DEPENDS:=+zlib
25  TITLE:=Determines file type using 'magic' numbers
26  URL:=ftp://ftp.astron.com/pub/file/
27endef
28
29define Package/file
30  SECTION:=utils
31  CATEGORY:=Utilities
32  DEPENDS:=+libmagic
33  TITLE:=Determines file type using 'magic' numbers
34  URL:=ftp://ftp.astron.com/pub/file/
35endef
36
37define Package/file/description
38 File tests each argument in an attempt to classify it. There
39 are three sets of tests, performed in this order: filesystem
40 tests, magic number tests, and language tests. The first test
41 that succeeds causes the file type to be printed.
42
43 Starting with version 4, the file command is not much more than
44 a wrapper around the "magic" library.
45endef
46
47TARGET_CFLAGS += $(FPIC)
48
49CONFIGURE_ARGS += \
50        --enable-shared \
51        --enable-static \
52        --disable-rpath \
53        --without-libiconv-prefix \
54        --without-libintl-prefix \
55
56MAKE_FLAGS += \
57        -C $(PKG_BUILD_DIR)/src \
58        DESTDIR="$(PKG_INSTALL_DIR)" \
59        all install \
60
61define Build/Prepare
62        $(call Build/Prepare/Default)
63        chmod -R u+w $(PKG_BUILD_DIR)
64endef
65
66define Build/InstallDev
67        mkdir -p $(1)/usr/include
68        $(CP) $(PKG_INSTALL_DIR)/usr/include/magic.h $(1)/usr/include/
69        mkdir -p $(1)/usr/lib
70        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(1)/usr/lib/
71endef
72
73define Package/libmagic/install
74        $(INSTALL_DIR) $(1)/usr/lib
75        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
76endef
77
78define Package/file/install
79        $(INSTALL_DIR) $(1)/usr/bin
80        $(INSTALL_DIR) $(1)/usr/share/file
81        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/file $(1)/usr/bin
82        (cd $(PKG_BUILD_DIR)/magic/Magdir; rm -f magic.mime; for file in `ls`; do cat $$$${file} >> magic.mime; done)
83        $(INSTALL_DATA) $(PKG_BUILD_DIR)/magic/Magdir/magic.mime $(1)/usr/share/file/magic
84endef
85
86$(eval $(call BuildPackage,libmagic))
87$(eval $(call BuildPackage,file))
Note: See TracBrowser for help on using the repository browser.