author | mkaz |
Sat, 27 Aug 2011 04:34:21 +0900 | |
changeset 706 | ca594d31f781 |
parent 703 | 404e61d9e7bd |
permissions | -rwxr-xr-x |
109
32b33798239f
Added the build script build-im.sh for the spec files.
yongsun@agc130
parents:
diff
changeset
|
1 |
#!/bin/bash |
32b33798239f
Added the build script build-im.sh for the spec files.
yongsun@agc130
parents:
diff
changeset
|
2 |
|
469 | 3 |
# Build IM pkgs |
672
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
4 |
usage="$(basename $0) [-d <topdir>] [-l <logdir>] [-p] [-b] [-n] [spec files...]" |
470
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
5 |
usage="$usage\nDefault build type is 'build-only'" |
469 | 6 |
usage="$usage\n -d <topdir>: specify another top dir." |
672
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
7 |
usage="$usage\n -l <logdir>: specify another dir for build logs." |
469 | 8 |
usage="$usage\n -p : source prep only." |
470
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
9 |
usage="$usage\n -a : uninstall/build/install." |
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
10 |
usage="$usage\n -n : NOT compress/copy to $HOME/packages\n" |
469 | 11 |
|
644 | 12 |
date |
13 |
||
14 |
IPS_VENDORVER=0.${L10N_BUILDNUM:-"155"} |
|
15 |
PUBLISHER=${L10N_PUBLISHER:-"l10n-nightly"} |
|
646 | 16 |
|
673 | 17 |
export LC_ALL=C |
678
279d4856c549
$CC and $CXX must be set, otherwise some configure scripts select gcc (if installed) as defatult compiler
jenda
parents:
674
diff
changeset
|
18 |
export MAKE=${MAKE:-gmake} |
279d4856c549
$CC and $CXX must be set, otherwise some configure scripts select gcc (if installed) as defatult compiler
jenda
parents:
674
diff
changeset
|
19 |
export CC=${CC:-/opt/SUNWspro/bin/cc} |
279d4856c549
$CC and $CXX must be set, otherwise some configure scripts select gcc (if installed) as defatult compiler
jenda
parents:
674
diff
changeset
|
20 |
export CXX=${CXX:-/opt/SUNWspro/bin/CC} |
109
32b33798239f
Added the build script build-im.sh for the spec files.
yongsun@agc130
parents:
diff
changeset
|
21 |
|
674
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
22 |
# |
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
23 |
# libtool swallows -norunpath option in $(CXXLINK) cmd |
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
24 |
# add -norunpath in $CXX env value |
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
25 |
# more details: |
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
26 |
# http://monaco.sfbay.sun.com/detail.jsf?cr=6497744 |
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
27 |
# http://mail.opensolaris.org/pipermail/jds-notify/2007-April/001799.html |
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
28 |
# |
678
279d4856c549
$CC and $CXX must be set, otherwise some configure scripts select gcc (if installed) as defatult compiler
jenda
parents:
674
diff
changeset
|
29 |
export CXX="$CXX -norunpath" |
674
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
30 |
|
50d325a97b6d
set CXX in build-im.sh, otherwise export CXX="$CXX -norunpath" line in spec files fails to set correct $CXX
jenda
parents:
673
diff
changeset
|
31 |
|
672
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
32 |
while getopts pad:l:n option |
469 | 33 |
do |
34 |
case $option in |
|
35 |
p) FLAGPREP=1;; |
|
470
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
36 |
a) FLAGALL=1;; |
469 | 37 |
d) TOPDIR="$OPTARG";; |
672
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
38 |
l) LOGDIR="$OPTARG";; |
470
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
39 |
n) NOTCPFLAG=1;; |
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
40 |
?) printf "$usage" ; exit ;; |
469 | 41 |
esac |
42 |
done |
|
646 | 43 |
shift $(expr $OPTIND - 1) |
469 | 44 |
|
646 | 45 |
if [ X$TOPDIR = X ]; then |
469 | 46 |
if echo $0 | egrep -s '^/'; then |
637
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
47 |
TOPDIR=$(dirname $0) |
469 | 48 |
else |
637
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
49 |
TOPDIR="`pwd`/$(dirname $0)" |
469 | 50 |
fi |
51 |
fi |
|
52 |
||
646 | 53 |
MACH="${MACH:-`uname -p`}" |
54 |
BLDDIR="$TOPDIR/build.$MACH" |
|
55 |
||
672
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
56 |
if [ X$LOGDIR = X ]; then |
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
57 |
LOGDIR="$BLDDIR/log" |
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
58 |
fi |
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
59 |
|
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
60 |
mkdir -p "$LOGDIR" |
b638b2a52a6f
add '-l logdir' to build-g11n-spec.sh - used in jffmake to put logs directly to NFS work dir
jenda
parents:
662
diff
changeset
|
61 |
|
109
32b33798239f
Added the build script build-im.sh for the spec files.
yongsun@agc130
parents:
diff
changeset
|
62 |
# set the http and ftp proxies if you are behind a firewall |
32b33798239f
Added the build script build-im.sh for the spec files.
yongsun@agc130
parents:
diff
changeset
|
63 |
# export http_proxy= |
469 | 64 |
# export ftp_proxy= |
65 |
||
637
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
66 |
SPECDIRS=include |
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
67 |
PATCHDIRS=patches |
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
68 |
SRCDIRS=ext-sources |
109
32b33798239f
Added the build script build-im.sh for the spec files.
yongsun@agc130
parents:
diff
changeset
|
69 |
|
200
fbcf66be94be
Refined the build-im.sh, spec files and copyright files.
yongsun@localhost
parents:
146
diff
changeset
|
70 |
if [ -z $1 ]; then |
469 | 71 |
# spec files. ordering due to dependency. |
72 |
LIBSPECS="libanthy.spec libhangul.spec libchewing.spec libdatrie.spec" |
|
73 |
LIBSPECS="$LIBSPECS libthai.spec" |
|
74 |
||
75 |
IIIMSPECS="iiim-hangul.spec iiim-thai.spec" |
|
76 |
||
77 |
M17NSPECS="m17n-lib-core.spec m17n-db.spec m17n-im-config.spec" |
|
78 |
M17NSPECS="$M17NSPECS m17n-contrib.spec" |
|
79 |
||
80 |
IBUSSPECS="gob2.spec ibus.spec ibus-anthy.spec ibus-m17n.spec" |
|
81 |
IBUSSPECS="$IBUSSPECS ibus-chewing.spec ibus-pinyin.spec ibus-hangul.spec" |
|
82 |
IBUSSPECS="$IBUSSPECS ibus-sunpinyin.spec ibus-table.spec" |
|
83 |
IBUSSPECS="$IBUSSPECS ibus-table-extraphrase.spec ibus-table-data.spec" |
|
662 | 84 |
IBUSSPECS="$IBUSSPECS ibus-xkbc.spec ibus-sayura.spec imf-selector.spec" |
469 | 85 |
|
706
ca594d31f781
SCIM obsolete S11 B174. 7082699 SCIM component packages are needed to obsolete from S11
mkaz
parents:
703
diff
changeset
|
86 |
SPECFILES="$LIBSPECS $IIIMSPECS $M17NSPECS $IBUSSPECS" |
470
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
87 |
|
200
fbcf66be94be
Refined the build-im.sh, spec files and copyright files.
yongsun@localhost
parents:
146
diff
changeset
|
88 |
else |
fbcf66be94be
Refined the build-im.sh, spec files and copyright files.
yongsun@localhost
parents:
146
diff
changeset
|
89 |
SPECFILES=$@ |
fbcf66be94be
Refined the build-im.sh, spec files and copyright files.
yongsun@localhost
parents:
146
diff
changeset
|
90 |
fi |
469 | 91 |
|
92 |
if [ X$FLAGPREP = 'X1' ]; then |
|
93 |
CMD='prep' |
|
470
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
94 |
elif [ X$FLAGALL = 'X1' ]; then |
646 | 95 |
CMD='build' |
469 | 96 |
else |
470
6499c89e66ac
Revise build script to align nightly build environment.
mkaz
parents:
469
diff
changeset
|
97 |
CMD='build-only' |
469 | 98 |
fi |
99 |
||
644 | 100 |
|
703 | 101 |
PKGBUILDARGS="-v --halt-on-errors --nonotify --download --topdir=$BLDDIR --spec=$SPECDIRS --src=$SRCDIRS --patchdirs=$PATCHDIRS --log=$LOGDIR --pkgformat=ips --nosourcepkg" |
648
92cf0d090fca
specs/build-im.sh tries to search sources in $DOWNLOADS dir if set
jenda
parents:
646
diff
changeset
|
102 |
|
652
bdd0d0363f53
fix nightly fail to find iiimf-ko-hangul and iiimf-th-thaile sources
jenda
parents:
651
diff
changeset
|
103 |
[[ -z "$DOWNLOADS" ]] || PKGBUILDARGS+=" --tar=$BLDDIR/SOURCES:$DOWNLOADS" |
644 | 104 |
|
105 |
# Explicitly specifying location to enable to use pkgtool (pkgbuild) |
|
106 |
# not yet in jdsbld. |
|
107 |
PKGTOOL="/opt/pkgbuild/bin/pkgtool" |
|
108 |
||
109 |
# IPS repos are created in $PKGDEST if defined in environment, |
|
110 |
# otherwise in $BLDDIR (inputmethod/specs/build.$MACH). |
|
646 | 111 |
IPS_REPODIR="${PKGDEST:-$BLDDIR}/repo.imspec" |
644 | 112 |
|
113 |
export PKGBUILD_IPS_SERVER="file://$IPS_REPODIR/" |
|
114 |
||
115 |
rm -rf "$IPS_REPODIR" |
|
703 | 116 |
pkgrepo create "$PKGBUILD_IPS_SERVER" |
644 | 117 |
pkgrepo set -s "$PKGBUILD_IPS_SERVER" publisher/prefix=${PUBLISHER} |
119 | 118 |
|
637
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
119 |
if [ $CMD = 'build' ]; then |
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
120 |
echo "pkgtool uninstall-pkgs $PKGBUILDARGS $SPECFILES" |
641 | 121 |
(cd $TOPDIR; pkgtool uninstall-pkgs $PKGBUILDARGS $SPECFILES) |
637
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
122 |
fi |
a5c2fd554d56
allow simultaneous builds - pkgbuild used shared buildroot in /var/tmp/
jenda
parents:
633
diff
changeset
|
123 |
|
644 | 124 |
echo "$PKGTOOL $CMD $PKGBUILDARGS --define \"ipsvendorver $IPS_VENDORVER\" --define '_tmppath %{_topdir}/TMP' $SPECFILES" |
661
af03228e30b8
specs/build-im.sh returns error exit code if build fails
jenda
parents:
652
diff
changeset
|
125 |
|
af03228e30b8
specs/build-im.sh returns error exit code if build fails
jenda
parents:
652
diff
changeset
|
126 |
cd $TOPDIR |
af03228e30b8
specs/build-im.sh returns error exit code if build fails
jenda
parents:
652
diff
changeset
|
127 |
$PKGTOOL $CMD $PKGBUILDARGS --define "ipsvendorver $IPS_VENDORVER" --define '_tmppath %{_topdir}/TMP' $SPECFILES || exit 1 |
130 | 128 |
|
644 | 129 |
date |