APKBUILD 2.25 KB
Newer Older
1
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
A. Wilcox's avatar
A. Wilcox committed
2
pkgname=bzip2
Max Rees's avatar
Max Rees committed
3
4
pkgver=1.0.8
pkgrel=0
5
pkgdesc="Block-sorting file compressor"
Max Rees's avatar
Max Rees committed
6
url="https://www.sourceware.org/bzip2/"
A. Wilcox's avatar
A. Wilcox committed
7
arch="all"
8
license="BSD-4-Clause"
A. Wilcox's avatar
A. Wilcox committed
9
10
depends=""
subpackages="$pkgname-dev $pkgname-doc libbz2"
Max Rees's avatar
Max Rees committed
11
source="https://sourceware.org/pub/bzip2/$pkgname-$pkgver.tar.gz
A. Wilcox's avatar
A. Wilcox committed
12
	bzip2-1.0.4-makefile-CFLAGS.patch
Max Rees's avatar
Max Rees committed
13
	bzip2-1.0.8-saneso.patch
A. Wilcox's avatar
A. Wilcox committed
14
15
16
17
	bzip2-1.0.4-man-links.patch
	bzip2-1.0.2-progress.patch
	bzip2-1.0.3-no-test.patch
	"
Max Rees's avatar
Max Rees committed
18
builddir="$srcdir/$pkgname-$pkgver"
A. Wilcox's avatar
A. Wilcox committed
19
20
21

# secfixes:
#   1.0.6-r5:
Max Rees's avatar
Max Rees committed
22
23
24
#     - CVE-2016-3189
#   1.0.8-r0:
#     - CVE-2019-12900
A. Wilcox's avatar
A. Wilcox committed
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

prepare() {
	default_prepare

	# Fix man path
	# Generate relative symlinks
	sed -i \
		-e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
		-e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
		Makefile

	# fixup broken version stuff
	sed -i \
		-e "s:1\.0\.4:$pkgver:" \
		bzip2.1 bzip2.txt Makefile-libbz2_so manual.*
}

build () {
	make -f Makefile-libbz2_so all
	make all
}

check() {
	make check
}

package() {
	make PREFIX="$pkgdir"/usr install
	install -D libbz2.so.$pkgver "$pkgdir"/usr/lib/libbz2.so.$pkgver
	ln -s libbz2.so.$pkgver "$pkgdir"/usr/lib/libbz2.so
	ln -s libbz2.so.$pkgver "$pkgdir"/usr/lib/libbz2.so.${pkgver%%.*}
}

libbz2() {
59
	pkgdesc="$pkgdesc (libraries)"
A. Wilcox's avatar
A. Wilcox committed
60
61
62
63
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.so.* "$subpkgdir"/usr/lib/
}

Max Rees's avatar
Max Rees committed
64
sha512sums="083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3  bzip2-1.0.8.tar.gz
A. Wilcox's avatar
A. Wilcox committed
65
58cc37430555520b6e35db2740e699cf37eacdd82989c21a222a593e36288710a0defb003662d4238235c12b3764bfc89cd646e6be9d0a08d54bd2c9baa6ad15  bzip2-1.0.4-makefile-CFLAGS.patch
Max Rees's avatar
Max Rees committed
66
bc52f6efc63ac8d06fcbbb0446cc9c8025964ba0651ef493b5a124e838bf03bebb0ef56247fdd007265c8ea091f3458e832a53856228e7fefa4d20a55065bba3  bzip2-1.0.8-saneso.patch
A. Wilcox's avatar
A. Wilcox committed
67
68
2d9a306bc0f552a58916ebc702d32350a225103c487e070d2082121a54e07f1813d3228f43293cc80a4bee62053fd597294c99a1751b1685cd678f4e5c6a2fe7  bzip2-1.0.4-man-links.patch
b6810c73428f17245e0d7c2decd00c88986cd8ad1cfe4982defe34bdab808d53870ed92cb513b2d00c15301747ceb6ca958fb0e0458d0663b7d8f7c524f7ba4e  bzip2-1.0.2-progress.patch
Max Rees's avatar
Max Rees committed
69
aefcafaaadc7f19b20fe023e0bd161127b9f32e0cd364621f6e5c03e95fb976e7e69e354ec46673a554392519532a3bfe56d982a5cde608c10e0b18c3847a030  bzip2-1.0.3-no-test.patch"