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 | # Set Patch Number
|
---|
32 | #
|
---|
33 | cd ~/tmp
|
---|
34 | wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
|
---|
35 | PATCH_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)
|
---|
36 | PATCH_NUM=$(expr ${PATCH_NUM} + 1)
|
---|
37 | rm -f index.html
|
---|
38 |
|
---|
39 | # Customize the version string, so we know it's patched
|
---|
40 | #
|
---|
41 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
42 | DL_DATE=$(date +%Y%m%d)
|
---|
43 | echo "#define DL_DATE \"${DL_DATE}\"" >> libc/version.h
|
---|
44 | echo "#define DL_REVISION \"${DL_REVISION}\"" >> libc/version.h
|
---|
45 | 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
|
---|
46 | sed -i "s@Compiled by GNU CC version@Revision # \"DL_REVISION\".\\\\n\\\\\\nCompiled by GNU CC version@" libc/csu/version.c
|
---|
47 | 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
|
---|
48 | 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
|
---|
49 |
|
---|
50 | # Remove Files not needed
|
---|
51 | #
|
---|
52 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
53 | FILE_LIST=".cvsignore"
|
---|
54 | for files in ${FILE_LIST}; do
|
---|
55 | REMOVE=$(find * -name ${files})
|
---|
56 | for file in $REMOVE; do
|
---|
57 | rm -f ${file}
|
---|
58 | done
|
---|
59 | done
|
---|
60 |
|
---|
61 | # Fix configuration files
|
---|
62 | #
|
---|
63 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
64 | echo "Updating Glibc configure files..."
|
---|
65 | find . -name configure -exec touch {} \;
|
---|
66 |
|
---|
67 | # Create A copy of the Original Directory So We can do some Updates
|
---|
68 | #
|
---|
69 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
70 | cp -ar libc libc.orig
|
---|
71 |
|
---|
72 | # Change gcc to BUILD_CC in the following files
|
---|
73 | #
|
---|
74 | cd ~/tmp/eglibc-${SOURCEVERSION}/libc
|
---|
75 | FIX_FILES="sunrpc/Makefile timezone/Makefile"
|
---|
76 | for fix_file in ${FIX_FILES}; do
|
---|
77 | sed -i 's/gcc/\$\(BUILD_CC\)/g' ${fix_file}
|
---|
78 | done
|
---|
79 |
|
---|
80 | # Make testsuite fixes
|
---|
81 | #
|
---|
82 | cd ~/tmp/eglibc-${SOURCEVERSION}/libc
|
---|
83 | sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
|
---|
84 | sed -i s/utf8/UTF-8/ libio/tst-fgetwc.c
|
---|
85 | sed -i '/tst-fgetws-ENV/ a\
|
---|
86 | tst-fgetwc-ENV = LOCPATH=$(common-objpfx)localedata' libio/Makefile
|
---|
87 |
|
---|
88 | # Create Patch
|
---|
89 | #
|
---|
90 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
91 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
92 | echo "Date: `date +%m-%d-%Y`" >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
93 | echo "Initial Package Version: ${SOURCEVERSION}" >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
94 | echo "Origin: Upstream" >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
95 | echo "Upstream Status: Applied" >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
96 | echo "Description: These are fixes eglibc-${SOURCEVERSION}, and should be" >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
97 | echo " rechecked periodically." >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
98 | echo "" >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
99 | diff -Naur libc.orig libc >> ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch
|
---|
100 | echo "Created ~/public_html/eglibc-${SOURCEVERSION}-fixes-${PATCH_NUM}.patch."
|
---|
101 |
|
---|
102 | # Remove Patched Copy
|
---|
103 | #
|
---|
104 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
105 | rm -rf libc
|
---|
106 | mv libc.orig libc
|
---|
107 |
|
---|
108 | # Compress
|
---|
109 | #
|
---|
110 | cd ~/tmp/eglibc-${SOURCEVERSION}
|
---|
111 | echo "Creating Tarball for Eglibc Ports ${SOURCEVERSION}...."
|
---|
112 | tar cjf ~/public_html/eglibc-ports-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 ports
|
---|
113 | rm -rf ports
|
---|
114 | echo "Creating Tarball for Eglibc Linuxthreads ${SOURCEVERSION}...."
|
---|
115 | tar cjf ~/public_html/eglibc-linuxthreads-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 linuxthreads
|
---|
116 | rm -rf linuxthreads
|
---|
117 | echo "Creating Tarball for Eglibc LocaleDef ${SOURCEVERSION}...."
|
---|
118 | tar cjf ~/public_html/eglibc-localedef-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 localedef
|
---|
119 | tar cjf ~/public_html/eglibc-localedef-${SOURCEVERSION}.tar.bz2 localedef
|
---|
120 | rm -rf localedef
|
---|
121 | mv libc eglibc-${SOURCEVERSION}
|
---|
122 | echo "Creating Tarball for Eglibc ${SOURCEVERSION}...."
|
---|
123 | tar cjf ~/public_html/eglibc-${SOURCEVERSION}-${DL_DATE}-r${DL_REVISION}.tar.bz2 eglibc-${SOURCEVERSION}
|
---|
124 |
|
---|
125 | # Clean up Directores
|
---|
126 | #
|
---|
127 | cd ~/tmp
|
---|
128 | rm -rf eglibc-${SOURCEVERSION}
|
---|
129 |
|
---|