author | jenda |
Tue, 24 May 2011 11:39:21 +0200 | |
changeset 75 | a80eed27a41f |
parent 74 | 0ff042a1dba1 |
child 78 | a74eca45d5f5 |
permissions | -rwxr-xr-x |
17 | 1 |
#!/bin/bash |
2 |
||
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
3 |
#For use on Solaris 10, CBE 1.7.0-RC1 is assumed to be installed and |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
4 |
#the below symlinks created |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
5 |
# ln -s /opt/dtbld /opt/jdsbld |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
6 |
# ln -s /opt/dtbld /opt/pkgbuild |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
7 |
|
17 | 8 |
# Build IM pkgs |
72
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
9 |
usage="$(basename $0) [-d <topdir>] [-l <logdir>] [-p] [-b] [-n] [spec files...]" |
17 | 10 |
usage="$usage\nDefault build type is 'build-only'" |
11 |
usage="$usage\n -d <topdir>: specify another top dir." |
|
72
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
12 |
usage="$usage\n -l <logdir>: specify another dir for build logs" |
17 | 13 |
usage="$usage\n -p : source prep only." |
14 |
usage="$usage\n -a : uninstall/build/install." |
|
15 |
usage="$usage\n -n : NOT compress/copy to $HOME/packages\n" |
|
16 |
||
50 | 17 |
date |
18 |
||
19 |
IPS_VENDORVER=0.${L10N_BUILDNUM:-"155"} |
|
20 |
PUBLISHER=${L10N_PUBLISHER:-"l10n-nightly"} |
|
21 |
||
75
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
22 |
export LC_ALL=C |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
23 |
export MAKE=${MAKE:-gmake} |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
24 |
export CC=${CC:-/opt/SUNWspro/bin/cc} |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
25 |
export CXX=${CXX:-/opt/SUNWspro/bin/CC} |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
26 |
|
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
27 |
# |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
28 |
# libtool swallows -norunpath option in $(CXXLINK) cmd |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
29 |
# add -norunpath in $CXX env value |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
30 |
# more details: |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
31 |
# http://monaco.sfbay.sun.com/detail.jsf?cr=6497744 |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
32 |
# http://mail.opensolaris.org/pipermail/jds-notify/2007-April/001799.html |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
33 |
# |
a80eed27a41f
$CC and $CXX must be set, otherwise some configure scripts select gcc as defatult compiler
jenda
parents:
74
diff
changeset
|
34 |
export CXX="$CXX -norunpath" |
17 | 35 |
|
72
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
36 |
while getopts pad:l:n option |
17 | 37 |
do |
38 |
case $option in |
|
39 |
p) FLAGPREP=1;; |
|
40 |
a) FLAGALL=1;; |
|
41 |
d) TOPDIR="$OPTARG";; |
|
72
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
42 |
l) LOGDIR="$OPTARG";; |
17 | 43 |
n) NOTCPFLAG=1;; |
44 |
?) printf "$usage" ; exit ;; |
|
45 |
esac |
|
46 |
done |
|
47 |
shift $(expr $OPTIND - 1) |
|
48 |
||
49 |
if [ X$TOPDIR = X ]; then |
|
50 |
if echo $0 | egrep -s '^/'; then |
|
51 |
TOPDIR=$(dirname $0) |
|
52 |
else |
|
53 |
TOPDIR="`pwd`/$(dirname $0)" |
|
54 |
fi |
|
55 |
fi |
|
50 | 56 |
|
57 |
MACH="${MACH:-`uname -p`}" |
|
58 |
BLDDIR="$TOPDIR/build.$MACH" |
|
72
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
59 |
|
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
60 |
if [ X$LOGDIR = X ]; then |
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
61 |
LOGDIR="$BLDDIR/log" |
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
62 |
fi |
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
63 |
|
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
64 |
mkdir -p "$LOGDIR" |
73
4254f0766f0d
do not break directory structure when building cmdassist
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
72
diff
changeset
|
65 |
mkdir -p $BLDDIR/SOURCES |
17 | 66 |
|
67 |
# set the http and ftp proxies if you are behind a firewall |
|
68 |
# export http_proxy= |
|
69 |
# export ftp_proxy= |
|
70 |
||
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
71 |
if [ -z $1 ]; then |
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
72 |
SPECFILES="icu.spec idnkit.spec cmdassist.spec" |
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
73 |
else |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
74 |
SPECFILES=$@ |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
75 |
fi |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
76 |
|
17 | 77 |
if [ X$FLAGPREP = 'X1' ]; then |
78 |
CMD='prep' |
|
79 |
elif [ X$FLAGALL = 'X1' ]; then |
|
80 |
CMD='build' |
|
81 |
else |
|
82 |
CMD='build-only' |
|
83 |
fi |
|
84 |
||
50 | 85 |
# Explicitly specifying location to enable to use pkgtool (pkgbuild) |
86 |
# not yet in jdsbld. |
|
87 |
PKGTOOL="/opt/pkgbuild/bin/pkgtool" |
|
88 |
||
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
89 |
#no support for IPS in Solaris 10 |
64
0b11eb1ab0b2
reenable IPS build
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
63
diff
changeset
|
90 |
if $(test `uname -r` != 5.10); then |
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
91 |
# IPS repos are created in $PKGDEST if defined in environment, |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
92 |
# otherwise in $BLDDIR (build.$MACH). |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
93 |
IPS_REPODIR="${PKGDEST:-$BLDDIR}/repo.spec" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
94 |
SRC_IPS_REPODIR="${PKGDEST:-$BLDDIR}/repoS.spec" |
50 | 95 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
96 |
export PKGBUILD_IPS_SERVER="file://$IPS_REPODIR/" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
97 |
export PKGBUILD_SRC_IPS_SERVER="file://$SRC_IPS_REPODIR/" |
50 | 98 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
99 |
rm -rf "$IPS_REPODIR" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
100 |
pkgrepo create --version 3 "$PKGBUILD_IPS_SERVER" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
101 |
pkgrepo set -s "$PKGBUILD_IPS_SERVER" publisher/prefix=${PUBLISHER} |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
102 |
rm -rf "$SRC_IPS_REPODIR" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
103 |
pkgrepo create --version 3 "$PKGBUILD_SRC_IPS_SERVER" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
104 |
pkgrepo set -s "$PKGBUILD_SRC_IPS_SERVER" publisher/prefix=${PUBLISHER} |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
105 |
fi |
50 | 106 |
|
17 | 107 |
for spec in $SPECFILES |
108 |
do |
|
109 |
case $spec in |
|
110 |
cmdassist.spec ) |
|
73
4254f0766f0d
do not break directory structure when building cmdassist
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
72
diff
changeset
|
111 |
cd $TOPDIR/cmdassist |
4254f0766f0d
do not break directory structure when building cmdassist
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
72
diff
changeset
|
112 |
dir=cmdassist |
4254f0766f0d
do not break directory structure when building cmdassist
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
72
diff
changeset
|
113 |
/usr/bin/tar cf - ../cmdassist | /usr/bin/gzip > $BLDDIR/SOURCES/cmdassist-2.0.tar.gz |
17 | 114 |
;; |
115 |
icu.spec ) |
|
51 | 116 |
cd $TOPDIR/icu |
17 | 117 |
dir=icu |
118 |
;; |
|
119 |
idnkit.spec ) |
|
51 | 120 |
cd $TOPDIR/idn |
17 | 121 |
/usr/bin/tar cf - sunothers | /usr/bin/gzip > sunothers.tar.gz |
18 | 122 |
/usr/bin/tar cf - idnconv | /usr/bin/gzip > idnconv.tar.gz |
17 | 123 |
dir=idn |
124 |
;; |
|
125 |
* ) |
|
126 |
dir=${spec%.spec} |
|
127 |
;; |
|
128 |
esac |
|
129 |
||
32
b3cb3388af53
Make the JDS inc files officially part of the repository (so that it can be built standalone)
Pavel Heimlich<pavel.heimlich@oracle.com>
parents:
18
diff
changeset
|
130 |
SPECDIRS=$TOPDIR/$dir:$TOPDIR/include |
17 | 131 |
PATCHDIRS=$TOPDIR/$dir/patches |
73
4254f0766f0d
do not break directory structure when building cmdassist
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
72
diff
changeset
|
132 |
SRCDIRS=$BLDDIR/SOURCES:$TOPDIR/$dir |
17 | 133 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
134 |
#no support for IPS in Solaris 10 and some advanced pkgtool features |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
135 |
#not present on CBE 1.7 |
64
0b11eb1ab0b2
reenable IPS build
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
63
diff
changeset
|
136 |
if $(test `uname -r` != 5.10); then |
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
137 |
PKGUNINSTALLARGS="uninstall-pkgs --nonotify --specdirs=$SPECDIRS" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
138 |
PKGBUILDARGS="$CMD --nonotify --download --topdir=$BLDDIR --specdirs=$SPECDIRS " |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
139 |
PKGBUILDARGS="$PKGBUILDARGS --pkgformat=ips" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
140 |
else |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
141 |
PKGUNINSTALLARGS="uninstall-pkgs --specdirs=$SPECDIRS" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
142 |
PKGBUILDARGS="$CMD --download --topdir=$BLDDIR --specdirs=$SPECDIRS " |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
143 |
PKGBUILDARGS="$PKGBUILDARGS --pkgformat=filesystem" |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
144 |
fi |
17 | 145 |
PKGBUILDARGS="$PKGBUILDARGS --sourcedirs=$SRCDIRS --patchdirs=$PATCHDIRS" |
72
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
146 |
PKGBUILDARGS="$PKGBUILDARGS --logdir=$LOGDIR" |
56
bdc1cfd1948c
add --halt-on-errors to pkgtool arguments - broken/uncomplete builds are useless, build process should fail
jenda
parents:
54
diff
changeset
|
147 |
PKGBUILDARGS="$PKGBUILDARGS --halt-on-errors" |
17 | 148 |
|
54 | 149 |
[[ -z "$DOWNLOADS" ]] || PKGBUILDARGS+=" --tar=$DOWNLOADS" |
150 |
||
17 | 151 |
if [ $CMD = 'build' ]; then |
152 |
echo "pkgtool $PKGUNINSTALLARGS $spec" |
|
74 | 153 |
$PKGTOOL -v $PKGUNINSTALLARGS $spec |
17 | 154 |
fi |
67
82092e851ffd
workaround for pkgbuild bug - parallel builds could use the same name for tmp dir in /var/tmp/
jenda
parents:
64
diff
changeset
|
155 |
echo "$PKGTOOL $PKGBUILDARGS --define \"ipsvendorver $IPS_VENDORVER\" --define '_tmppath %{_topdir}/TMP' $spec" |
74 | 156 |
$PKGTOOL -v $PKGBUILDARGS --define "ipsvendorver $IPS_VENDORVER" --define '_tmppath %{_topdir}/TMP' $spec || exit 1 |
50 | 157 |
|
17 | 158 |
done |
159 |
||
50 | 160 |
date |