add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt-10.03/.git] / package / e2fsprogs / 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:=e2fsprogs
12 PKG_VERSION:=1.39
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/e2fsprogs
17 PKG_MD5SUM:=06f7806782e357797fad1d34b7ced0c6
18 PKG_CAT:=zcat
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/e2fsprogs
23   SECTION:=utils
24   CATEGORY:=Utilities
25   TITLE:=Ext2/3 filesystem utilities
26   DESCRIPTION:=\
27         This package contains essential ext2 filesystem utilities which consists of \\\
28         e2fsck, mke2fs, debugfs, dumpe2fs, tune2fs, and most of the other core ext2 \\\
29         filesystem utilities.
30   URL:=http://e2fsprogs.sourceforge.net/
31 endef
32
33 define Package/tune2fs
34   $(call Package/e2fsprogs)
35   TITLE:=Ext2 Filesystem tune utility
36   DESCRIPTION:=Ext2 Filesystem tune utility
37   DEPENDS:=e2fsprogs
38 endef
39
40 define Package/resize2fs
41   $(call Package/e2fsprogs)
42   TITLE:=Ext2 Filesystem resize utility
43   DESCRIPTION:=Ext2 Filesystem resize utility
44   DEPENDS:=e2fsprogs
45 endef
46
47 CONFIGURE_ARGS += \
48         --enable-shared \
49         --enable-static \
50         --disable-rpath \
51         --enable-elf-shlibs \
52         --enable-dynamic-e2fsck
53
54 define Build/Compile
55         $(MAKE) -C $(PKG_BUILD_DIR)/util \
56                 BUILDCC="$(HOSTCC)" \
57                 CFLAGS="" \
58                 CPPFLAGS="" \
59                 LDFLAGS="" \
60                 subst
61         $(MAKE) -C $(PKG_BUILD_DIR) \
62                 BUILDCC="$(HOSTCC)" \
63                 DESTDIR="$(PKG_INSTALL_DIR)" \
64                 all install
65 endef
66
67 define Package/e2fsprogs/install
68         $(INSTALL_DIR) $(1)/usr/sbin
69         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
70         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
71         ln -sf mke2fs $(1)/usr/sbin/mkfs.ext2
72         ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
73         $(INSTALL_DIR) $(1)/usr/lib
74         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{blkid,com_err,e2p,ext2fs,uuid}.so.* $(1)/usr/lib/
75 endef
76
77 define Package/tune2fs/install
78         $(INSTALL_DIR) $(1)/usr/sbin
79         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
80 endef
81
82 define Package/resize2fs/install
83         $(INSTALL_DIR) $(1)/usr/sbin
84         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
85 endef
86
87 $(eval $(call BuildPackage,e2fsprogs))
88 $(eval $(call BuildPackage,tune2fs))
89 $(eval $(call BuildPackage,resize2fs))