5dc878658cd734cda0e9b909c7ed1f2c2404c027
[openwrt.git] / package / utils / e2fsprogs / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 # Copyright 2010 Vertical Communications
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:=e2fsprogs
11 PKG_VERSION:=1.42.4
12 PKG_MD5SUM:=b6e296f210d642361b7394437ff0f318
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/e2fsprogs
17
18 PKG_BUILD_DEPENDS:=util-linux
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/e2fsprogs/Default
24   URL:=http://e2fsprogs.sourceforge.net/
25   SUBMENU:=Filesystem
26 endef
27
28 define Package/e2fsprogs
29 $(call Package/e2fsprogs/Default)
30   SECTION:=utils
31   CATEGORY:=Utilities
32   TITLE:=Ext2/3/4 filesystem utilities
33   DEPENDS:=+libuuid +libext2fs
34 endef
35
36 define Package/e2fsprogs/description
37  This package contains essential ext2 filesystem utilities which consists of
38  e2fsck, mke2fs and most of the other core ext2 filesystem utilities.
39 endef
40
41 define Package/libext2fs
42 $(call Package/e2fsprogs/Default)
43   SECTION:=libs
44   CATEGORY:=Libraries
45   TITLE:=ext2/3/4 filesystem library
46 endef
47
48 define Package/libext2fs/description
49  libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
50 endef
51
52 define Package/tune2fs
53 $(call Package/e2fsprogs)
54   TITLE:=Ext2 Filesystem tune utility
55   DEPENDS:= +e2fsprogs
56 endef
57
58 define Package/resize2fs
59 $(call Package/e2fsprogs)
60   TITLE:=Ext2 Filesystem resize utility
61   DEPENDS:= +e2fsprogs
62 endef
63
64 define Package/badblocks
65 $(call Package/e2fsprogs)
66   TITLE:=Ext2 Filesystem badblocks utility
67   DEPENDS:= +e2fsprogs
68 endef
69
70 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
71
72 CONFIGURE_VARS += \
73         ac_cv_lib_pthread_sem_init=no
74
75 CONFIGURE_ARGS += \
76         --disable-testio-debug \
77         --enable-elf-shlibs     \
78         --disable-libuuid       \
79         --enable-libblkid       \
80         --disable-uuidd         \
81         --disable-tls           \
82         --disable-nls           \
83         --disable-rpath
84
85 define Build/Prepare
86         $(call Build/Prepare/Default)
87         $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
88 endef
89
90 define Build/Compile
91         $(MAKE) -C $(PKG_BUILD_DIR)/util \
92                 BUILDCC="$(HOSTCC)" \
93                 CFLAGS="" \
94                 CPPFLAGS="" \
95                 LDFLAGS="" \
96                 subst
97         $(MAKE) -C $(PKG_BUILD_DIR) \
98                 LDFLAGS=-Wl,--gc-sections \
99                 BUILDCC="$(HOSTCC)" \
100                 DESTDIR="$(PKG_INSTALL_DIR)" \
101                 LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
102                 all
103 endef
104
105 define Package/e2fsprogs/install
106         $(INSTALL_DIR) $(1)/usr/sbin
107         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
108         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
109         ln -sf mke2fs $(1)/usr/sbin/mkfs.ext2
110         ln -sf mke2fs $(1)/usr/sbin/mkfs.ext3
111         ln -sf mke2fs $(1)/usr/sbin/mkfs.ext4
112         $(INSTALL_DIR) $(1)/usr/lib
113         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
114         $(INSTALL_DIR) $(1)/etc/init.d
115         $(INSTALL_DIR) $(1)/lib/functions/fsck
116         $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
117         $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
118 endef
119
120 define Package/libcom_err/install
121 endef
122
123 define Package/libext2fs/install
124         $(INSTALL_DIR) $(1)/usr/lib
125         $(CP) \
126                 $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* \
127                 $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* \
128                 $(1)/usr/lib/
129 endef
130
131 define Package/libext2fs/install_lib
132         $(INSTALL_DIR) $(1)/usr/lib
133         $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
134 endef
135
136 define Package/tune2fs/install
137         $(INSTALL_DIR) $(1)/usr/sbin
138         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
139 endef
140
141 define Package/resize2fs/install
142         $(INSTALL_DIR) $(1)/usr/sbin
143         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
144 endef
145
146 define Package/badblocks/install
147         $(INSTALL_DIR) $(1)/usr/sbin
148         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
149 endef
150
151 $(eval $(call BuildPackage,e2fsprogs))
152 $(eval $(call BuildPackage,libext2fs))
153 $(eval $(call BuildPackage,tune2fs))
154 $(eval $(call BuildPackage,resize2fs))
155 $(eval $(call BuildPackage,badblocks))