enable building icu on Solaris 10
authorpavel heimlich - Oracle - Prague Czech Republic <Pavel.Heimlich@Oracle.COM>
Fri, 01 Apr 2011 16:48:49 +0200
changeset 63 c3844fcbdc56
parent 62 b2ee5ba27d9c
child 64 0b11eb1ab0b2
enable building icu on Solaris 10
build-g11n-spec.sh
icu/icu.spec
include/Solaris.inc
--- a/build-g11n-spec.sh	Fri Mar 25 10:41:20 2011 +0100
+++ b/build-g11n-spec.sh	Fri Apr 01 16:48:49 2011 +0200
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+#For use on Solaris 10, CBE 1.7.0-RC1 is assumed to be installed and
+#the below symlinks created
+# ln -s /opt/dtbld /opt/jdsbld
+# ln -s /opt/dtbld /opt/pkgbuild
+
 # Build IM pkgs
 usage="$(basename $0) [-d <topdir>] [-p] [-b] [-n] [spec files...]"
 usage="$usage\nDefault build type is 'build-only'"
@@ -58,7 +63,7 @@
 # export ftp_proxy=
 
 if [ -z $1 ]; then
-    SPECFILES="cmdassist.spec icu.spec idnkit.spec"
+    SPECFILES="icu.spec idnkit.spec cmdassist.spec"
 else
     SPECFILES=$@
 fi
@@ -75,20 +80,23 @@
 # not yet in jdsbld.
 PKGTOOL="/opt/pkgbuild/bin/pkgtool"
 
-# IPS repos are created in $PKGDEST if defined in environment,
-# otherwise in $BLDDIR (build.$MACH).
-IPS_REPODIR="${PKGDEST:-$BLDDIR}/repo.spec"
-SRC_IPS_REPODIR="${PKGDEST:-$BLDDIR}/repoS.spec"
+#no support for IPS in Solaris 10
+if $(test `uname -r` != 5.10 && echo 1); then
+    # IPS repos are created in $PKGDEST if defined in environment,
+    # otherwise in $BLDDIR (build.$MACH).
+    IPS_REPODIR="${PKGDEST:-$BLDDIR}/repo.spec"
+    SRC_IPS_REPODIR="${PKGDEST:-$BLDDIR}/repoS.spec"
 
-export PKGBUILD_IPS_SERVER="file://$IPS_REPODIR/"
-export PKGBUILD_SRC_IPS_SERVER="file://$SRC_IPS_REPODIR/"
+    export PKGBUILD_IPS_SERVER="file://$IPS_REPODIR/"
+    export PKGBUILD_SRC_IPS_SERVER="file://$SRC_IPS_REPODIR/"
 
-rm -rf "$IPS_REPODIR"
-pkgrepo create --version 3 "$PKGBUILD_IPS_SERVER"
-pkgrepo set -s "$PKGBUILD_IPS_SERVER" publisher/prefix=${PUBLISHER}
-rm -rf "$SRC_IPS_REPODIR"
-pkgrepo create --version 3 "$PKGBUILD_SRC_IPS_SERVER"
-pkgrepo set -s "$PKGBUILD_SRC_IPS_SERVER" publisher/prefix=${PUBLISHER}
+    rm -rf "$IPS_REPODIR"
+    pkgrepo create --version 3 "$PKGBUILD_IPS_SERVER"
+    pkgrepo set -s "$PKGBUILD_IPS_SERVER" publisher/prefix=${PUBLISHER}
+    rm -rf "$SRC_IPS_REPODIR"
+    pkgrepo create --version 3 "$PKGBUILD_SRC_IPS_SERVER"
+    pkgrepo set -s "$PKGBUILD_SRC_IPS_SERVER" publisher/prefix=${PUBLISHER}
+fi
 
 for spec in $SPECFILES
 do
@@ -122,11 +130,19 @@
     PATCHDIRS=$TOPDIR/$dir/patches
     SRCDIRS=$TOPDIR/$dir
 
