aboutsummaryrefslogtreecommitdiffstats
path: root/main/perl/APKBUILD
blob: a559a81f1a21c17b33654fa239526821c504e4a0 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl
pkgver=5.22.3
pkgrel=0
pkgdesc="Larry Wall's Practical Extraction and Report Language"
url=http://www.perl.org
arch="all"
license="Artistic GPL2"
source="http://www.cpan.org/src/5.0/perl-$pkgver.tar.gz
	CVE-2017-12837.patch
	CVE-2017-12883.patch
	"
options="!fhs"

depends=
depends_dev="perl"
makedepends=
subpackages="$pkgname-dev $pkgname-doc miniperl"

# secfixes:
#   5.22.3-r0:
#   - CVE-2016-1238
#   - CVE-2017-12837
#   - CVE-2017-12883

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	cd $_builddir
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	sed -i -e 's/less -R/less/g' ./Configure
	sed -i -e 's/libswanted="\(.*\) nsl\(.*\)"/libswanted="\1\2"/g' ./Configure
}

_privlib=/usr/share/perl5/core_perl
_archlib=/usr/lib/perl5/core_perl
_vendorlib=/usr/share/perl5/vendor_perl
_vendorarch=/usr/lib/perl5/vendor_perl

build() {
	cd $_builddir
	./Configure -des \
		-Dcccdlflags='-fPIC' \
		-Dcccdlflags='-fPIC' \
		-Dccdlflags='-rdynamic' \
		-Dprefix=/usr \
		-Dprivlib=$_privlib \
		-Darchlib=$_archlib \
		-Dvendorprefix=/usr \
		-Dvendorlib=$_vendorlib \
		-Dvendorarch=$_vendorarch \
		-Dsiteprefix=/usr/local \
		-Dsitelib=/usr/local/share/perl5/site_perl \
		-Dsitearch=/usr/local/lib/perl5/site_perl \
		-Dlocincpth=' ' \
		-Doptimize="${CFLAGS}" \
		-Duselargefiles \
		-Dusethreads \
		-Duseshrplib \
		-Dd_semctl_semun \
		-Dman1dir=/usr/share/man/man1 \
		-Dman3dir=/usr/share/man/man3 \
		-Dinstallman1dir=/usr/share/man/man1 \
		-Dinstallman3dir=/usr/share/man/man3 \
		-Dman1ext='1' \
		-Dman3ext='3pm' \
		-Dinc_version_list="$inclist" \
		-Dcf_by='Alpine' \
		-Ud_csh \
		-Dusenm \
		|| return 1
	make libperl.so && make || return 1
#	make check || return 1
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make install DESTDIR="$pkgdir"
	if [ -n "$(find $pkgdir/usr/local -type f)" ]; then
		error "files found under /usr/local"
		return 1
	fi
}

miniperl() {
	pkgname=miniperl
	mkdir -p "$subpkgdir"/usr/bin
	cp "$srcdir/perl-$pkgver"/miniperl "$subpkgdir/usr/bin"
}

dev() {
	mkdir -p "$subpkgdir"/$_privlib
	mv "$pkgdir"/$_privlib/Encode "$subpkgdir"/$_privlib/ || return 1
	default_dev
	replaces="perl"
	mkdir -p "$subpkgdir"/usr/bin
	for i in enc2xs h2xs libnetcfg perlivp; do
		mv "$pkgdir"/usr/bin/$i "$subpkgdir"/usr/bin/ || return 1
	done
}

md5sums="aa4f236dc2fc6f88b871436b8d0fda95  perl-5.22.3.tar.gz
87bcffe2858d6a4d231e041bec899c5c  CVE-2017-12837.patch
da495ec183af5a9386274587b4733620  CVE-2017-12883.patch"
sha256sums="1b351fb4df7e62ec3c8b2a9f516103595b2601291f659fef1bbe3917e8410083  perl-5.22.3.tar.gz
f8b16e586981ccd60308aaaa44243c1933536f373241f196f0a8f260893903ad  CVE-2017-12837.patch
42197cd029998b56aa90d3fff9acee29f4f58ac9f8a240f96fd04a231e2bcb4b  CVE-2017-12883.patch"
sha512sums="e0ec42ed99f565ee045ce188a2a22fc294f043a6983fe7dcc896ef5df30a05124f1ba0faea62ce128df769f9f12fae0f11422c7f63e95470534689ebbcbef272  perl-5.22.3.tar.gz
3125c66f7a810c24aad8ea7228cda9254f854b6cced0479c9d297879ccb8561469cf99d9b2a95df5fc1d23b485999d720d2cf1e2385d93510a700514e610e302  CVE-2017-12837.patch
40a3cfb663c7f1946a7b24dc97defd8f32889efb5d611e6ebef90b3dd3a5073de14728887ce028dbdd95aeb46e2dd05a0fa690ea580d6d108df751e43e1662f6  CVE-2017-12883.patch"