Home | History | Annotate | Download | only in erlang
      1 # 
      2 #  CDDL HEADER START
      3 #
      4 #  The contents of this file are subject to the terms of the
      5 #  Common Development and Distribution License (the "License").
      6 #  You may not use this file except in compliance with the License.
      7 #
      8 #  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9 #  or http://www.opensolaris.org/os/licensing.
     10 #  See the License for the specific language governing permissions
     11 #  and limitations under the License.
     12 #
     13 #  When distributing Covered Code, include this CDDL HEADER in each
     14 #  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15 #  If applicable, add the following below this CDDL HEADER, with the
     16 #  fields enclosed by brackets "[]" replaced with your own identifying
     17 #  information: Portions Copyright [yyyy] [name of copyright owner]
     18 #
     19 #  CDDL HEADER END
     20 #
     21 
     22 #
     23 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 # ident	"@(#)install-doc	1.2	08/09/09 SMI"
     27 #
     28 
     29 set -e
     30 
     31 . ${SRC}/tools/install.subr
     32 VERS=R12B-1
     33 
     34 # Uncompress and install manpages
     35 
     36 MAN_SRC="otp_doc_man_${VERS}"
     37 MAN_INSTALLDIR="${ROOT}/usr/share/man"
     38 MANSCRIPT="../../../sunman-stability"
     39 
     40 mkdir -p ${MAN_SRC}
     41 (cd ${MAN_SRC};
     42     /usr/bin/gzip -dc ../${MAN_SRC}.tar.gz | /usr/bin/tar xpf -
     43     cd man;
     44     for subdir in `ls`; do
     45 	(cd $subdir;
     46 	    case $subdir in 
     47 	    	man1)
     48 		    # The following files are not installed:
     49 		    #   - start_erl.1, werl.1, erlsrv.1 (for Windows only)
     50 		    #   - start.1 (init.d script for embedded system)
     51 		    #   - start_webtool (a one-line script to start webtool app)
     52 		    suffix=1
     53 		    files="epmd.1 erl.1 erlc.1 escript.1 erl_call.1 run_erl.1"
     54 		    dstdir=$MAN_INSTALLDIR/man1
     55 		    ;;
     56 	    	man3)
     57 		    suffix=3erl
     58 		    files=`ls`
     59 		    dstdir=$MAN_INSTALLDIR/man3erl
     60 		    ;;
     61 	        man4)
     62 		    suffix=4erl
     63 		    files=`ls`
     64 		    dstdir=$MAN_INSTALLDIR/man4erl
     65 		    ;;
     66 	        man6)
     67 		    suffix=1erl
     68 		    files=`ls`
     69 		    dstdir=$MAN_INSTALLDIR/man1erl
     70 		    ;;
     71 	    esac
     72 
     73 	    for manpage in $files; do
     74 		name=`echo $manpage | cut -d. -f1`
     75 		filename=$name.$suffix
     76 		_install M $manpage $dstdir/$filename 444
     77 	    done
     78 	)
     79     done
     80 )
     81 rm -rf ${MAN_SRC}
     82 
     83 # Uncompress and install html docs
     84 
     85 DOC_SRC="otp_doc_html_${VERS}"
     86 DOC_INSTALLDIR="${ROOT}/usr/share/doc/erlang"
     87 
     88 mkdir -p ${DOC_SRC}
     89 (cd ${DOC_SRC};
     90     /usr/bin/gzip -dc ../${DOC_SRC}.tar.gz | /usr/bin/tar xpf -
     91     for subdir in `ls`; do
     92 	[ -d $subdir ] || continue
     93 	/usr/bin/cp -r $subdir $DOC_INSTALLDIR
     94     done
     95 )
     96 rm -rf ${DOC_SRC}
     97