-    PKGUNINSTALLARGS="uninstall-pkgs --nonotify --specdirs=$SPECDIRS"
-    PKGBUILDARGS="$CMD --nonotify --download --topdir=$BLDDIR --specdirs=$SPECDIRS "
+    #no support for IPS in Solaris 10 and some advanced pkgtool features 
+    #not present on CBE 1.7
+    if $(test `uname -r` != 5.10 && echo 1); then
+        PKGUNINSTALLARGS="uninstall-pkgs --nonotify --specdirs=$SPECDIRS"
+        PKGBUILDARGS="$CMD --nonotify --download --topdir=$BLDDIR --specdirs=$SPECDIRS "
+        PKGBUILDARGS="$PKGBUILDARGS --pkgformat=ips"
+    else
+        PKGUNINSTALLARGS="uninstall-pkgs --specdirs=$SPECDIRS"
+        PKGBUILDARGS="$CMD --download --topdir=$BLDDIR --specdirs=$SPECDIRS "
+        PKGBUILDARGS="$PKGBUILDARGS --pkgformat=filesystem"
+    fi
     PKGBUILDARGS="$PKGBUILDARGS --sourcedirs=$SRCDIRS --patchdirs=$PATCHDIRS"
     PKGBUILDARGS="$PKGBUILDARGS --logdir=$BLDDIR/log"
-    PKGBUILDARGS="$PKGBUILDARGS --pkgformat=ips"
     PKGBUILDARGS="$PKGBUILDARGS --halt-on-errors"
 
     [[ -z "$DOWNLOADS" ]] || PKGBUILDARGS+=" --tar=$DOWNLOADS"
--- a/icu/icu.spec	Fri Mar 25 10:41:20 2011 +0100
+++ b/icu/icu.spec	Fri Apr 01 16:48:49 2011 +0200
@@ -23,9 +23,12 @@
 Release: 1
 Summary: International Components for Unicode
 Copyright: X License, Unicode License
+%if %{is_s10}
+%else
 IPS_Package_Name:	library/icu
 IPS_Component_Version:	%{ipscompverdefault}
 Meta(info.classification):	%{ipsclass_sys_i18n}
+%endif
 #Source: %{src_url}/%{version}/icu4c-%{pkgversion}-src.tgz
 Source1: old_libs.tar.gz
 Source2: libicui18n.3lib
@@ -67,7 +70,10 @@
 
 %package -n SUNWicud
 Summary: International Components for Unicode (development files)
+%if %{is_s10}
+%else
 IPS_Package_Name:	developer/icu
+%endif
 %include icu.depend
 Requires: SUNWicu
 %description -n SUNWicud
@@ -85,7 +91,7 @@
 	[ -f $DOWNLOADS/%{src_name}-%version.tar.bz2 ] && {
 		cp $DOWNLOADS/%{src_name}-%version.tar.bz2 $HOME/packages/SOURCES/%{src_name}-%version.tar.bz2
 	} || {
-  		/usr/bin/svn export %{svn_url}/tags/release-%{svn_pkgversion} %{src_name}
+  		svn export %{svn_url}/tags/release-%{svn_pkgversion} %{src_name}
         	tar fcp - %{src_name} | bzip2 -c > $HOME/packages/SOURCES/%{src_name}-%version.tar.bz2
 	}
 }
--- a/include/Solaris.inc	Fri Mar 25 10:41:20 2011 +0100
+++ b/include/Solaris.inc	Fri Apr 01 16:48:49 2011 +0200
@@ -18,9 +18,12 @@
 %define is_s10    %(test `uname -r` = 5.10 && echo 1 || echo 0)
 %define _patch_options --fuzz=0 --unified
 
+%if %{is_s10}
+%else
 %define ipscompverdefault	0.5.11
 IPS_Build_Version:	5.11
 IPS_Vendor_Version:	%{ipsvendorver}
+%endif
 
 %define	ipsclass_pref08	org.opensolaris.category.2008
 %define	ipsclass_sys_i18n	%{ipsclass_pref08}:System/Internationalization