source: scripts/fetch/eglibc.sh @ d06a4e5

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since d06a4e5 was d06a4e5, checked in by Jim Gifford <clfs@…>, 11 years ago

Updated eglibc fetch script

  • Property mode set to 100755
File size: 4.8 KB
Line 
1#!/bin/bash
2# Create a Eglibc Tarball
3
4# Get Version #
5#
6VERSION=$1
7SOURCEVERSION=$2
8
9# Check Input
10#
11if [ "${VERSION}" = "" -o "${SOURCEVERSION}" = "" ]; then
12  echo "$0 - Eglibc_Version"
13  echo "This will Create a Tarball for Eglibc Eglibc_Series Eglibc_Version"
14  echo "Example $0 2.19 2.19.1"
15  exit 255
16fi
17
18# Clear out old Directory
19#
20rm -rf ~/tmp
21
22# Get Current Eglibc from SVN
23#
24install -d ~/tmp
25cd ~/tmp
26FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
27DL_REVISION=$(svn info svn://svn.eglibc.org/branches/eglibc-${FIXEDVERSION} | grep -i "Last Changed Rev" | cut -f2 -d: | sed -e 's/ //g')
28echo "Retreiving Revision #${DL_REVISION} from SVN eglibc-${SOURCEVERSION}..."
29svn export -r ${DL_REVISION} svn://svn.eglibc.org/branches/eglibc-${FIXEDVERSION} eglibc-${SOURCEVERSION}
30
31# Set Patch Number
32#
33cd ~/tmp
34wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
35PATCH_NUM=$(cat index.html | grep eglibc | grep "${SOURCEVERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
36PATCH_NUM=$(expr ${PATCH_NUM} + 1)
37rm -f index.html
38
39# Customize the version string, so we know it's patched
40#
41cd ~/tmp/eglibc-${SOURCEVERSION}
42DL_DATE=$(date +%Y%m%d)
43echo "#define DL_DATE \"${DL_DATE}\"" >> libc/version.h
44echo "#define DL_REVISION \"${DL_REVISION}\"" >> libc/version.h
45sed -i "s@Compiled by GNU CC version@Built for Cross-LFS.\\\\n\\\\\nRetrieved on \"DL_DATE\".\\\\n\\\\\\nCompiled by GNU CC version@" libc/csu/version.c
46sed -i "s@Compiled by GNU CC version@Revision # \"DL_REVISION\".\\\\n\\\\\\nCompiled by GNU CC version@" libc/csu/version.c
47sed -i "s@static const char __libc_release@static const char __libc_dl_date[] = DL_DATE;\nstatic const char __libc_release@" libc/csu/version.c
48sed -i "s@static const char __libc_release@static const char __libc_dl_revision[] = DL_REVISION;\nstatic const char __libc_release@" libc/csu/version.c
49
50# Remove Files not needed
51#
52cd ~/tmp/eglibc-${SOURCEVERSION}
53FILE_LIST=".cvsignore"
54for files in ${FILE_LIST}; do
55  REMOVE=$(find * -name ${files})
56  for file in $REMOVE; do
57    rm -f ${file}
58  done
59done
60
61# Fix configuration files
62#
63cd ~/tmp/eglibc-${SOURCEVERSION}
64echo "Updating Glibc configure files..."
65find . -name configure -exec touch {} \;
66
67# Create A copy of the Original Directory So We can do some Updates
68#
69cd ~/tmp/eglibc-${SOURCEVERSION}
70cp -ar libc libc.orig
71
72# Change gcc to BUILD_CC in the following files
73#
74cd ~/tmp/eglibc-${SOURCEVERSION}/libc
75FIX_FILES="sunrpc/Makefile timezone/Makefile"
76for fix_file in ${FIX_FILES}; do
77  sed -i 's/gcc/\$\(BUILD_CC\)/g' ${fix_file}
78done
79
80# Make testsuite fixes
81#
82cd ~/tmp/eglibc-${SOURCEVERSION}/libc
83sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
84sed -i s/utf8/UTF-8/ libio/tst-fgetwc.c
85sed -i '/tst-fgetws-ENV/ a\
86tst-fgetwc-ENV = LOCPATH=$(common-objpfx)localedata' libio/Makefile
87
88# Create Patch
89#
90cd ~/tmp/eglibc-${SOURCEVERSION}
91echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" >  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
92echo "Date: `date +%m-%d-%Y`" >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
93echo "Initial Package Version: ${SOURCEVERSION}" >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
94echo "Origin: Upstream" >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
95echo "Upstream Status: Applied" >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
96echo "Description: These are fixes eglibc-${SOURCEVERSION}, and should be" >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
97echo "             rechecked periodically." >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
98echo "" >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
99diff -Naur libc.orig libc >>  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
100echo "Created  ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch."
101
102# Remove Patched Copy
103#
104cd ~/tmp/eglibc-${SOURCEVERSION}
105rm -rf libc
106mv libc.orig libc
107
108# Compress
109#
110cd ~/tmp/eglibc-${SOURCEVERSION}
111echo "Creating Tarball for Eglibc Ports ${SOURCEVERSION}...."
112tar cjf ~/public_html/eglibc-ports-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 ports
113rm -rf ports
114echo "Creating Tarball for Eglibc Linuxthreads ${SOURCEVERSION}...."
115tar cjf ~/public_html/eglibc-linuxthreads-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 linuxthreads
116rm -rf linuxthreads
117echo "Creating Tarball for Eglibc LocaleDef ${SOURCEVERSION}...."
118tar cjf ~/public_html/eglibc-localedef-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 localedef
119rm -rf localedef
120mv libc eglibc-${SOURCEVERSION}
121echo "Creating Tarball for Eglibc ${SOURCEVERSION}...."
122tar cjf ~/public_html/eglibc-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 eglibc-${SOURCEVERSION}
123
124# Clean up Directores
125#
126cd ~/tmp
127rm -rf eglibc-${SOURCEVERSION}
128
Note: See TracBrowser for help on using the repository browser.