23d0f0cdb775affa29c26cb44d1caeccae73ab6c
[openwrt/svn-archive/archive.git] / libs / file / Makefile
1 #
2 # Copyright (C) 2006 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
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=file
12 PKG_VERSION:=4.19
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
17 PKG_MD5SUM:=1b1e2b495c5aa20c08725f30545a110b
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libmagic
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+zlib
29 TITLE:=File type determination library
30 URL:=ftp://ftp.astron.com/pub/file/
31 endef
32
33 define Build/Configure
34 $(call Build/Configure/Default, \
35 --enable-shared \
36 --enable-static \
37 --disable-rpath \
38 --without-libiconv-prefix \
39 --without-libintl-prefix \
40 )
41 endef
42
43 define Build/Compile
44 $(MAKE) -C $(PKG_BUILD_DIR)/src \
45 DESTDIR="$(PKG_INSTALL_DIR)" \
46 all install
47 endef
48
49 define Build/InstallDev
50 mkdir -p $(STAGING_DIR)/usr/include
51 $(CP) $(PKG_INSTALL_DIR)/usr/include/magic.h $(STAGING_DIR)/usr/include/
52 mkdir -p $(STAGING_DIR)/usr/lib
53 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.{a,so*} $(STAGING_DIR)/usr/lib/
54 endef
55
56 define Build/UninstallDev
57 rm -rf \
58 $(STAGING_DIR)/usr/include/magic.h \
59 $(STAGING_DIR)/usr/lib/libmagic.{a,so*}
60 endef
61
62 define Package/libmagic/install
63 $(INSTALL_DIR) $(1)/usr/lib
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmagic.so.* $(1)/usr/lib/
65 endef
66
67 $(eval $(call BuildPackage,libmagic))