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 # Load support functions
  28 . ../../lib/functions.sh
  29 
  30 PROG=groff       # App name
  31 VER=1.22.2       # App version
  32 PKG=text/groff    # Package name (without prefix)
  33 SUMMARY="$PROG - GNU Troff typesetting package"
  34 DESC="$SUMMARY"
  35 
  36 DEPENDS_IPS="SUNWcs system/library/gcc-5-runtime system/library/g++-5-runtime
  37         runtime/perl system/library/math system/library"
  38 
  39 BUILDARCH=32
  40 CONFIGURE_OPTS_32="--prefix=$PREFIX
  41         --sysconfdir=/etc
  42         --includedir=$PREFIX/include
  43         --bindir=$PREFIX/bin
  44         --sbindir=$PREFIX/sbin
  45         --libdir=$PREFIX/lib
  46         --libexecdir=$PREFIX/libexec"
  47 CONFIGURE_OPTS="--without-x"
  48 
  49 cleanup_gnuism() {
  50     GNUCLASH="diffmk eqn grn indxbib neqn nroff pic refer soelim"
  51     mkdir -p $DESTDIR/usr/gnu/bin
  52     for clash in $GNUCLASH ; do
  53         ln -s ../../bin/g$clash $DESTDIR/usr/gnu/bin/$clash
  54     done
  55 }
  56 
  57 install_license() {
  58     local LICENSE_FILE
  59     LICENSE_FILE=$TMPDIR/$BUILDDIR/$1
  60 
  61     if [ -f "$LICENSE_FILE" ]; then
  62         logmsg "Using $LICENSE_FILE as package license"
  63         logcmd cp $LICENSE_FILE $DESTDIR/license
  64     else
  65         logerr "-- $LICENSE_FILE not found!"
  66         exit 255
  67     fi
  68 }
  69 
  70 init
  71 download_source $PROG $PROG $VER
  72 patch_source
  73 prep_build
  74 build
  75 install_license COPYING
  76 make_isa_stub
  77 strip_install
  78 cleanup_gnuism
  79 make_package
  80 clean_up