author | jenda |
Tue, 10 May 2011 16:58:13 +0200 | |
changeset 74 | 0ff042a1dba1 |
parent 73 | 4254f0766f0d |
child 75 | a80eed27a41f |
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 |
||
74 | 22 |
export CC=/opt/SUNWspro/bin/cc |
23 |
export CXX=/opt/SUNWspro/bin/CC |
|
24 |
export MAKE=gmake |
|
17 | 25 |
|
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
|
26 |
while getopts pad:l:n option |
17 | 27 |
do |
28 |
case $option in |
|
29 |
p) FLAGPREP=1;; |
|
30 |
a) FLAGALL=1;; |
|
31 |
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
|
32 |
l) LOGDIR="$OPTARG";; |
17 | 33 |
n) NOTCPFLAG=1;; |
34 |
?) printf "$usage" ; exit ;; |
|
35 |
esac |
|
36 |
done |
|
37 |
shift $(expr $OPTIND - 1) |
|
38 |
||
39 |
if [ X$TOPDIR = X ]; then |
|
40 |
if echo $0 | egrep -s '^/'; then |
|
41 |
TOPDIR=$(dirname $0) |
|
42 |
else |
|
43 |
TOPDIR="`pwd`/$(dirname $0)" |
|
44 |
fi |
|
45 |
fi |
|
50 | 46 |
|
47 |
MACH="${MACH:-`uname -p`}" |
|
48 |
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
|
49 |
|
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
50 |
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
|
51 |
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
|
52 |
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
|
53 |
|
5ac380294447
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs to NFS work dir
jenda
parents:
69
diff
changeset
|
54 |
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
|
55 |
mkdir -p $BLDDIR/SOURCES |
17 | 56 |
|
57 |
# set the http and ftp proxies if you are behind a firewall |
|
58 |
# export http_proxy= |
|
59 |
# export ftp_proxy= |
|
60 |
||
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
61 |
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
|
62 |
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
|
63 |
else |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
64 |
SPECFILES=$@ |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
65 |
fi |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
66 |
|
17 | 67 |
if [ X$FLAGPREP = 'X1' ]; then |
68 |
CMD='prep' |
|
69 |
elif [ X$FLAGALL = 'X1' ]; then |
|
70 |
CMD='build' |
|
71 |
else |
|
72 |
CMD='build-only' |
|
73 |
fi |
|
74 |
||
50 | 75 |
# Explicitly specifying location to enable to use pkgtool (pkgbuild) |
76 |
# not yet in jdsbld. |
|
77 |
PKGTOOL="/opt/pkgbuild/bin/pkgtool" |
|
78 |
||
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
79 |
#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
|
80 |
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
|
81 |
# 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
|
82 |
# 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
|
83 |
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
|
84 |
SRC_IPS_REPODIR="${PKGDEST:-$BLDDIR}/repoS.spec" |
50 | 85 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
86 |
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
|
87 |
export PKGBUILD_SRC_IPS_SERVER="file://$SRC_IPS_REPODIR/" |
50 | 88 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
89 |
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
|
90 |
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
|
91 |
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
|
92 |
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
|
93 |
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
|
94 |
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
|
95 |
fi |
50 | 96 |
|
17 | 97 |
for spec in $SPECFILES |
98 |
do |
|
99 |
case $spec in |
|
100 |
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
|
101 |
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
|
102 |
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
|
103 |
/usr/bin/tar cf - ../cmdassist | /usr/bin/gzip > $BLDDIR/SOURCES/cmdassist-2.0.tar.gz |
17 | 104 |
;; |
105 |
icu.spec ) |
|
51 | 106 |
cd $TOPDIR/icu |
17 | 107 |
dir=icu |
108 |
;; |
|
109 |
idnkit.spec ) |
|
51 | 110 |
cd $TOPDIR/idn |
17 | 111 |
/usr/bin/tar cf - sunothers | /usr/bin/gzip > sunothers.tar.gz |
18 | 112 |
/usr/bin/tar cf - idnconv | /usr/bin/gzip > idnconv.tar.gz |
17 | 113 |
dir=idn |
114 |
;; |
|
115 |
* ) |
|
116 |
dir=${spec%.spec} |
|
117 |
;; |
|
118 |
esac |
|
119 |
||
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
|
120 |
SPECDIRS=$TOPDIR/$dir:$TOPDIR/include |
17 | 121 |
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
|
122 |
SRCDIRS=$BLDDIR/SOURCES:$TOPDIR/$dir |
17 | 123 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
124 |
#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
|
125 |
#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
|
126 |
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
|
127 |
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
|
128 |
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
|
129 |
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
|
130 |
else |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
131 |
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
|
132 |
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
|
133 |
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
|
134 |
fi |
17 | 135 |
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
|
136 |
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
|
137 |
PKGBUILDARGS="$PKGBUILDARGS --halt-on-errors" |
17 | 138 |
|
54 | 139 |
[[ -z "$DOWNLOADS" ]] || PKGBUILDARGS+=" --tar=$DOWNLOADS" |
140 |
||
17 | 141 |
if [ $CMD = 'build' ]; then |
142 |
echo "pkgtool $PKGUNINSTALLARGS $spec" |
|
74 | 143 |
$PKGTOOL -v $PKGUNINSTALLARGS $spec |
17 | 144 |
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
|
145 |
echo "$PKGTOOL $PKGBUILDARGS --define \"ipsvendorver $IPS_VENDORVER\" --define '_tmppath %{_topdir}/TMP' $spec" |
74 | 146 |
$PKGTOOL -v $PKGBUILDARGS --define "ipsvendorver $IPS_VENDORVER" --define '_tmppath %{_topdir}/TMP' $spec || exit 1 |
50 | 147 |
|
17 | 148 |
done |
149 |
||
50 | 150 |
date |