aboutsummaryrefslogtreecommitdiffstats
path: root/main/dpkg/APKBUILD
blob: ad4cc74005457efd178a94e8b126121ad509232f (plain)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dpkg
pkgver=1.20.5
pkgrel=2
pkgdesc="The Debian Package Manager"
url="https://wiki.debian.org/Teams/Dpkg"
arch="all"
license="GPL-2.0-or-later BSD-2-Clause"
depends="tar"
checkdepends="gzip xz coreutils"
makedepends="bzip2-dev linux-headers perl zlib-dev po4a"
subpackages="$pkgname-doc $pkgname-static $pkgname-dev"
source="https://deb.debian.org/debian/pool/main/d/dpkg/dpkg_$pkgver.tar.xz
	0001-t-command-Fix-test_command_exec-program-invocation.patch
	time_t.patch"

prepare() {
	default_prepare

	# On the builders /home/buildozer has S_ISGID set this is
	# inherited in $srcdir and causes some dpkg test to end up with
	# a permission mismatch. To fix this remove the S_ISGID from
	# $srcdir.
	chmod -R g-s "$srcdir"

	# This test fails with:
	#
	#   dpkg-checkbuilddeps: error: Unmet build dependencies: build-essential:native
	#
	# Probably unfixable as we don't have a build-essential dpkg package.
	sed -i "$builddir"/scripts/Makefile.in \
		-e '/dpkg_buildpackage\.t/d'
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-libz \
		--with-libbz2 \
		--disable-dselect \
		--disable-start-stop-daemon \
		--disable-nls \
		--disable-static
	make
}

check() {
	make check
}

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

	# Add missing dir & files
	install -d "$pkgdir/var/$pkgname"/updates/

	touch "$pkgdir/var/lib/$pkgname"/status
	touch "$pkgdir/var/lib/$pkgname"/available
}

dev() {
	default_dev
	pkgdesc="Debian package development tools"
	depends="perl"
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/share \
		"$subpkgdir"/usr/lib/dpkg

	mv "$pkgdir"/usr/bin/dpkg-architecture \
		"$pkgdir"/usr/bin/dpkg-buildpackage \
		"$pkgdir"/usr/bin/dpkg-checkbuilddeps \
		"$pkgdir"/usr/bin/dpkg-distaddfile \
		"$pkgdir"/usr/bin/dpkg-genchanges \
		"$pkgdir"/usr/bin/dpkg-gencontrol \
		"$pkgdir"/usr/bin/dpkg-gensymbols \
		"$pkgdir"/usr/bin/dpkg-mergechangelogs \
		"$pkgdir"/usr/bin/dpkg-name \
		"$pkgdir"/usr/bin/dpkg-parsechangelog \
		"$pkgdir"/usr/bin/dpkg-scanpackages \
		"$pkgdir"/usr/bin/dpkg-scansources \
		"$pkgdir"/usr/bin/dpkg-shlibdeps \
		"$pkgdir"/usr/bin/dpkg-source \
		"$pkgdir"/usr/bin/dpkg-vendor \
		"$subpkgdir"/usr/bin/

	mv "$pkgdir"/usr/share/perl* "$subpkgdir"/usr/share/
}

sha512sums="6b3789c25c81022181b87a28ca9baa4a463a68940a871568c699a2a30e3b4ce705835ed6a171ac8c5902e377200b31cc0be1e03cbd7d35c4eaf92c7300d9227f  dpkg_1.20.5.tar.xz
059875c06146382f1e4a339860c558a71393a43bf9e6580c0a2211c629cc9be1b4fd12c900b002f833a241ad9a339f138b458b60664da06db5b32db1c6490b2f  0001-t-command-Fix-test_command_exec-program-invocation.patch
4eb01daac6d1079bcac1450b52c0d052de2c2f0341feafb4b5e2b23b7c191c9ce21d2e8e3b9ea917f8f81162229c4575bbf62f1d1f38da21b7dfd1fe80569bce  time_t.patch"