1 | #!/bin/bash
|
---|
2 | # Create a Eglibc Tarball
|
---|
3 |
|
---|
4 | # Get Version #
|
---|
5 | #
|
---|
6 | VERSION=$1
|
---|
7 | SOURCEVERSION=$2
|
---|
8 |
|
---|
9 | # Check Input
|
---|
10 | #
|
---|
11 | if [ "${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
|
---|
16 | fi
|
---|
17 |
|
---|
18 | # Clear out old Directory
|
---|
19 | #
|
---|
20 | rm -rf ~/tmp
|
---|
21 |
|
---|
22 | # Get Current Eglibc from SVN
|
---|
23 | #
|
---|
24 | install -d ~/tmp
|
---|
25 | cd ~/tmp
|
---|
26 | FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
|
---|
27 | echo "Retreiving from SVN eglibc-${SOURCEVERSION}..."
|
---|
28 | svn export svn://svn.eglibc.org/branches/eglibc-${FIXEDVERSION} eglibc-${SOURCEVERSION}
|
---|
29 |
|
---|
30 | # Customize the version string, so we know it's patched
|
---|
31 | #
|
---|
32 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
33 | DATE_STAMP=$(date +%Y%m%d)
|
---|
34 | echo "#define DL_DATE \"${DATE_STAMP}\"" >> libc/version.h
|
---|
35 | sed -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
|
---|
36 | sed -i "s@static const char __libc_release@static const char __libc_dl_date[] = DL_DATE;\nstatic const char __libc_release@" libc/csu/version.c
|
---|
37 |
|
---|
38 | # Remove Files not needed
|
---|
39 | #
|
---|
40 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
41 | FILE_LIST=".cvsignore"
|
---|
42 | for files in ${FILE_LIST}; do
|
---|
43 | REMOVE=$(find * -name ${files})
|
---|
44 | for file in $REMOVE; do
|
---|
45 | rm -f ${file}
|
---|
46 | done
|
---|
47 | done
|
---|
48 |
|
---|
49 | # Fix configuration files
|
---|
50 | #
|
---|
51 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
52 | echo "Updating Glibc configure files..."
|
---|
53 | find . -name configure -exec touch {} \;
|
---|
54 |
|
---|
55 | # Change gcc to BUILD_CC in the following files
|
---|
56 | #
|
---|
57 | cd ~/tmp/eglibc-${SOURCEVERSION}/libc
|
---|
58 | FIX_FILES="sunrpc/Makefile timezone/Makefile"
|
---|
59 | for fix_file in ${FIX_FILES}; do
|
---|
60 | sed -i "s/gcc/\'$\(BUILD_CC\)'/g" ${fix_file}
|
---|
61 | done
|
---|
62 |
|
---|
63 | # Compress
|
---|
64 | #
|
---|
65 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
66 | echo "Creating Tarball for Eglibc Ports ${SOURCEVERSION}...."
|
---|
67 | tar cjf ~/public_html/eglibc-ports-${SOURCEVERSION}.tar.bz2 ports
|
---|
68 | rm -rf ports
|
---|
69 | echo "Creating Tarball for Eglibc Linuxthreads ${SOURCEVERSION}...."
|
---|
70 | tar cjf ~/public_html/eglibc-linuxthreads-${SOURCEVERSION}.tar.bz2 linuxthreads
|
---|
71 | rm -rf linuxthreads
|
---|
72 | echo "Creating Tarball for Eglibc LocaleDef ${SOURCEVERSION}...."
|
---|
73 | tar cjf ~/public_html/eglibc-localedef-${SOURCEVERSION}.tar.bz2 localedef
|
---|
74 | rm -rf localedef
|
---|
75 | mv libc eglibc-${SOURCEVERSION}
|
---|
76 | echo "Creating Tarball for Eglibc ${SOURCEVERSION}...."
|
---|
77 | tar cjf ~/public_html/eglibc-${SOURCEVERSION}.tar.bz2 eglibc-${SOURCEVERSION}
|
---|
78 |
|
---|
79 | # Clean up Directores
|
---|
80 | #
|
---|
81 | cd ~/tmp
|
---|
82 | rm -rf eglibc-${SOURCEVERSION}
|
---|
83 |
|
---|