source: scripts/fetch/glibc.sh@ fb2c334

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since fb2c334 was 10b98b1, checked in by Chris Staub <chris@…>, 16 years ago

Corrections in comments of patch scripts

  • Property mode set to 100755
File size: 2.4 KB
RevLine 
[f9b3690b]1#!/bin/bash
2# Written By: Joe Ciccone <jciccone at gmail dot com>
3
4# Usage, glibc.sh [cvs-tag] [tarball-version]
5# An example of a CVS tag would be HEAD or glibc-2_9
6# An example of a tarball version would be say the date, or 2.9, it will be
[10b98b1]7# inserted into the output tarball filename,
[f9b3690b]8# eg, glibc-[tarball-version].tar.bz2
9
10CVStag=${1-HEAD}
11TARver=${2-$(date +%Y%m%d)}
12
13echo "Creating glibc-${TARver}.tar.bz2 and glibc-ports-${TARver}.tar.bz2 from the ${CVStag} CVS Tag."
14
15tmpdir="$(mktemp -d)"
16if test ! -d "${tmpdir}"; then
17 tmpdir="/tmp/glibc-XXXX"
18 mkdir -pv "${tmpdir}"
19fi
20
21if test ! -d "${tmpdir}"; then
22 echo "Failed to create temp directory: ${tmpdir}"
23 exit 1
24fi
25
26echo "Use \"anoncvs\" for the password."
27cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc login
28if test $? -ne 0; then
29 echo "Failed to login to glibc cvs server."
30 rm -rf "${tmpdir}"
31 exit 1
32fi
33
34pushd "${tmpdir}"
35
36# Checkout from the cvs glibc
37cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc co -r "${CVStag}" libc
38mv libc "glibc-${TARver}"
39if test $? -ne 0; then
40 echo "Failed to check out libc, Leaving temp files in ${tmpdir}."
41 exit 1
42fi
43
44# Checkout from the cvs glibc
45cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc co -r "${CVStag}" ports
46mv ports "glibc-ports-${TARver}"
47if test $? -ne 0; then
48 echo "Failed to check out libc, Leaving temp files in ${tmpdir}."
49 exit 1
50fi
51
[10b98b1]52# If the timestamp of configure.in is newer than configure glibc will try to
[f9b3690b]53# reconfigure itself, this can cause some errors while cross-compiling.
54find "glibc-${TARver}" "glibc-ports-${TARver}" -name configure | xargs touch
55
56# Clean out CVS Files
57find "glibc-${TARver}" "glibc-ports-${TARver}" -name CVS -type d | xargs rm -rf
58find "glibc-${TARver}" "glibc-ports-${TARver}" -name .cvsignore | xargs rm -rf
59
[08433c1]60# Add a custom version string
61DATE_STAMP=$(date +%Y%m%d)
[dcc8f833]62GLIBC_VERSION=$(cat version.h | grep VERSION | cut -f3 -d' ' | sed -e 's/"//g')
63sed -i "s@\(^#define VERSION \).*@\1\"${GLIBC_VERSION}.${DATE_STAMP}\"@" version.h
64sed -i "s@Copyright@Built for Cross-LFS\\\\n\\\\\nCopyright@" csu/version.c
[08433c1]65
[f9b3690b]66# Create tarballs
67echo "Creating Tarballs"
68tar cvjf "glibc-${TARver}.tar.bz2" "glibc-${TARver}"
69tar cvjf "glibc-ports-${TARver}.tar.bz2" "glibc-ports-${TARver}"
70
71# echo Pop back to the orig working directory and mv the tarballs over
72
73popd
74mv "${tmpdir}/glibc-${TARver}.tar.bz2" .
75mv "${tmpdir}/glibc-ports-${TARver}.tar.bz2" .
76
77rm -rf "${tmpdir}"
Note: See TracBrowser for help on using the repository browser.