summaryrefslogtreecommitdiff
path: root/system/lvm2/APKBUILD
blob: 0b9d4428d7fabf502c4a09c543d85d45f54ac608 (plain) (blame)
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
126
127
128
129
130
131
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=lvm2
pkgver=2.02.181
pkgrel=0
pkgdesc="Logical Volume Manager 2 utilities"
url="http://sourceware.org/lvm2/"
arch="all"
options="!check"  # Test tries to use real /dev/mapper/control.
license="GPL-2.0+ AND LGPL-2.1-only"
# lvm2 will dlopen libs so we need to add explicit depend
depends="lvm2-libs=$pkgver-r$pkgrel"
depends_dev="linux-headers"
makedepends_build="coreutils libaio-dev"
makedepends_host="$depends_dev util-linux-dev"
makedepends="$makedepends_build $makedepends_host"
source="https://mirrors.kernel.org/sourceware/$pkgname/LVM2.$pkgver.tgz
	fix-stdio-usage.patch
	mallinfo.patch
	library_dir-default-config.patch
	mlockall-default-config.patch
	lvm.initd
	lvm.confd
	dmeventd.initd
	"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-dmeventd
	$pkgname-openrc
	device-mapper:dm
	device-mapper-libs:dm_libs
	device-mapper-event-libs:dm_event_libs
	$pkgname-libs
	$pkgname-extra::noarch
	"

builddir="$srcdir/LVM2.$pkgver"

build () {
	cd "$builddir"

	# during cross-compilation malloc test goes wrong
	export ac_cv_func_malloc_0_nonnull=yes
	export ac_cv_func_realloc_0_nonnull=yes

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--libdir=/lib \
		--sbindir=/sbin \
		--localstatedir=/var \
		--disable-readline \
		--enable-pkgconfig \
		--enable-applib \
		--with-thin=internal \
		--enable-dmeventd \
		--enable-cmdlib \
		--with-thin-check=/sbin/thin_check \
		--with-thin-dump=/sbin/thin_dump \
		--with-thin-repair=/sbin/thin_repair \
		--with-dmeventd-path=/sbin/dmeventd \
		CLDFLAGS="$LDFLAGS"
	make
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install
	install -d "$pkgdir"/etc/lvm/archive "$pkgdir"/etc/lvm/backup
	install -Dm755 "$srcdir"/lvm.initd "$pkgdir"/etc/init.d/lvm
	install -Dm644 "$srcdir"/lvm.confd "$pkgdir"/etc/conf.d/lvm
	ln -s libdevmapper.so.1.02 "$pkgdir"/lib/libdevmapper.so
}

dmeventd() {
	pkgdesc="Device-mapper event daemon"
	mkdir -p "$subpkgdir"/sbin
	mv "$pkgdir"/sbin/dmeventd "$subpkgdir"/sbin/
	install -Dm755 "$srcdir"/dmeventd.initd "$subpkgdir"/etc/init.d/dmeventd
}

dm() {
	pkgdesc="Device mapper userspace library and tools from LVM2"
	mkdir -p "$subpkgdir"/sbin "$subpkgdir"/lib
	mv "$pkgdir"/sbin/dm* "$subpkgdir"/sbin/
}

libs() {
	pkgdesc="LVM2 shared libraries"
	depends=
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/liblvm2*.so.* "$subpkgdir"/lib/
	mv "$pkgdir"/lib/libdevmapper-event-lvm2*.so.* "$subpkgdir"/lib/
	mv "$pkgdir"/lib/device-mapper "$subpkgdir"/lib/
}

dm_libs() {
	pkgdesc="Device-mapper shared library"
	depends=
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/libdevmapper.so.* "$subpkgdir"/lib/
}

dm_event_libs() {
	pkgdesc="Device-mapper event daemon shared library"
	depends=
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/libdevmapper-event.so.* "$subpkgdir"/lib/
}

extra() {
	pkgdesc="LVM2 extra utilities"
	depends="bash coreutils"
	local util
	for util in sbin/lvmdump sbin/lvmconf sbin/fsadm sbin/blkdeactivate; do
		mkdir -p "$subpkgdir/${util%/*}"
		mv $pkgdir/$util $subpkgdir/$util
	done
}

sha512sums="599d992823510e27f3ec3ceaf0d2332402b731afc0d2df88096ab55ed98dba8c3bdc5408d51b9f5b0ffbbb9ac3760ee37b878a0f36ab379449dc076c58e59511  LVM2.2.02.181.tgz
6ea4efad03f8632f2883f33f9d9f8ca295f7d8d2aa1bfbfa7738e7d711727a511758848dde5776b222bd74e6fb60bed8b56a3cd2f74ca448b8d86f50470a42b9  fix-stdio-usage.patch
9272ec8c5184ef5dc776ead8f74132e072b7563b5119a3a38b712f00d92a1e3878c9b3a54eb2b01dcba038110c686b39d4c17ecd0eb258537e9217d7ed03c408  mallinfo.patch
33004594a5cce7af1e493a2a66ce8ad2f864dde3b2ec0960d0fda9df9b7bcf65d9455f9eccf7860f48726c48f14111b843b0a0c9bd395ef2952b41aaab8092b2  library_dir-default-config.patch
d190c40a137b006d7b63298069c93ff08d2804b990e85d44739cd7c48beec9a569903b98f0d940895fc7365723ba886acd7ef0e08f1f65a1a391d1c448ce080e  mlockall-default-config.patch
a853078660fd2fd943538924f56e81dc5793294e26b8f61d93e6188893f15f4a438d33792b341c1865d61e03f4a371b7c7ee0db5f4130ef7cb7aeaeb9290086a  lvm.initd
07caf8fa942290f3c953cc2463aaf55bac01d0bcb9351daf3880fa4d0eefb67fe00761c46a7a4da91cd2f8e492a12fed35853a15dc939cd80d19d3303bc3951d  lvm.confd
ca06220065525e93347efb7a5746a367cf55cb03574e50eed29bd7c4eae036bdd199b52c42d81811b6e742649e73ab8e66525f663bed66f9d1d82d0efde50332  dmeventd.initd"