From aced055a0674e7a9b2fff2042b2fbfb19813885a Mon Sep 17 00:00:00 2001 From: Mike Staszel Date: Wed, 30 Sep 2009 18:21:37 -0500 Subject: [PATCH] glibc PKGBUILD added --- core/glibc/PKGBUILD | 90 +++++++++++++++++++++++++++++++++++++++ core/glibc/glibc.install | 5 +++ core/glibc/locale-gen | 42 ++++++++++++++++++ core/glibc/locale.gen.txt | 23 ++++++++++ core/glibc/nscd | 40 +++++++++++++++++ 5 files changed, 200 insertions(+) create mode 100644 core/glibc/PKGBUILD create mode 100644 core/glibc/glibc.install create mode 100755 core/glibc/locale-gen create mode 100644 core/glibc/locale.gen.txt create mode 100755 core/glibc/nscd diff --git a/core/glibc/PKGBUILD b/core/glibc/PKGBUILD new file mode 100644 index 000000000..c7e49832c --- /dev/null +++ b/core/glibc/PKGBUILD @@ -0,0 +1,90 @@ +# Maintainer: Alexander Foremny + +# toolchain build order: +# kernel-headers -> glibc -> binutils -> gcc-libs -> gcc -> binutils -> glibc + +pkgname=glibc +pkgver=2.10.1 +pkgrel=2 +install=glibc.install +backup=(opt/etc/locale.gen + opt/etc/nscd.conf) +pkgdesc="GNU C Library" +arch=('arm') +license=('GPL' 'LGPL') +url="http://www.gnu.org/software/libc" +groups=('base' 'small-base') +depends=('tzdata') +makedepends=('gcc>=4.4.0') +source=(http://ftp.gnu.org/gnu/glibc/glibc-ports-$pkgver.tar.gz + http://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.gz + nscd + locale.gen.txt + locale-gen) + +build() { + cd $srcdir/glibc-$pkgver + ln -s $srcdir/glibc-ports-$pkgver . + + install -dm755 $pkgdir/opt/etc + touch $pkgdir/opt/etc/ld.so.conf + + # Remove timezone from build targets. This is supplied by the tzdata + # package. + sed -i '/^all-subdirs =/,/^$/s/timezone //' Makeconfig + + mkdir opt/glibc-build + cd opt/glibc-build + + echo "slibdir=/opt/lib" >> configparms + + ../configure --prefix=/opt \ + --host=arm-unknown-linux-gnueabi \ + --build=arm-unknown-linux-gnueabi \ + --enable-add-ons \ + --enable-kernel=2.6.18 \ + --enable-bind-now \ + --disable-profile \ + --disable-debug \ + --disable-gd \ + --libexecdir=/opt/lib \ + --libdir=/opt/lib \ + --with-tls \ + --with-__thread \ + --with-headers=/opt/include \ + --without-cvs \ + --without-gd \ + --without-fp \ + --without-selinux || return 1 + + make || return 1 + make install_root="$pkgdir" install || return 1 + + rm -f "$pkgdir/opt/etc/ld.so.cache" "$pkgdir/opt/etc/ld.so.conf" \ + "$pkgdir/opt/etc/localtime" + + install -dm755 ${pkgdir}/opt/etc/rc.d + install -dm755 ${pkgdir}/opt/sbin + install -dm755 ${pkgdir}/opt/lib/locale + install -Dm644 "$srcdir/opt/glibc-$pkgver/nscd/nscd.conf" \ + "$pkgdir/opt/etc/nscd.conf" + install -Dm755 "$srcdir/nscd" "$pkgdir/opt/etc/rc.d/nscd" + install -Dm755 "$srcdir/locale-gen" "$pkgdir/opt/sbin/locale-gen" + + sed -i -e 's/^\tserver-user/#\tserver-user/' \ + "$pkgdir/opt/etc/nscd.conf" || return 1 + + # Create /etc/locale.gen + install -m644 "$srcdir/locale.gen.txt" "$pkgdir/opt/etc/locale.gen" + sed -i 's|/| |g' "$srcdir/libc/localedata/SUPPORTED" + sed -i 's|\\| |g' "$srcdir/libc/localedata/SUPPORTED" + sed -i 's|SUPPORTED-LOCALES=||' "$srcdir/libc/localedata/SUPPORTED" + cat "$srcdir/libc/localedata/SUPPORTED" >> "$pkgdir/opt/etc/locale.gen" + sed -i 's|^|#|g' "$pkgdir/opt/etc/locale.gen" +} + +md5sums=('3daabbcd79f88866cdce4e7a93388459' + 'f95368cff696baa854fd41ba69d70f3a' + '49e7f3fce28f6fb6345119ade3d982f8' + '76717f17e9edcc3808069715017a76dc' + '92cb4ae5ffda5ef9f62b2f4659a163ac') diff --git a/core/glibc/glibc.install b/core/glibc/glibc.install new file mode 100644 index 000000000..6920d96ea --- /dev/null +++ b/core/glibc/glibc.install @@ -0,0 +1,5 @@ +post_upgrade() { + ldconfig -r . + init u +} + diff --git a/core/glibc/locale-gen b/core/glibc/locale-gen new file mode 100755 index 000000000..58129b93f --- /dev/null +++ b/core/glibc/locale-gen @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +LOCALEGEN=/opt/etc/locale.gen +LOCALES=/opt/share/i18n/locales +if [ -n "$POSIXLY_CORRECT" ]; then + unset POSIXLY_CORRECT +fi + + +[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0; + +# Remove all old locale dir and locale-archive before generating new +# locale data. +rm -rf /opt/lib/locale/* || true + +umask 022 + +is_entry_ok() { + if [ -n "$locale" -a -n "$charset" ] ; then + true + else + echo "error: Bad entry '$locale $charset'" + false + fi +} + +echo "Generating locales..." +while read locale charset; do \ + case $locale in \#*) continue;; "") continue;; esac; \ + is_entry_ok || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \ + echo -n ".$charset"; \ + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \ + echo -n '...'; \ + if [ -f $LOCALES/$locale ]; then input=$locale; else \ + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \ + localedef -i $input -c -f $charset -A /opt/share/locale/locale.alias $locale; \ + echo ' done'; \ +done < $LOCALEGEN +echo "Generation complete." diff --git a/core/glibc/locale.gen.txt b/core/glibc/locale.gen.txt new file mode 100644 index 000000000..d5849bd7a --- /dev/null +++ b/core/glibc/locale.gen.txt @@ -0,0 +1,23 @@ +# Configuration file for locale-gen +# +# lists of locales that are to be generated by the locale-gen command. +# +# Each line is of the form: +# +# +# +# where is one of the locales given in /opt/share/i18n/locales +# and is one of the character sets listed in /opt/share/i18n/charmaps +# +# Examples: +# en_US ISO-8859-1 +# en_US.UTF-8 UTF-8 +# de_DE ISO-8859-1 +# de_DE@euro ISO-8859-15 +# +# The locale-gen command will generate all the locales, +# placing them in /opt/lib/locale. +# +# A list of supported locales is included in this file. +# Uncomment the ones you need. +# diff --git a/core/glibc/nscd b/core/glibc/nscd new file mode 100755 index 000000000..708e975dd --- /dev/null +++ b/core/glibc/nscd @@ -0,0 +1,40 @@ +#!/bin/bash + +. /opt/etc/rc.conf +. /opt/etc/rc.d/functions + +PID=`pidof -o %PPID /opt/sbin/nscd` +case "$1" in + start) + stat_busy "Starting nscd" + # create necessary directories if they don't already exist + mkdir -p /opt/var/run/nscd /opt/var/db/nscd 2>/dev/null + # remove stale files + rm -f /opt/var/db/nscd/* /opt/var/run/nscd/* 2>/dev/null + [ -z "$PID" ] && /opt/sbin/nscd + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon nscd + stat_done + fi + ;; + stop) + stat_busy "Stopping nscd" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon nscd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0