aboutsummaryrefslogtreecommitdiffstats
path: root/community/rpm/APKBUILD
blob: 4d0fc026de386fe957fb316957e5954e818cedfd (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
# Contributor:
# Maintainer:
pkgname=rpm
pkgver=4.16.1.3
pkgrel=3
pkgdesc="Redhat Package Management utilities (RPM)"
url="https://rpm.org/"
arch="all"
license="GPL-2.0-or-later LGPL-2.0-or-later"
depends_dev="acl-dev binutils-dev bzip2-dev sqlite-dev file-dev libarchive-dev
	libcap-dev libgcrypt-dev popt-dev xz-dev zlib-dev"
makedepends="$depends_dev gettext-dev graphviz py3-setuptools python3-dev
	zstd-dev automake autoconf libtool"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang py3-rpm:py_rpm"
source="http://ftp.rpm.org/releases/rpm-${pkgver%.*.*}.x/rpm-$pkgver.tar.bz2
	musl.patch
	"

# secfixes:
#   4.16.1.3-r0:
#     - CVE-2021-3421
#     - CVE-2021-20271
#     - CVE-2021-20266

prepare() {
	# Switch to sqlite db by default, including during build-time tests
	sed -i -e "/_db_backend/ s/ bdb/ sqlite/g" macros.in

	default_prepare
	autoreconf -fi
}

build() {
	LIBS="$LIBS -lintl" \
	PYTHON=python3 \
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-cap \
		--with-acl \
		--without-lua \
		--enable-python \
		--enable-zstd=yes \
		--enable-sqlite=yes \
		--enable-bdb_ro=yes \
		--enable-bdb=no \
		--with-crypto=libgcrypt \
		--disable-plugins
	make
}

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

py_rpm() {
	pkgdesc="Python3 bindings for RPM"

	replaces="py-rpm" # Backwards compatibility
	provides="py-rpm=$pkgver-r$pkgrel" # Backwards compatibility

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib
}

sha512sums="54e503b32dffaa73d6168f26a00220d9d9124082d8a1eb1ddf34ce32a482f07cb06ec654cf065fca1607cc37b13fa7d4fa9895553541d7cfddecf68c9eb96f2e  rpm-4.16.1.3.tar.bz2
212a4265abc8d002e16bed106b8b773cf65564f95e6074bc1378c4745420202a476373b49b660bdfe82cc2470c35fff4f184168a698abfa2a4bf30c8f91e64ad  musl.patch"