aboutsummaryrefslogtreecommitdiffstats
path: root/community/rpm/APKBUILD
blob: de01ed69ef9a8af34417e8c52fb339eb7bfa79be (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
# Contributor:
# Maintainer:
pkgname=rpm
pkgver=4.17.1
pkgrel=0
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 lua5.3-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
	autoconf-lua5.3.patch
	"

# secfixes:
#   4.17.1-r0:
#     - CVE-2021-3521
#   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="
d0429510140f25a25b6c9441abe2027d27c485bbd4969752f69e1c843435c9508b9f85e5bb68085dd64b7da533801aa5c04d8c9d962e08d2ddd3199d0265cc85  rpm-4.17.1.tar.bz2
31d9487ade2d382f0a63f13a95a41307a5686370a2a7cdabd20d07fb190e2c3b40e5033530e5bae8c3d8f3cee7de53269e46d300506f0b975e2a0d917fdbd9e8  musl.patch
0931e7a3803a86cce2e61a1af1204cb4b402841bcd05d450c850d5cb470012c6321b91ad365f76cf4472b2a5e4b5ea6c177df60cf33b4e87a6e6109c60f27072  autoconf-lua5.3.patch
"