[aa81e76] | 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 |
|
---|
[167f981] | 18 | # Clear out old Directory
|
---|
| 19 | #
|
---|
| 20 | rm -rf ~/tmp
|
---|
| 21 |
|
---|
[aa81e76] | 22 | # Get Current Eglibc from SVN
|
---|
| 23 | #
|
---|
| 24 | install -d ~/tmp
|
---|
| 25 | cd ~/tmp
|
---|
| 26 | FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
|
---|
[a689767] | 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}
|
---|
[aa81e76] | 30 |
|
---|
| 31 | # Customize the version string, so we know it's patched
|
---|
| 32 | #
|
---|
| 33 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
[a689767] | 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
|
---|
[aa81e76] | 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
|
---|
[a689767] | 38 | sed -i "s@Compiled by GNU CC version@Revision # \"DL_REVISION\".\\\\n\\\\\\nCompiled by GNU CC version@" libc/csu/version.c
|
---|
[aa81e76] | 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
|
---|
[a689767] | 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
|
---|
[aa81e76] | 41 |
|
---|
| 42 | # Remove Files not needed
|
---|
| 43 | #
|
---|
[167f981] | 44 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
[aa81e76] | 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 | #
|
---|
[167f981] | 55 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
[aa81e76] | 56 | echo "Updating Glibc configure files..."
|
---|
| 57 | find . -name configure -exec touch {} \;
|
---|
| 58 |
|
---|
| 59 | # Compress
|
---|
| 60 | #
|
---|
[167f981] | 61 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
[aa81e76] | 62 | echo "Creating Tarball for Eglibc Ports ${SOURCEVERSION}...."
|
---|
[a689767] | 63 | tar cjf ~/public_html/eglibc-ports-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 ports
|
---|
[aa81e76] | 64 | rm -rf ports
|
---|
| 65 | echo "Creating Tarball for Eglibc Linuxthreads ${SOURCEVERSION}...."
|
---|
[a689767] | 66 | tar cjf ~/public_html/eglibc-linuxthreads-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 linuxthreads
|
---|
[aa81e76] | 67 | rm -rf linuxthreads
|
---|
| 68 | echo "Creating Tarball for Eglibc LocaleDef ${SOURCEVERSION}...."
|
---|
[a689767] | 69 | tar cjf ~/public_html/eglibc-localedef-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 localedef
|
---|
[aa81e76] | 70 | rm -rf localedef
|
---|
| 71 | mv libc eglibc-${SOURCEVERSION}
|
---|
| 72 | echo "Creating Tarball for Eglibc ${SOURCEVERSION}...."
|
---|
[a689767] | 73 | tar cjf ~/public_html/eglibc-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 eglibc-${SOURCEVERSION}
|
---|
[aa81e76] | 74 |
|
---|
| 75 | # Clean up Directores
|
---|
| 76 | #
|
---|
| 77 | cd ~/tmp
|
---|
| 78 | rm -rf eglibc-${SOURCEVERSION}
|
---|
| 79 |
|
---|