author | pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM> |
Fri, 06 May 2011 10:42:45 +0200 | |
changeset 70 | 68bcfc1824e8 |
parent 69 | 716f3a2e9da1 |
child 72 | 5ac380294447 |
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 |
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
9 |
usage="$(basename $0) [-d <topdir>] [-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." |
|
12 |
usage="$usage\n -p : source prep only." |
|
13 |
usage="$usage\n -a : uninstall/build/install." |
|
14 |
usage="$usage\n -n : NOT compress/copy to $HOME/packages\n" |
|
15 |
||
16 |
# check /opt/jdsbld |
|
17 |
if [ ! -d /opt/jdsbld ];then |
|
18 |
echo "Need jds build tools in /opt/jdsbld" |
|
19 |
exit 1 |
|
20 |
fi |
|
21 |
||
50 | 22 |
date |
23 |
||
24 |
IPS_VENDORVER=0.${L10N_BUILDNUM:-"155"} |
|
25 |
PUBLISHER=${L10N_PUBLISHER:-"l10n-nightly"} |
|
26 |
||
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
27 |
rm -f /tmp/.build_env.$$ |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
28 |
[ -z "$PKGDEST" ] || echo "export PKGDEST=$PKGDEST" >> /tmp/.build_env.$$ |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
29 |
[ -z "$IPS_VENDORVER" ] || echo "export IPS_VENDORVER=$IPS_VENDORVER" >> /tmp/.build_env.$$ |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
30 |
[ -z "$PUBLISHER" ] || echo "export PUBLISHER=$PUBLISHER" >> /tmp/.build_env.$$ |
54 | 31 |
[ -z "$DOWNLOADS" ] || echo "export DOWNLOADS=$DOWNLOADS" >> /tmp/.build_env.$$ |
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
32 |
|
17 | 33 |
source /opt/jdsbld/bin/env.sh |
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
34 |
|
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
35 |
. /tmp/.build_env.$$ |
17 | 36 |
|
37 |
while getopts pad:n option |
|
38 |
do |
|
39 |
case $option in |
|
40 |
p) FLAGPREP=1;; |
|
41 |
a) FLAGALL=1;; |
|
42 |
d) TOPDIR="$OPTARG";; |
|
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" |
|
59 |
mkdir -p $BLDDIR/log |
|
17 | 60 |
|
61 |
# set the http and ftp proxies if you are behind a firewall |
|
62 |
# export http_proxy= |
|
63 |
# export ftp_proxy= |
|
64 |
||
53
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
65 |
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
|
66 |
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
|
67 |
else |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
68 |
SPECFILES=$@ |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
69 |
fi |
7a8315ebf19d
build-g11n-spec.sh: fix $PKGDEST, $IPS_VENDORVER and $PUBLISHER handling - jdsbld/bin/env.sh cleaned them
jenda
parents:
51
diff
changeset
|
70 |
|
17 | 71 |
if [ X$FLAGPREP = 'X1' ]; then |
72 |
CMD='prep' |
|
73 |
elif [ X$FLAGALL = 'X1' ]; then |
|
74 |
CMD='build' |
|
75 |
else |
|
76 |
CMD='build-only' |
|
77 |
fi |
|
78 |
||
50 | 79 |
# Explicitly specifying location to enable to use pkgtool (pkgbuild) |
80 |
# not yet in jdsbld. |
|
81 |
PKGTOOL="/opt/pkgbuild/bin/pkgtool" |
|
82 |
||
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
83 |
#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
|
84 |
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
|
85 |
# 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
|
86 |
# 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
|
87 |
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
|
88 |
SRC_IPS_REPODIR="${PKGDEST:-$BLDDIR}/repoS.spec" |
50 | 89 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
90 |
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
|
91 |
export PKGBUILD_SRC_IPS_SERVER="file://$SRC_IPS_REPODIR/" |
50 | 92 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
93 |
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
|
94 |
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
|
95 |
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
|
96 |
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
|
97 |
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
|
98 |
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
|
99 |
fi |
50 | 100 |
|
17 | 101 |
for spec in $SPECFILES |
102 |
do |
|
103 |
case $spec in |
|
104 |
cmdassist.spec ) |
|
51 | 105 |
cd $TOPDIR |
17 | 106 |
cp cmdassist/COPYING cmdassist/cmdassist.copyright |
50 | 107 |
VERSION=`egrep "^Version:" cmdassist/cmdassist.spec | awk '{print $2}'` |
17 | 108 |
mv cmdassist cmdassist-${VERSION} |
109 |
/usr/bin/tar cf - cmdassist-${VERSION} | /usr/bin/gzip > cmdassist-${VERSION}.tar.gz |
|
110 |
mv cmdassist-${VERSION}.tar.gz cmdassist-${VERSION}/ |
|
111 |
dir=cmdassist-${VERSION} |
|
112 |
;; |
|
113 |
icu.spec ) |
|
51 | 114 |
cd $TOPDIR/icu |
17 | 115 |
dir=icu |
116 |
;; |
|
117 |
idnkit.spec ) |
|
51 | 118 |
cd $TOPDIR/idn |
17 | 119 |
/usr/bin/tar cf - sunothers | /usr/bin/gzip > sunothers.tar.gz |
18 | 120 |
/usr/bin/tar cf - idnconv | /usr/bin/gzip > idnconv.tar.gz |
17 | 121 |
dir=idn |
122 |
;; |
|
123 |
* ) |
|
124 |
dir=${spec%.spec} |
|
125 |
;; |
|
126 |
esac |
|
127 |
||
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
|
128 |
SPECDIRS=$TOPDIR/$dir:$TOPDIR/include |
17 | 129 |
PATCHDIRS=$TOPDIR/$dir/patches |
50 | 130 |
SRCDIRS=$TOPDIR/$dir |
17 | 131 |
|
63
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
132 |
#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
|
133 |
#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
|
134 |
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
|
135 |
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
|
136 |
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
|
137 |
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
|
138 |
else |
c3844fcbdc56
enable building icu on Solaris 10
pavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
parents:
57
diff
changeset
|
139 |
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
|
140 |
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
|
141 |
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
|
142 |
fi |
17 | 143 |
PKGBUILDARGS="$PKGBUILDARGS --sourcedirs=$SRCDIRS --patchdirs=$PATCHDIRS" |
50 | 144 |
PKGBUILDARGS="$PKGBUILDARGS --logdir=$BLDDIR/log" |
56
bdc1cfd1948c
add --halt-on-errors to pkgtool arguments - broken/uncomplete builds are useless, build process should fail
jenda
parents:
54
diff
changeset
|
145 |
PKGBUILDARGS="$PKGBUILDARGS --halt-on-errors" |
17 | 146 |
|
54 | 147 |
[[ -z "$DOWNLOADS" ]] || PKGBUILDARGS+=" --tar=$DOWNLOADS" |
148 |
||
17 | 149 |
if [ $CMD = 'build' ]; then |
150 |
echo "pkgtool $PKGUNINSTALLARGS $spec" |
|
50 | 151 |
$PKGTOOL $PKGUNINSTALLARGS $spec |
17 | 152 |
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
|
153 |
echo "$PKGTOOL $PKGBUILDARGS --define \"ipsvendorver $IPS_VENDORVER\" --define '_tmppath %{_topdir}/TMP' $spec" |
82092e851ffd
workaround for pkgbuild bug - parallel builds could use the same name for tmp dir in /var/tmp/
jenda
parents:
64
diff
changeset
|
154 |
$PKGTOOL $PKGBUILDARGS --define "ipsvendorver $IPS_VENDORVER" --define '_tmppath %{_topdir}/TMP' $spec || exit 1 |
50 | 155 |
|
156 |
# tentative workaround: should eliminate the previous mv instead, |
|
157 |
# after verifying that directory name does not affect build result |
|
158 |
if [ "$spec" = "cmdassist.spec" ] |
|
159 |
then |
|
160 |
mv "$dir" cmdassist |
|
161 |
fi |
|
17 | 162 |
done |
163 |
||
50 | 164 |
date |