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 #   * sccs
  30 #
  31 
  32 # Load support functions
  33 . ../../lib/functions.sh
  34 
  35 PROG=make
  36 VER=0.5.11
  37 PKG=developer/versioning/sccs
  38 SUMMARY="Source Code Control System (SCCS)"
  39 DESC="$SUMMARY"
  40 
  41 BUILD_DEPENDS_IPS="sunstudio12.1 compatibility/ucb"
  42 DEPENDS_IPS="system/library SUNWcs system/library/math"
  43 
  44 CONFIGURE_OPTS=""
  45 PKGE=$(url_encode $PKG)
  46 DESTDIR=$DTMPDIR/sccs
  47 
  48 prebuild_clean() {
  49     logmsg "Cleaning destdir: $DESTDIR"
  50     logcmd rm -rf $DESTDIR
  51     mkdir -p $DESTDIR/usr/bin
  52 }
  53 
  54 build() {
  55     logmsg "Building and installing ($1)"
  56     pushd $TMPDIR/$1/usr/src > /dev/null || logerr "can't enter build harness"
  57     logcmd env STUDIOBIN=/opt/sunstudio12.1/bin DESTDIR=$DESTDIR ./build ||
  58         logerr "make/install ($1) failed"
  59     popd > /dev/null
  60 }
  61 
  62 move_and_links() {
  63     logmsg "Shifting binaries and setting up links"
  64     logcmd mv $DESTDIR/usr/ccs/bin/help $DESTDIR/usr/bin/sccshelp
  65     pushd $DESTDIR/usr/ccs/bin > /dev/null || logerr "Cannot chdir"
  66     for cmd in *
  67     do
  68         logcmd mv $cmd $DESTDIR/usr/bin/ || logerr "Cannot relocate /usr/ccs/bin/$cmd"
  69         logcmd ln -s ../../$cmd $cmd
  70     done
  71     logcmd ln -s ../../sccshelp $DESTDIR/usr/ccs/bin/sccshelp
  72     logcmd ln -s ../../sccshelp $DESTDIR/usr/ccs/bin/help
  73     popd > /dev/null
  74 }
  75 
  76 init
  77 prebuild_clean
  78 BUILDDIR=devpro-sccs-20061219
  79 download_source devpro devpro-sccs src-20061219
  80 build devpro-sccs-20061219
  81 move_and_links
  82 make_package
  83 clean_up