xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-extended/parted/parted_3.4.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Disk partition editing/resizing utility"
2*4882a593SmuzhiyunHOMEPAGE = "http://www.gnu.org/software/parted/parted.html"
3*4882a593SmuzhiyunDESCRIPTION = "GNU Parted manipulates partition tables. This is useful for creating space for new operating systems, reorganizing disk usage, copying data on hard disks and disk imaging."
4*4882a593SmuzhiyunLICENSE = "GPL-3.0-or-later"
5*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
6*4882a593SmuzhiyunSECTION = "console/tools"
7*4882a593SmuzhiyunDEPENDS = "ncurses util-linux virtual/libiconv"
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunSRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
10*4882a593Smuzhiyun           file://fix-doc-mandir.patch \
11*4882a593Smuzhiyun           file://run-ptest \
12*4882a593Smuzhiyun           file://check-vfat.patch \
13*4882a593Smuzhiyun           "
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunSRC_URI[md5sum] = "357d19387c6e7bc4a8a90fe2d015fe80"
16*4882a593SmuzhiyunSRC_URI[sha256sum] = "e1298022472da5589b7f2be1d5ee3c1b66ec3d96dfbad03dc642afd009da5342"
17*4882a593Smuzhiyun
18*4882a593Smuzhiyuninherit autotools pkgconfig gettext texinfo ptest
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunPACKAGECONFIG ?= "readline"
21*4882a593SmuzhiyunPACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper lvm2"
22*4882a593SmuzhiyunPACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunBBCLASSEXTEND = "native nativesdk"
25*4882a593Smuzhiyun
26*4882a593Smuzhiyundo_compile_ptest() {
27*4882a593Smuzhiyun	oe_runmake -C tests print-align print-max dup-clobber duplicate fs-resize print-flags
28*4882a593Smuzhiyun}
29*4882a593Smuzhiyun
30*4882a593Smuzhiyundo_install_ptest() {
31*4882a593Smuzhiyun	t=${D}${PTEST_PATH}
32*4882a593Smuzhiyun	mkdir $t/build-aux
33*4882a593Smuzhiyun	cp ${S}/build-aux/test-driver $t/build-aux/
34*4882a593Smuzhiyun	cp -r ${S}/tests $t
35*4882a593Smuzhiyun	cp ${B}/tests/Makefile $t/tests/
36*4882a593Smuzhiyun	mkdir $t/lib
37*4882a593Smuzhiyun	cp ${B}/lib/config.h $t/lib
38*4882a593Smuzhiyun	sed -i "s|^VERSION.*|VERSION = ${PV}|g" $t/tests/Makefile
39*4882a593Smuzhiyun	sed -i "s|^srcdir =.*|srcdir = \.|g" $t/tests/Makefile
40*4882a593Smuzhiyun	sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" $t/tests/Makefile
41*4882a593Smuzhiyun	sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = "${PTEST_PATH}"|g" $t/tests/Makefile
42*4882a593Smuzhiyun	sed -i "s|^abs_top_builddir =.*|abs_top_builddir = "${PTEST_PATH}"|g" $t/tests/Makefile
43*4882a593Smuzhiyun	sed -i "s|^Makefile:.*|Makefile:|g" $t/tests/Makefile
44*4882a593Smuzhiyun	sed -i "/^BUILDINFO.*$/d" $t/tests/Makefile
45*4882a593Smuzhiyun	for i in print-align print-max print-flags dup-clobber duplicate fs-resize; \
46*4882a593Smuzhiyun	  do cp ${B}/tests/.libs/$i $t/tests/; \
47*4882a593Smuzhiyun	done
48*4882a593Smuzhiyun	sed -e 's| ../parted||' -i $t/tests/*.sh
49*4882a593Smuzhiyun}
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunRDEPENDS:${PN}-ptest = "bash coreutils perl util-linux-losetup util-linux-mkswap python3 make gawk e2fsprogs-mke2fs e2fsprogs-tune2fs python3-core dosfstools"
52*4882a593SmuzhiyunRRECOMMENDS:${PN}-ptest += "kernel-module-scsi-debug kernel-module-loop kernel-module-vfat"
53*4882a593SmuzhiyunRDEPENDS:${PN}-ptest:append:libc-glibc = "\
54*4882a593Smuzhiyun        glibc-utils \
55*4882a593Smuzhiyun        locale-base-en-us \
56*4882a593Smuzhiyun        "
57*4882a593Smuzhiyun
58*4882a593Smuzhiyuninherit update-alternatives
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunALTERNATIVE_PRIORITY = "100"
61*4882a593SmuzhiyunALTERNATIVE:${PN} = "partprobe"
62*4882a593SmuzhiyunALTERNATIVE_LINK_NAME[partprobe] = "${sbindir}/partprobe"
63