1 #!/usr/bin/bash
   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License, Version 1.0 only
   7 # (the "License").  You may not use this file except in compliance
   8 # with the License.
   9 #
  10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  11 # or http://www.opensolaris.org/os/licensing.
  12 # See the License for the specific language governing permissions
  13 # and limitations under the License.
  14 #
  15 # When distributing Covered Code, include this CDDL HEADER in each
  16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  17 # If applicable, add the following below this CDDL HEADER, with the
  18 # fields enclosed by brackets "[]" replaced with your own identifying
  19 # information: Portions Copyright [yyyy] [name of copyright owner]
  20 #
  21 # CDDL HEADER END
  22 #
  23 #
  24 # Copyright 2011-2012 OmniTI Computer Consulting, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #
  27 # this will build
  28 #
  29 #   * make
  30 #   * sccs
  31 #   * assorted bin-only bits: (from sub root)
  32 #     * as
  33 #     * libtdf
  34 #     * libxprof
  35 #     * libxprof_audit
  36 
  37 # Load support functions
  38 . ../../lib/functions.sh
  39 
  40 PROG=make
  41 VER=0.5.11
  42 PKG=developer/build/make
  43 SUMMARY="OmniOS Bundled Development Tools (aka DevPro)"
  44 DESC="$SUMMARY"
  45 
  46 BUILD_DEPENDS_IPS="sunstudio12.1 compatibility/ucb"
  47 DEPENDS_IPS="system/library SUNWcs system/library/math"
  48 
  49 CONFIGURE_OPTS=""
  50 PKGE=$(url_encode $PKG)
  51 DESTDIR=$DTMPDIR/make_pkg
  52 
  53 prebuild_clean() {
  54     logmsg "Cleaning destdir: $DESTDIR"
  55     logcmd rm -rf $DESTDIR
  56 }
  57 
  58 build() {
  59     logmsg "Building and installing ($1)"
  60     pushd $TMPDIR/$1/usr/src > /dev/null || logerr "can't enter build harness"
  61     logcmd env STUDIOBIN=/opt/sunstudio12.1/bin DESTDIR=$DESTDIR ./build ||
  62         logerr "make/install ($1) failed"
  63     popd > /dev/null
  64 }
  65 
  66 place_bins() {
  67     logmsg "Moving closed bins into place"
  68     (cd $SRCDIR/root && tar cf - .) | (cd $DESTDIR && tar xf -) ||
  69         logerr "Failed to copy closed bins"
  70 }
  71 move_and_links() {
  72     logmsg "Shifting binaries and setting up links"
  73     logcmd mv $DESTDIR/usr/ccs/bin/help $DESTDIR/usr/bin/sccshelp
  74     pushd $DESTDIR/usr/ccs/bin > /dev/null || logerr "Cannot chdir"
  75     for cmd in *
  76     do
  77         logcmd mv $cmd $DESTDIR/usr/bin/ || logerr "Cannot relocate /usr/ccs/bin/$cmd"
  78         logcmd ln -s ../../$cmd $cmd
  79     done
  80     logcmd ln -s ../../sccshelp $DESTDIR/usr/ccs/bin/sccshelp
  81     logcmd ln -s ../../sccshelp $DESTDIR/usr/ccs/bin/help
  82     popd > /dev/null
  83 }
  84 
  85 init
  86 
  87 prebuild_clean
  88 
  89 BUILDDIR=devpro-make-20061219
  90 download_source devpro devpro-make src-20061219
  91 build devpro-make-20061219
  92 
  93 BUILDDIR=devpro-sccs-20061219
  94 download_source devpro devpro-sccs src-20061219
  95 build devpro-sccs-20061219
  96 
  97 place_bins
  98 move_and_links
  99 
 100 make_package
 101 clean_up