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 | DL_REVISION=$(svn info svn://svn.eglibc.org/branches/eglibc-${FIXEDVERSION} | grep -i "Last Changed Rev" | cut -f2 -d: | sed -e 's/ //g')
|
---|
28 | echo "Retreiving Revision #${DL_REVISION} from SVN eglibc-${SOURCEVERSION}..."
|
---|
29 | svn export -r ${DL_REVISION} svn://svn.eglibc.org/branches/eglibc-${FIXEDVERSION} eglibc-${SOURCEVERSION}
|
---|
30 |
|
---|
31 | # Customize the version string, so we know it's patched
|
---|
32 | #
|
---|
33 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
34 | DL_DATE=$(date +%Y%m%d)
|
---|
35 | echo "#define DL_DATE \"${DL_DATE}\"" >> libc/version.h
|
---|
36 | echo "#define DL_REVISION \"${DL_REVISION}\"" >> libc/version.h
|
---|
37 | 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
|
---|
38 | sed -i "s@Compiled by GNU CC version@Revision # \"DL_REVISION\".\\\\n\\\\\\nCompiled by GNU CC version@" libc/csu/version.c
|
---|
39 | 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
|
---|
40 | sed -i "s@static const char __libc_release@static const char __libc_dl_revision[] = DL_REVISION;\nstatic const char __libc_release@" libc/csu/version.c
|
---|
41 |
|
---|
42 | # Remove Files not needed
|
---|
43 | #
|
---|
44 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
45 | FILE_LIST=".cvsignore"
|
---|
46 | for files in ${FILE_LIST}; do
|
---|
47 | REMOVE=$(find * -name ${files})
|
---|
48 | for file in $REMOVE; do
|
---|
49 | rm -f ${file}
|
---|
50 | done
|
---|
51 | done
|
---|
52 |
|
---|
53 | # Fix configuration files
|
---|
54 | #
|
---|
55 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
56 | echo "Updating Glibc configure files..."
|
---|
57 | find . -name configure -exec touch {} \;
|
---|
58 |
|
---|
59 | # Compress
|
---|
60 | #
|
---|
61 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
62 | echo "Creating Tarball for Eglibc Ports ${SOURCEVERSION}...."
|
---|
63 | tar cjf ~/public_html/eglibc-ports-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 ports
|
---|
64 | rm -rf ports
|
---|
65 | echo "Creating Tarball for Eglibc Linuxthreads ${SOURCEVERSION}...."
|
---|
66 | tar cjf ~/public_html/eglibc-linuxthreads-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 linuxthreads
|
---|
67 | rm -rf linuxthreads
|
---|
68 | echo "Creating Tarball for Eglibc LocaleDef ${SOURCEVERSION}...."
|
---|
69 | tar cjf ~/public_html/eglibc-localedef-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 localedef
|
---|
70 | rm -rf localedef
|
---|
71 | mv libc eglibc-${SOURCEVERSION}
|
---|
72 | echo "Creating Tarball for Eglibc ${SOURCEVERSION}...."
|
---|
73 | tar cjf ~/public_html/eglibc-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 eglibc-${SOURCEVERSION}
|
---|
74 |
|
---|
75 | # Clean up Directores
|
---|
76 | #
|
---|
77 | cd ~/tmp
|
---|
78 | rm -rf eglibc-${SOURCEVERSION}
|
---|
79 |
|
---|