aboutsummaryrefslogtreecommitdiffstats
path: root/main/eglibc/APKBUILD
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2013-01-05 04:18:02 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2013-01-05 04:18:02 +0100
commit87f4b9efaf9b766fce6099fc9fcdb61da6dc1b00 (patch)
treee8c547c5c1963105085b349c23db9212453e2244 /main/eglibc/APKBUILD
parent9afae337de265bf9f206e2c3711954e49a282cd8 (diff)
downloadaports-87f4b9efaf9b766fce6099fc9fcdb61da6dc1b00.tar.bz2
aports-87f4b9efaf9b766fce6099fc9fcdb61da6dc1b00.tar.xz
main/eglibc: new aport
Diffstat (limited to 'main/eglibc/APKBUILD')
-rw-r--r--main/eglibc/APKBUILD186
1 files changed, 186 insertions, 0 deletions
diff --git a/main/eglibc/APKBUILD b/main/eglibc/APKBUILD
new file mode 100644
index 0000000000..2e25ca1db8
--- /dev/null
+++ b/main/eglibc/APKBUILD
@@ -0,0 +1,186 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=eglibc
+pkgver=2.17_svn20121226
+pkgrel=1
+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"
+arch="all"
+license="GPL"
+depends="linux-headers=>3.2.7"
+depends_dev=""
+makedepends="$depends_dev gawk perl bash"
+install=""
+options="!strip ldpath-recursive"
+triggers="$pkgname-utils.trigger=/lib:/usr/lib"
+subpackages="$pkgname-dev $pkgname-lang $pkgname-locales $pkgname-scripts
+ $pkgname-nscd libthread_db $pkgname-gconv $pkgname-mtrace $pkgname-utils"
+source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.bz2
+ ld.so.conf nscd.initd ldd-sh.patch"
+svnurl="svn://svn.eglibc.org/branches/eglibc-2_17/libc"
+disturl="dev.alpinelinux.org:/archive/$pkgname/"
+verbase="2.17"
+
+[ "$ALPINE_LIBC" != "eglibc" ] && arch=
+
+_builddir="$srcdir"/eglibc-$pkgver
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ # set lib dir
+ echo "slibdir=/lib" >> configparms
+ # ldconfig does not need to look in lib64 or libx32
+ sed -i "s#add_system_dir#do_not_add_system_dir#" \
+ sysdeps/unix/sysv/linux/x86_64/dl-cache.h || return 1
+ mkdir -p eglibc-build
+}
+
+build() {
+ cd "$_builddir"/eglibc-build
+ export CFLAGS="$CFLAGS -fno-stack-protector"
+ ../configure \
+ --build $CBUILD \
+ --host $CHOST \
+ --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=3.2.7 \
+ --enable-add-ons=nptl,libidn \
+ --disable-profile \
+ --enable-bind-now \
+ --without-gd \
+ --enable-stackguard-randomization \
+ --enable-obsolete-rpc \
+ --with-bugurl=http://bugs.alpinelinux.org \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"/eglibc-build
+ local i
+
+ install -D -m644 "$srcdir"/ld.so.conf \
+ "$pkgdir"/etc/ld.so.conf || return 1
+
+ make -j1 install_root="$pkgdir" install
+
+ # multiarch compat (not working on current apk-tools)
+ if [ "$CARCH" = "x86_64" ]; then
+ cd $pkgdir
+ # multiarch compat (not working on current apk-tools)
+ ln -sf /lib "$pkgdir"/lib64
+ # fix ldd to use /lib dir
+ sed -i '/RTLDLIST/s%lib64%lib%' \
+ "$pkgdir"/usr/bin/ldd || return 1
+ fi
+
+ # strip all
+ for i in ldconfig sln gencat getconf getent iconv locale localedef makedb \
+ pcprofiledump pldd rpcgen sprof iconvconfig nscd; do
+ find "$pkgdir" -type f -name "$i" -exec strip --strip-all '{}' \;
+ done
+ strip --strip-all "$pkgdir"/usr/lib/getconf/*
+
+ # strip unneeded
+ for i in libanl-*.so libBrokenLocale-*.so libcidn-*.so libcrypt-*.so \
+ libnss_compat-*.so libnss_db-*.so libnss_dns-*.so libnss_files-*.so \
+ libnss_hesiod-*.so libnss_nis-*.so libnss_nisplus-*.so \
+ libdl-*.so libm-*.so libnsl-*.so libresolv-*.so librt-*.so libutil-*.so \
+ libmemusage.so libpcprofile.so libSegFault.so sotruss-lib.so pt_chown; do
+ find "$pkgdir" -type f -name "$i" -exec strip --strip-unneeded '{}' \;
+ done
+ strip --strip-unneeded "$pkgdir"/usr/lib/gconv/*.so
+
+ # strip debug
+ strip --strip-debug "$pkgdir"/usr/lib/*.a
+}
+
+gconv() {
+ pkgdesc="gconv character modules"
+ mkdir -p "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/lib/gconv \
+ "$subpkgdir"/usr/lib/ || return 1
+}
+
+scripts() {
+ # current tzselect unbash patch does not work waiting for upstream.
+ pkgdesc="eglibc scripts sotruss tzselect and xtrace based on bash"
+ depends="bash"
+ local i
+ mkdir -p "$subpkgdir"/usr/bin
+ for i in sotruss xtrace tzselect; do
+ mv "$pkgdir"/usr/bin/$i \
+ "$subpkgdir"/usr/bin/ || return 1
+ done
+}
+
+mtrace() {
+ pkgdesc="eglibc mtrace based on perl"
+ depends="perl"
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/mtrace \
+ "$subpkgdir"/usr/bin/ || return 1
+}
+
+utils() {
+ pkgdesc="eglibc utility programs"
+ replaces="uclibc-utils libiconv eglibc"
+ mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/sbin
+ mv "$pkgdir"/sbin/* \
+ "$subpkgdir"/sbin/ || return 1
+ mv "$pkgdir"/usr/bin/* \
+ "$subpkgdir"/usr/bin/ || return 1
+}
+
+locales() {
+ pkgdesc="Common files for locale support"
+ mkdir -p "$subpkgdir"/usr/share
+ mv "$pkgdir"/usr/share/* \
+ "$subpkgdir"/usr/share/ || return 1
+}
+
+nscd() {
+ pkgdesc="eglibc name service cache daemon"
+ mkdir -p "$subpkgdir"/var/db/nscd \
+ "$subpkgdir"/var/run/nscd \
+ "$subpkgdir"/usr/sbin || return 1
+ install -Dm 755 "$srcdir"/nscd.initd \
+ "$subpkgdir"/etc/init.d/nscd || return 1
+ install -Dm 644 "$_builddir"/nscd/nscd.conf \
+ "$subpkgdir"/etc/nscd.conf || return 1
+ mv "$pkgdir"/usr/sbin/nscd \
+ "$subpkgdir"/usr/sbin/ || return 1
+}
+
+libthread_db() {
+ pkgdesc="eglibc thread debugging library"
+ mkdir -p "$subpkgdir"/lib
+ mv "$pkgdir"/lib/libthread_db* \
+ "$subpkgdir"/lib/ || return 1
+}
+
+dev() {
+ default_dev
+ # do not depends on $pkgname-scripts and $pkgname-mtrace
+ # so we do not pull in bash and perl with eglibc-dev
+ depends="$pkgname $pkgname-lang $pkgname-locales $pkgname-nscd
+ libthread_db $pkgname-gconv $pkgname-utils"
+}
+
+md5sums="41acb18d9024e1bc4a576bdebaf989ce eglibc-2.17_svn20121226.tar.bz2
+08ec272b104e35cd420e26ad09b63bad ld.so.conf
+137fe99a6bc1786da759fb99bfeddb1f nscd.initd
+340a91bc354854bc70a5bb4973367e6a ldd-sh.patch"