summaryrefslogtreecommitdiffstats
path: root/main/eglibc/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'main/eglibc/APKBUILD')
-rw-r--r--main/eglibc/APKBUILD130
1 files changed, 130 insertions, 0 deletions
diff --git a/main/eglibc/APKBUILD b/main/eglibc/APKBUILD
new file mode 100644
index 000000000..7079766f8
--- /dev/null
+++ b/main/eglibc/APKBUILD
@@ -0,0 +1,130 @@
+# Contributor: Carlo Landmeter
+# Maintainer:
+pkgname=eglibc
+pkgver=2.12
+pkgrel=3
+pkgdesc="Embedded GLIBC is a variant of the GNU C Library that is designed to work well on embedded systems"
+url="http://www.eglibc.org"
+license="GPL"
+depends=""
+depends_dev="linux-headers=>2.6.32"
+makedepends="gawk"
+options="!strip"
+subpackages="$pkgname-dev $pkgname-gconv $pkgname-locales $pkgname-nscd"
+source="http://alpine.nethq.org/clandmeter/src/eglibc-2.12-svn-11364.tar.bz2
+ glibc-2.10-bz4781.patch
+ glibc-__i686.patch
+ nscd.initd
+"
+
+_builddir="$srcdir"/libc
+
+prepare() {
+ cd "$_builddir"
+
+ # http://sources.redhat.com/bugzilla/show_bug.cgi?id=4781
+ patch -Np1 -i ${srcdir}/glibc-2.10-bz4781.patch
+
+ # http://sources.redhat.com/bugzilla/show_bug.cgi?id=411
+ # http://sourceware.org/ml/libc-alpha/2009-07/msg00072.html
+ patch -Np1 -i ${srcdir}/glibc-__i686.patch
+
+ # Don not build timezones
+ sed -i 's/timezone rt/rt/' Makeconfig
+
+ echo "slibdir=/lib" >> configparms
+
+ # we need to build in a seperate dir
+ mkdir eglibc-build
+}
+
+build() {
+ cd "$_builddir"/eglibc-build
+
+ export CFLAGS="$CFLAGS -fno-stack-protector"
+
+ ../configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --mandir=/usr/share/info \
+ --infodir=/usr/share/info \
+ --libdir=/usr/lib \
+ --libexecdir=/usr/lib \
+ --with-headers=/usr/include \
+ --enable-kernel=2.6.32 \
+ --enable-add-ons=nptl,libidn \
+ --disable-profile \
+ --enable-bind-now \
+ --with-tls \
+ --with-__thread \
+ --without-cvs \
+ --without-gd
+
+
+ make || return 1
+
+}
+
+package() {
+ cd "$_builddir"/eglibc-build
+
+ install -dm755 "$pkgdir"/etc && touch "$pkgdir"/etc/ld.so.conf
+
+ make -j1 install_root="$pkgdir" install
+
+ # provided by kernel-headers
+ rm "$pkgdir"/usr/include/scsi/scsi.h
+
+ rm "$pkgdir"/etc/ld.so.conf
+
+ # strip all
+ for i in ldconfig sln gencat getconf getent iconv locale localedef \
+ pcprofiledump rpcgen sprof lddlibc4 iconvconfig nscd rpcinfo; do
+ find "$pkgdir" -type f -name "$i" -exec strip --strip-all '{}' \;
+ done
+ strip --strip-all "$pkgdir"/usr/lib/gconv/*.so
+
+ # strip debug
+ for i in ld-2.12.1.so libpthread-2.12.1.so libthread_db-1.0.so; do
+ strip --strip-debug "$pkgdir"/lib/"$i"
+ done
+ strip --strip-debug "$pkgdir"/usr/lib/*.a
+
+ # strip uneeded
+ for i in libanl-2.12.1.so libBrokenLocale-2.12.1.so libc-2.12.1.so \
+ libcidn-2.12.1.so libcrypt-2.12.1.so libnss_*-2.12.1.so \
+ libdl-2.12.so libm-2.12.so libnsl-2.12.so libresolv-2.12.so \
+ librt-2.12.so libutil-2.12.so libmemusage.so libpcprofile.so \
+ libSegFault.so pt_chown; do
+ find "$pkgdir" -type f -name "$i" -exec strip --strip-unneeded '{}' \;
+ done
+ strip --strip-unneeded "$pkgdir"/usr/lib/gconv/*.so
+
+}
+
+gconv() {
+ pkgdesc="gconv character modules"
+ mkdir -p "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/lib/gconv "$subpkgdir"/usr/lib/
+}
+
+locales() {
+ pkgdesc="Common files for locale support"
+ mkdir -p "$subpkgdir"/usr/share
+ mv "$pkgdir"/usr/share/* "$subpkgdir"/usr/share/
+}
+
+nscd() {
+ pkgdesc="eglibc name service cache daemon"
+ mkdir -p "$subpkgdir"/var/db/nscd "$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="4deed2a0761d90a8e33643874fb54b41 eglibc-2.12-svn-11364.tar.bz2
+0c5540efc51c0b93996c51b57a8540ae glibc-2.10-bz4781.patch
+40cd342e21f71f5e49e32622b25acc52 glibc-__i686.patch
+137fe99a6bc1786da759fb99bfeddb1f nscd.initd"