42c297152941e38bd5f7f09568abbcf66dfb7ad8
[openwrt/staging/pepe2k.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.47.0
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
16 PKG_HASH:=144af53f2bbd921cef6f8bea88bb9faddca865da3fbc657cc9b4d2001097d5db
17
18 PKG_LICENSE:=GPL-2.0
19 PKG_LICENSE_FILES:=NOTICE
20 PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
21
22 PKG_BUILD_DEPENDS:=util-linux e2fsprogs/host
23 PKG_INSTALL:=1
24
25 PKG_BUILD_PARALLEL:=1
26 PKG_BUILD_FLAGS:=gc-sections lto
27
28 include $(INCLUDE_DIR)/package.mk
29 include $(INCLUDE_DIR)/host-build.mk
30
31 define Package/e2fsprogs
32 SECTION:=utils
33 CATEGORY:=Utilities
34 SUBMENU:=Filesystem
35 TITLE:=Ext2/3/4 filesystem utilities
36 URL:=http://e2fsprogs.sourceforge.net/
37 DEPENDS:=+libuuid +libext2fs
38 endef
39
40 define Package/e2fsprogs/description
41 This package contains essential ext2 filesystem utilities which consists of
42 e2fsck, mke2fs and most of the other core ext2 filesystem utilities.
43 endef
44
45 define Package/libext2fs
46 SECTION:=libs
47 CATEGORY:=Libraries
48 TITLE:=ext2/3/4 filesystem library
49 URL:=http://e2fsprogs.sourceforge.net/
50 DEPENDS:=+libuuid +libblkid +libss +libcomerr
51 ABI_VERSION:=2
52 endef
53
54 define Package/libext2fs/description
55 libext2fs is a library which can access ext2, ext3 and ext4 filesystems.
56 endef
57
58 define Package/libss
59 SECTION:=libs
60 CATEGORY:=Libraries
61 TITLE:=command-line interface parsing library
62 URL:=http://e2fsprogs.sourceforge.net/
63 DEPENDS:=+libcomerr
64 ABI_VERSION:=2
65 endef
66
67 define Package/libss/description
68 This pacakge contains libss, a command-line interface parsing library
69 bundled with e2fsprogs.
70 endef
71
72 define Package/libcomerr
73 SECTION:=libs
74 CATEGORY:=Libraries
75 TITLE:=common error description library
76 URL:=http://e2fsprogs.sourceforge.net/
77 DEPENDS:=+libuuid
78 ABI_VERSION:=0
79 endef
80
81 define Package/libcomerr/description
82 This package contains libcom_err, the common error description library
83 bundled with e2fsprogs.
84 endef
85
86 define Package/tune2fs
87 $(call Package/e2fsprogs)
88 TITLE:=Ext2 Filesystem tune utility
89 DEPENDS:= +e2fsprogs
90 endef
91
92 define Package/resize2fs
93 $(call Package/e2fsprogs)
94 TITLE:=Ext2 Filesystem resize utility
95 DEPENDS:= +e2fsprogs
96 endef
97
98 define Package/badblocks
99 $(call Package/e2fsprogs)
100 TITLE:=Ext2 Filesystem badblocks utility
101 DEPENDS:= +e2fsprogs
102 endef
103
104 define Package/dumpe2fs
105 $(call Package/e2fsprogs)
106 TITLE:=Ext2 Filesystem information dumping utility
107 DEPENDS:= +e2fsprogs
108 endef
109
110 define Package/e2freefrag
111 $(call Package/e2fsprogs)
112 TITLE:=Ext2 Filesystem free space fragmentation information utility
113 DEPENDS:= +e2fsprogs
114 endef
115
116 define Package/e4crypt
117 $(call Package/e2fsprogs)
118 TITLE:=Ext4 Filesystem encryption utility
119 DEPENDS:= +e2fsprogs
120 endef
121
122 define Package/filefrag
123 $(call Package/e2fsprogs)
124 TITLE:=Ext2 Filesystem file fragmentation report utility
125 DEPENDS:= +e2fsprogs
126 endef
127
128 define Package/debugfs
129 $(call Package/e2fsprogs)
130 TITLE:=Ext2 Filesystem debugger
131 DEPENDS:= +e2fsprogs
132 endef
133
134 define Package/chattr
135 $(call Package/e2fsprogs)
136 TITLE:=Ext2 Filesystem chattr utility
137 DEPENDS:= +e2fsprogs
138 endef
139
140 define Package/lsattr
141 $(call Package/e2fsprogs)
142 TITLE:=Ext2 Filesystem lsattr utility
143 DEPENDS:= +e2fsprogs
144 endef
145
146 TARGET_CFLAGS += $(FPIC)
147
148 CONFIGURE_ARGS += \
149 --disable-testio-debug \
150 --enable-elf-shlibs \
151 --disable-libuuid \
152 --disable-libblkid \
153 --disable-uuidd \
154 --disable-tls \
155 --disable-nls \
156 --disable-rpath \
157 --disable-fuse2fs
158
159 ifneq ($(CONFIG_USE_MUSL),)
160 CONFIGURE_VARS += ac_cv_func_lseek64=yes
161 endif
162
163 define Build/Prepare
164 $(call Build/Prepare/Default)
165 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/
166 endef
167
168 define Build/Compile
169 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/util \
170 BUILDCC="$(HOSTCC)" \
171 CFLAGS="" \
172 CPPFLAGS="" \
173 LDFLAGS="" \
174 V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
175 subst
176 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
177 BUILDCC="$(HOSTCC)" \
178 DESTDIR="$(PKG_INSTALL_DIR)" \
179 ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \
180 SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \
181 V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
182 all
183 endef
184
185 define Build/InstallDev
186 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
187 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/ext2fs.pc $(1)/usr/lib/pkgconfig
188 $(CP) $(PKG_BUILD_DIR)/lib/et/com_err.pc $(1)/usr/lib/pkgconfig
189
190 $(INSTALL_DIR) $(1)/usr/lib
191 $(CP) $(PKG_BUILD_DIR)/lib/libext2fs.{so,a}* $(1)/usr/lib
192 $(CP) $(PKG_BUILD_DIR)/lib/libcom_err.{so,a}* $(1)/usr/lib
193 $(CP) $(PKG_BUILD_DIR)/lib/libss.{so,a}* $(1)/usr/lib
194
195 $(INSTALL_DIR) $(1)/usr/include/ext2fs
196 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/*.h $(1)/usr/include/ext2fs
197 $(INSTALL_DIR) $(1)/usr/include/et
198 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/et/*.h $(1)/usr/include/et
199 # Apparently there is some confusion
200 echo "#include <et/com_err.h>" > $(1)/usr/include/com_err.h
201 $(INSTALL_DIR) $(1)/usr/include/ss
202 $(CP) \
203 $(PKG_BUILD_DIR)/lib/ss/ss.h \
204 $(PKG_BUILD_DIR)/lib/ss/ss_err.h \
205 $(1)/usr/include/ss/
206 endef
207
208 define Host/Compile
209 $(MAKE) $(PKG_JOBS) -C $(HOST_BUILD_DIR)/lib/ss mk_cmds
210 $(MAKE) $(PKG_JOBS) -C $(HOST_BUILD_DIR)/lib/et compile_et
211 endef
212
213 define Host/Install
214 $(INSTALL_DIR) $(1)/share/et
215 $(CP) $(HOST_BUILD_DIR)/lib/et/et_[ch].awk $(1)/share/et/
216 $(INSTALL_DIR) $(1)/share/ss
217 $(CP) $(HOST_BUILD_DIR)/lib/ss/ct_c.{sed,awk} $(1)/share/ss/
218 $(INSTALL_DIR) $(1)/bin
219 $(CP) \
220 $(HOST_BUILD_DIR)/lib/et/compile_et \
221 $(HOST_BUILD_DIR)/lib/ss/mk_cmds \
222 $(1)/bin/
223 endef
224
225 define Package/e2fsprogs/conffiles
226 /etc/e2fsck.conf
227 endef
228
229 define Package/e2fsprogs/install
230 $(INSTALL_DIR) $(1)/usr/sbin
231 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/
232 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/
233 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext2
234 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext3
235 $(LN) mke2fs $(1)/usr/sbin/mkfs.ext4
236 $(LN) e2fsck $(1)/usr/sbin/fsck.ext2
237 $(LN) e2fsck $(1)/usr/sbin/fsck.ext3
238 $(LN) e2fsck $(1)/usr/sbin/fsck.ext4
239 $(INSTALL_DIR) $(1)/usr/lib
240 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/
241 $(INSTALL_DIR) $(1)/etc/init.d
242 $(INSTALL_DIR) $(1)/lib/functions/fsck
243 $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/
244 $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf
245 endef
246
247 define Package/libcomerr/install
248 $(INSTALL_DIR) $(1)/usr/lib
249 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* $(1)/usr/lib/
250 endef
251
252 define Package/libss/install
253 $(INSTALL_DIR) $(1)/usr/lib
254 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libss.so.* $(1)/usr/lib/
255 endef
256
257 define Package/libext2fs/install
258 $(INSTALL_DIR) $(1)/usr/lib
259 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* $(1)/usr/lib/
260 endef
261
262 define Package/libext2fs/install_lib
263 $(INSTALL_DIR) $(1)/usr/lib
264 $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a
265 endef
266
267 define Package/tune2fs/install
268 $(INSTALL_DIR) $(1)/usr/sbin
269 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/
270 $(LN) tune2fs $(1)/usr/sbin/findfs
271 endef
272
273 define Package/resize2fs/install
274 $(INSTALL_DIR) $(1)/usr/sbin
275 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/
276 endef
277
278 define Package/badblocks/install
279 $(INSTALL_DIR) $(1)/usr/sbin
280 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/
281 endef
282
283 define Package/dumpe2fs/install
284 $(INSTALL_DIR) $(1)/usr/sbin
285 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dumpe2fs $(1)/usr/sbin/
286 endef
287
288 define Package/e2freefrag/install
289 $(INSTALL_DIR) $(1)/usr/sbin
290 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2freefrag $(1)/usr/sbin/
291 endef
292
293 define Package/e4crypt/install
294 $(INSTALL_DIR) $(1)/usr/sbin
295 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e4crypt $(1)/usr/sbin/
296 endef
297
298 define Package/filefrag/install
299 $(INSTALL_DIR) $(1)/usr/sbin
300 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/filefrag $(1)/usr/sbin/
301 endef
302
303 define Package/debugfs/install
304 $(INSTALL_DIR) $(1)/usr/sbin
305 $(INSTALL_DIR) $(1)/usr/lib
306 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/debugfs $(1)/usr/sbin/
307 endef
308
309 define Package/chattr/install
310 $(INSTALL_DIR) $(1)/usr/bin
311 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chattr $(1)/usr/bin/
312 endef
313
314 define Package/lsattr/install
315 $(INSTALL_DIR) $(1)/usr/bin
316 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsattr $(1)/usr/bin/
317 endef
318
319 $(eval $(call BuildPackage,libcomerr))
320 $(eval $(call BuildPackage,libss))
321 $(eval $(call BuildPackage,libext2fs))
322 $(eval $(call BuildPackage,e2fsprogs))
323 $(eval $(call BuildPackage,tune2fs))
324 $(eval $(call BuildPackage,resize2fs))
325 $(eval $(call BuildPackage,badblocks))
326 $(eval $(call BuildPackage,dumpe2fs))
327 $(eval $(call BuildPackage,e2freefrag))
328 $(eval $(call BuildPackage,e4crypt))
329 $(eval $(call BuildPackage,filefrag))
330 $(eval $(call BuildPackage,debugfs))
331 $(eval $(call BuildPackage,chattr))
332 $(eval $(call BuildPackage,lsattr))
333 $(eval $(call HostBuild))