# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=partimage
pkgver=0.6.9
pkgrel=13
pkgdesc="Saves partitions having a supported filesystem to an image file"
options="!check" # No testsuite
url="https://www.partimage.org/"
arch="all"
license="GPL-2.0-or-later"
makedepends="linux-headers bzip2-dev newt-dev zlib-dev gettext-dev slang-dev
	openssl-dev>3 autoconf automake libtool"
subpackages="$pkgname-doc"
source="https://gitlab.com/partimage/partimage-sources/uploads/6f5867515e3267bad0e70b75410941f4/partimage-$pkgver.tar.bz2
	partimage-0.6.9-zlib-1.2.6.patch
	partimage-0.6.9-common.patch
	partimage-include-sysmacros.patch
	Use-SSLv3-by-default.patch
	openssl-1.1.patch
	musl-1.2.3-fix.patch
	"

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	export LIBS="$LIBS -lintl"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-nls
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
252885921b23933fdcdf0bb6efa4b82066b08ca95cc653296912d384ae875b421c1d39f347a90115315139176d4eab4a930c24919c2d38cf00ed29c764cd14d9  partimage-0.6.9.tar.bz2
f6feaf6967620ca5512aec50ada13e1b3676976ee2e04cebb3cd64c991ec8be47b337cd99c2656b3a1c77ce4ea25661784a8217f6d8325fd346f1d15463392ce  partimage-0.6.9-zlib-1.2.6.patch
39faba3b75302c0fb04e343b3854549c06447e28040f9c49a83d595533901e3c6af252a18d8db0394cbaabc7c9c1bde014f2d423cab80dadb6ea5322dc19a381  partimage-0.6.9-common.patch
bffd175117aa18f558521b0b33eeeb287b88e0c64e69209802e49f9284da72a7443eeb47b62de928f198e20ff0c06d86ffe3bb29fdb5119adf7bc9aa39b608f3  partimage-include-sysmacros.patch
580d9ef868b423fd77282839f619239f92789e202fc25cb2ee409ecc43424f89bd5d31314a6aba183ef36a61b427cb24a0ca1f62f53235b5bc60f574c5469a1b  Use-SSLv3-by-default.patch
bd1bc43bed6d6829ea8d15ff8b278807815de776c8f4fe1a86a1c3695dd3c8cadc155e5bcaf7f030ca8d0fac10ad3ad48a52a29cde15832511ae52fcc307edb6  openssl-1.1.patch
b20bc79d842bd2550057b0b6a45201205f5d03662365063b521c15eb80a2e079c362c28d8659fdefe4e4a0684058328f00681f5e01f1d80ccb2c1fdf15e7a3b2  musl-1.2.3-fix.patch
"
