xref: /OK3568_Linux_fs/buildroot/package/e2fsprogs/e2fsprogs.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# e2fsprogs
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunE2FSPROGS_VERSION = 1.46.5
8*4882a593SmuzhiyunE2FSPROGS_SOURCE = e2fsprogs-$(E2FSPROGS_VERSION).tar.xz
9*4882a593SmuzhiyunE2FSPROGS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/people/tytso/e2fsprogs/v$(E2FSPROGS_VERSION)
10*4882a593SmuzhiyunE2FSPROGS_LICENSE = GPL-2.0, MIT-like with advertising clause (libss and libet)
11*4882a593SmuzhiyunE2FSPROGS_LICENSE_FILES = NOTICE lib/ss/mit-sipb-copyright.h lib/et/internal.h
12*4882a593SmuzhiyunE2FSPROGS_CPE_ID_VENDOR = e2fsprogs_project
13*4882a593SmuzhiyunE2FSPROGS_INSTALL_STAGING = YES
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunE2FSPROGS_MAKE = $(MAKE1)
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun# 0001-libext2fs-add-sanity-check-to-extent-manipulation.patch
18*4882a593SmuzhiyunE2FSPROGS_IGNORE_CVES += CVE-2022-1304
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun# Use libblkid and libuuid from util-linux for host and target packages.
21*4882a593Smuzhiyun# This prevents overriding them with e2fsprogs' ones, which may cause
22*4882a593Smuzhiyun# problems for other packages.
23*4882a593SmuzhiyunE2FSPROGS_DEPENDENCIES = host-pkgconf util-linux
24*4882a593SmuzhiyunHOST_E2FSPROGS_DEPENDENCIES = host-pkgconf host-util-linux
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunE2FSPROGS_SELINUX_MODULES = fstools
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun# e4defrag doesn't build on older systems like RHEL5.x, and we don't
29*4882a593Smuzhiyun# need it on the host anyway.
30*4882a593Smuzhiyun# Disable fuse2fs as well to avoid carrying over deps, and it's unused
31*4882a593SmuzhiyunHOST_E2FSPROGS_CONF_OPTS = \
32*4882a593Smuzhiyun	--disable-defrag \
33*4882a593Smuzhiyun	--disable-e2initrd-helper \
34*4882a593Smuzhiyun	--disable-fuse2fs \
35*4882a593Smuzhiyun	--disable-fsck \
36*4882a593Smuzhiyun	--disable-libblkid \
37*4882a593Smuzhiyun	--disable-libuuid \
38*4882a593Smuzhiyun	--disable-testio-debug \
39*4882a593Smuzhiyun	--enable-symlink-install \
40*4882a593Smuzhiyun	--enable-elf-shlibs \
41*4882a593Smuzhiyun	--with-crond-dir=no \
42*4882a593Smuzhiyun	--with-udev-rules-dir=no \
43*4882a593Smuzhiyun	--with-systemd-unit-dir=no
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun# Set the binary directories to "/bin" and "/sbin", as busybox does,
46*4882a593Smuzhiyun# so that we do not end up with two versions of e2fs tools.
47*4882a593SmuzhiyunE2FSPROGS_CONF_OPTS = \
48*4882a593Smuzhiyun	--bindir=/bin \
49*4882a593Smuzhiyun	--sbindir=/sbin \
50*4882a593Smuzhiyun	$(if $(BR2_STATIC_LIBS),--disable-elf-shlibs,--enable-elf-shlibs) \
51*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_E2FSPROGS_DEBUGFS),--enable-debugfs,--disable-debugfs) \
52*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_E2FSPROGS_E2IMAGE),--enable-imager,--disable-imager) \
53*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_E2FSPROGS_E4DEFRAG),--enable-defrag,--disable-defrag) \
54*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_E2FSPROGS_FSCK),--enable-fsck,--disable-fsck) \
55*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_E2FSPROGS_RESIZE2FS),--enable-resizer,--disable-resizer) \
56*4882a593Smuzhiyun	--disable-uuidd \
57*4882a593Smuzhiyun	--disable-libblkid \
58*4882a593Smuzhiyun	--disable-libuuid \
59*4882a593Smuzhiyun	--disable-e2initrd-helper \
60*4882a593Smuzhiyun	--disable-testio-debug \
61*4882a593Smuzhiyun	--disable-rpath \
62*4882a593Smuzhiyun	--enable-symlink-install
63*4882a593Smuzhiyun
64*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_E2FSPROGS_FUSE2FS),y)
65*4882a593SmuzhiyunE2FSPROGS_CONF_OPTS += --enable-fuse2fs
66*4882a593SmuzhiyunE2FSPROGS_DEPENDENCIES += libfuse
67*4882a593Smuzhiyunelse
68*4882a593SmuzhiyunE2FSPROGS_CONF_OPTS += --disable-fuse2fs
69*4882a593Smuzhiyunendif
70*4882a593Smuzhiyun
71*4882a593Smuzhiyunifeq ($(BR2_nios2),y)
72*4882a593SmuzhiyunE2FSPROGS_CONF_ENV += ac_cv_func_fallocate=no
73*4882a593Smuzhiyunendif
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunE2FSPROGS_CONF_ENV += ac_cv_path_LDCONFIG=true
76*4882a593Smuzhiyun
77*4882a593SmuzhiyunHOST_E2FSPROGS_CONF_ENV += ac_cv_path_LDCONFIG=true
78*4882a593Smuzhiyun
79*4882a593SmuzhiyunE2FSPROGS_INSTALL_STAGING_OPTS = \
80*4882a593Smuzhiyun	DESTDIR=$(STAGING_DIR) \
81*4882a593Smuzhiyun	install-libs
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun# e2scrub has no associated --enable/disable option
84*4882a593Smuzhiyunifneq ($(BR2_PACKAGE_E2FSPROGS_E2SCRUB),y)
85*4882a593SmuzhiyunE2FSPROGS_MAKE_OPTS += E2SCRUB_DIR=
86*4882a593Smuzhiyunendif
87*4882a593Smuzhiyun
88*4882a593SmuzhiyunE2FSPROGS_INSTALL_TARGET_OPTS = \
89*4882a593Smuzhiyun	$(E2FSPROGS_MAKE_OPTS) \
90*4882a593Smuzhiyun	DESTDIR=$(TARGET_DIR) \
91*4882a593Smuzhiyun	install
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun# Package does not build in parallel due to improper make rules
94*4882a593Smuzhiyundefine HOST_E2FSPROGS_INSTALL_CMDS
95*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D) install install-libs
96*4882a593Smuzhiyunendef
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun# Remove compile_et which raises a build failure with samba4
99*4882a593Smuzhiyundefine HOST_E2FSPROGS_REMOVE_COMPILE_ET
100*4882a593Smuzhiyun	$(RM) $(HOST_DIR)/bin/compile_et
101*4882a593Smuzhiyunendef
102*4882a593SmuzhiyunHOST_E2FSPROGS_POST_INSTALL_HOOKS += HOST_E2FSPROGS_REMOVE_COMPILE_ET
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun$(eval $(autotools-package))
105*4882a593Smuzhiyun$(eval $(host-autotools-package))
106