aboutsummaryrefslogtreecommitdiffstats
path: root/main/e2fsprogs/APKBUILD
blob: c0ea044bf6d69f270741e0fdb0e01b26fc60dfc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=e2fsprogs
pkgver=1.47.0
pkgrel=5
pkgdesc="Standard Ext2/3/4 filesystem utilities"
url="https://e2fsprogs.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause AND MIT"
depends_dev="util-linux-dev gawk"
# XXX: build hack to upgrade live on builders
makedepends="$depends_dev musl>1.2.3_git20230322-r2 linux-headers fuse-dev"
checkdepends="diffutils perl coreutils"
subpackages="
	$pkgname-static
	$pkgname-dev
	libcom_err
	fuse2fs
	fuse2fs-doc:fuse2fs_doc:noarch
	$pkgname-doc
	$pkgname-libs
	$pkgname-extra
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/tytso/e2fsprogs/archive/v$pkgver.tar.gz
	lfs64.patch
	"

case $CHOST in
	riscv64*)
		# j_recover_fast_commit appears to be a false negative due to a compiler
		# bug or hardware bug
		#
		# https://marc.info/?l=linux-ext4&m=161307702015761&w=2
		options="!check"
		;;
esac

# secfixes:
#   1.45.5-r0:
#     - CVE-2019-5188
#   1.45.4-r0:
#     - CVE-2019-5094

build() {
	CFLAGS="$CFLAGS -flto=auto" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--mandir=/usr/share/man \
		--enable-elf-shlibs \
		--enable-symlink-install \
		--disable-fsck \
		--disable-uuidd \
		--disable-libuuid \
		--disable-libblkid \
		--disable-nls
	make
}

check() {
	# Disable failing test
	rm -rf tests/m_offset*

	# Failing on CI
	rm -rf tests/f_bigalloc_orphan_list*

	# Fails on armhf on CI
	rm -rf tests/f_extent_htree*

	# Fails on builders with less than 4TB free space
	rm -rf tests/m_hugefile

	make check
}

package() {
	make -j1 DESTDIR="$pkgdir" install install-libs
	mv "$pkgdir"/sbin/* "$pkgdir"/usr/sbin/
	local i; for i in e2fsck mke2fs mkfs.* fsck.*; do
		mv "$pkgdir"/usr/sbin/$i "$pkgdir"/sbin/
	done
}

dev() {
	default_dev

	amove \
		usr/bin/compile_et \
		usr/bin/mk_cmds \
		usr/share/et \
		usr/share/ss
}

libcom_err() {
	pkgdesc="Common error description library"

	amove lib/libcom_err*
}

fuse2fs() {
	pkgdesc="Ext2/3/4 filesystem driver for FUSE"
	amove usr/bin/fuse2fs
}

fuse2fs_doc() {
	pkgdesc="Ext2/3/4 filesystem driver for FUSE (documentation)"
	install_if="fuse2fs=$pkgver-r$pkgrel docs"

	amove usr/share/man/man1/fuse2fs.1
	gzip -9 "$subpkgdir"/usr/share/man/man1/fuse2fs.1
}

extra() {
	depends="$pkgname=$pkgver-r$pkgrel"
	pkgdesc="Ext2/3/4 filesystem extra utilities"

	mkdir -p "$subpkgdir"
	amove usr
	rmdir "$pkgdir"/lib || true
}

sha512sums="
9cb895f7deed8ee513595b7c232db8345cb7e54e6cbb33e6eeab31c860c892cbc9d721756ac1429e6731e219e1c6aacc25075d517e979397c66bf764bc8bc9fa  e2fsprogs-1.47.0.tar.gz
9b97f91529844ad04a613d61ef762951859640d2677b4e37648ecc7cfbfc0b4831e8f3e49ad952fc16267d53e6e7c6cf588350a3e36edc2e22779f43d9ef17cf  lfs64.patch
"