aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libc6/APKBUILD
blob: 2eb91a2192d0771499800fb00ddb3d02b971a292 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=libc6
pkgver=2.14
pkgrel=0
svnrev=14663
pkgdesc="Embedded GNU C Library"
url="http://eglibc.org/"
arch=""
license="LGPL"
depends=
depends_dev="linux-headers>=2.6.18"
provides="libiconv"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-dev
	     $pkgname-doc

	     gconv-modules:gconv
	     locales
	     nscd"
options="!strip"
source="http://dev.alpinelinux.org/~nenolod/eglibc-${pkgver}.r${svnrev}.tar.gz

	glibc-2.12-hardened-pie.patch
	glibc-2.10-hardened-configure-picdefault.patch
	glibc-2.10-hardened-inittls-nosysenter.patch

	chk_fail.c
	stack_chk_fail.c

	nscd.initd"

_srcdir="$srcdir"/eglibc-$pkgver
_builddir="$srcdir"/eglibc-build
prepare() {
	local i
	cd "$_srcdir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	echo "slibdir=/lib" >> configparms

	cp "$srcdir"/chk_fail.c "$_srcdir"/debug/chk_fail.c
	cp "$srcdir"/stack_chk_fail.c "$_srcdir"/debug/stack_chk_fail.c

	mkdir "$_builddir"
}

build() {
	cd "$_builddir"

	export CFLAGS="$CFLAGS -fno-stack-protector"

	"$_srcdir"/configure --prefix=/usr \
		--sysconfdir=/etc \
		--libdir=/usr/lib \
		--libexecdir=/usr/lib \
		--with-headers=/usr/include \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-kernel=2.6.18 \
		--enable-add-ons=nptl,libidn \
		--disable-profile \
		--enable-bind-now \
		--with-tls \
		--with-__thread \
		--without-zoneinfo \
		--without-cvs \
		--without-gd \
		--with-pkgversion="Alpine EGLIBC ${pkgver}-r${pkgrel} [svn r${svnrev}]" \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make install_root="$pkgdir" install || return 1
}

gconv() {
	pkgdesc="GNU iconv character modules"

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

locales() {
	pkgdesc="Common files for locale support"

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

nscd() {
	pkgdesc="Cache daemon for NIS/DNS"

	mkdir -p "$subpkgdir"/var/db/nscd
	mkdir -p "$subpkgdir"/var/run/nscd

	install -Dm 755 "$srcdir"/nscd.initd "$subpkgdir"/etc/init.d/nscd
	install -Dm 644 "$srcdir"/libc/nscd/nscd.conf "$subpkgdir"/etc/nscd.conf

	mkdir -p "$subpkgdir"/usr/sbin
	mv "$pkgdir"/usr/sbin/nscd "$subpkgdir"/usr/sbin
}

md5sums="c6de1455fcef3487ee42c14349a72cf4  eglibc-2.14.r14663.tar.gz
03ffc414f8eb9f1fcb93325008f5ecd7  glibc-2.12-hardened-pie.patch
8bca42eb8f6d117107ab8e356566b805  glibc-2.10-hardened-configure-picdefault.patch
d3b50eec50099791bf2f0c10b605ff7c  glibc-2.10-hardened-inittls-nosysenter.patch
1b31d2c7a39298da10e3840076514823  chk_fail.c
6a6b9992c76a9bece219eb00a16d7549  stack_chk_fail.c
ff0b0069eeb662145d287d7f98c79447  nscd.initd"