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