utils/e2fsprogs: Update to 1.43.5
[openwrt/openwrt.git] / package / utils / e2fsprogs / Makefile
1 #
2 # Copyright (C) 2006-2014 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.43.5
12 PKG_HASH:=261f3d9ade383fbf032a19140c9c25e998cc0f71a1ae686614fb3ae0eb955a17
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
17 PKG_LICENSE:=GPL-2.0
18
19 PKG_BUILD_DEPENDS:=util-linux
20 PKG_INSTALL:=1
21
22 PKG_BUILD_PARALLEL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/e2fsprogs/Default
27 URL:=http://e2fsprogs.sourceforge.net/
28 SUBMENU:=Filesystem
29 endef
30
31 define Package/e2fsprogs
32 $(call Package/e2fsprogs/Default)
33 SECTION:=utils
34 CATEGORY:=Utilities
35 TITLE:=Ext2/3/4 filesystem utilities
36 DEPENDS:=+libuuid +libext2fs
37 endef
38
39 define Package/e2fsprogs/description
40 This package contains essential ext2 filesystem utilities which consists of
41 e2fsck, mke2fs and most of the other core ext2 filesystem utilities.
42 endef
43
44 define Package/libext2fs
45 $(call Package/e2fsprogs/Default)
46 SECTION:=libs
47 CATEGORY:=Libraries
48 DEPENDS:=+libuuid
49 TITLE:=ext2/3/4 filesystem library
50 endef
51
52 define Package/libext2fs/description
53 libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
54 endef
55
56 define Package/tune2fs
57 $(call Package/e2fsprogs)
58 TITLE:=Ext2 Filesystem tune utility
59 DEPENDS:= +e2fsprogs
60 endef
61
62 define Package/resize2fs
63 $(call Package/e2fsprogs)
64 TITLE:=Ext2 Filesystem resize utility
65 DEPENDS:= +e2fsprogs
66 endef
67
68 define Package/badblocks
69 $(call Package/e2fsprogs)
70 TITLE:=Ext2 Filesystem badblocks utility
71 DEPENDS:= +e2fsprogs
72 endef
73
74 define Package/dumpe2fs
75 $(call Package/e2fsprogs)
76 TITLE:=Ext2 Filesystem information dumping utility
77 DEPENDS:= +e2fsprogs
78 endef
79
80 define Package/e2freefrag
81 $(call Package/e2fsprogs)
82 TITLE:=Ext2 Filesystem free space fragmentation information utility
83 DEPENDS:= +e2fsprogs
84 endef
85
86 define Package/filefrag
87 $(call Package/e2fsprogs)
88 TITLE:=Ext2 Filesystem file fragmentation report utility
89 DEPENDS:= +e2fsprogs
90 endef
91
92 define Package/debugfs
93 $(call Package/e2fsprogs)
94 TITLE:=Ext2 Filesystem debugger
95 DEPENDS:= +e2fsprogs
96 endef
97
98 define Package/chattr
99 $(call Package/e2fsprogs)
100 TITLE:=Ext2 Filesystem chattr utility
101 DEPENDS:= +e2fsprogs
102 endef
103
104 define Package/lsattr
105 $(call Package/e2fsprogs)
106 TITLE:=Ext2 Filesystem lsattr utility
107 DEPENDS:= +e2fsprogs
108 endef
109
110 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
111
112 CONFIGURE_VARS += \
113 ac_cv_lib_pthread_sem_init=no
114
115 CONFIGURE_ARGS += \
116 --disable-testio-debug \
117 --enable-elf-shlibs \
118 --disable-libuuid \
119 --enable-libblkid \
120 --disable-uuidd \
121 --disable-tls \
122 --disable-nls \
123 --disable-rpath
124
125 define Build/Prepare
126 $(call Build/Prepare/Default)
127 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
128 endef
129
130 define Build/Compile
131 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/util \
132 BUILDCC="$(HOSTCC)" \
133 CFLAGS="" \
134 CPPFLAGS="" \
135 LDFLAGS="" \
136 V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
137 subst
138 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
139 LDFLAGS=-Wl,--gc-sections \
140 BUILDCC="$(HOSTCC)" \
141 DESTDIR="$(PKG_INSTALL_DIR)" \
142 LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \
143 ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \
144 SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \
145 V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
146 all
147 endef
148
149 define Build/InstallDev
150 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
151 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/ext2fs.pc $(1)/usr/lib/pkgconfig
152 $(CP) $(PKG_BUILD_DIR)/lib/et/com_err.pc $(1)/usr/lib/pkgconfig
153
154 $(INSTALL_DIR) $(1)/usr/lib
155 $(CP) $(PKG_BUILD_DIR)/lib/libext2fs.{so,a}* $(1)/usr/lib
156 $(CP) $(PKG_BUILD_DIR)/lib/libcom_err.{so,a}* $(1)/usr/lib
157
158 $(INSTALL_DIR) $(1)/usr/include/ext2fs
159 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/*.h $(1)/usr/include/ext2fs
160 $(INSTALL_DIR) $(1)/usr/include/et
161 $(CP) $(PKG_BUILD_DIR)/lib/et/*.h $(1)/usr/include/et
162 endef
163
164 define Package/e2fsprogs/conffiles
165 /etc/e2fsck.conf
166 endef
167
168 define Package/e2fsprogs/install
169 $(INSTALL_DIR) $(1)/usr/sbin
170 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
171 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
172 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext2
173 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext3
174 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext4
175 $(LN) e2fsck $(1)/usr/sbin/fsck.ext2
176 $(LN) e2fsck $(1)/usr/sbin/fsck.ext3
177 $(LN) e2fsck $(1)/usr/sbin/fsck.ext4
178 $(INSTALL_DIR) $(1)/usr/lib
179 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
180 $(INSTALL_DIR) $(1)/etc/init.d
181 $(INSTALL_DIR) $(1)/lib/functions/fsck
182 $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
183 $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
184 endef
185
186 define Package/libcom_err/install
187 endef
188
189 define Package/libext2fs/install
190 $(INSTALL_DIR) $(1)/usr/lib
191 $(CP) \
192 $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* \
193 $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* \
194 $(1)/usr/lib/
195 endef
196
197 define Package/libext2fs/install_lib
198 $(INSTALL_DIR) $(1)/usr/lib
199 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
200 endef
201
202 define Package/tune2fs/install
203 $(INSTALL_DIR) $(1)/usr/sbin
204 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
205 $(LN) tune2fs $(1)/usr/sbin/findfs
206 endef
207
208 define Package/resize2fs/install
209 $(INSTALL_DIR) $(1)/usr/sbin
210 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
211 endef
212
213 define Package/badblocks/install
214 $(INSTALL_DIR) $(1)/usr/sbin
215 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
216 endef
217
218 define Package/dumpe2fs/install
219 $(INSTALL_DIR) $(1)/usr/sbin
220 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dumpe2fs $(1)/usr/sbin/
221 endef
222
223 define Package/e2freefrag/install
224 $(INSTALL_DIR) $(1)/usr/sbin
225 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2freefrag $(1)/usr/sbin/
226 endef
227
228 define Package/filefrag/install
229 $(INSTALL_DIR) $(1)/usr/sbin
230 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/filefrag $(1)/usr/sbin/
231 endef
232
233 define Package/debugfs/install
234 $(INSTALL_DIR) $(1)/usr/sbin
235 $(INSTALL_DIR) $(1)/usr/lib
236 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/debugfs $(1)/usr/sbin/
237 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libss.so.* $(1)/usr/lib/
238 endef
239
240 define Package/chattr/install
241 $(INSTALL_DIR) $(1)/usr/bin
242 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chattr $(1)/usr/bin/
243 endef
244
245 define Package/lsattr/install
246 $(INSTALL_DIR) $(1)/usr/bin
247 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsattr $(1)/usr/bin/
248 endef
249
250 $(eval $(call BuildPackage,e2fsprogs))
251 $(eval $(call BuildPackage,libext2fs))
252 $(eval $(call BuildPackage,tune2fs))
253 $(eval $(call BuildPackage,resize2fs))
254 $(eval $(call BuildPackage,badblocks))
255 $(eval $(call BuildPackage,dumpe2fs))
256 $(eval $(call BuildPackage,e2freefrag))
257 $(eval $(call BuildPackage,filefrag))
258 $(eval $(call BuildPackage,debugfs))
259 $(eval $(call BuildPackage,chattr))
260 $(eval $(call BuildPackage,lsattr))