glibc PKGBUILD added

This commit is contained in:
Mike Staszel 2009-09-30 18:21:37 -05:00
parent 0ad38a1091
commit aced055a06
5 changed files with 200 additions and 0 deletions

90
core/glibc/PKGBUILD Normal file
View file

@ -0,0 +1,90 @@
# Maintainer: Alexander Foremny <alexanderforemny@gmail.com>
# 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')

5
core/glibc/glibc.install Normal file
View file

@ -0,0 +1,5 @@
post_upgrade() {
ldconfig -r .
init u
}

42
core/glibc/locale-gen Executable file
View file

@ -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."

23
core/glibc/locale.gen.txt Normal file
View file

@ -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:
#
# <locale> <charset>
#
# where <locale> is one of the locales given in /opt/share/i18n/locales
# and <charset> 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.
#

40
core/glibc/nscd Executable file
View file

@ -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