Annotation of 3BSD/cmd/Admin/mk, revision 1.1.1.1

1.1       root        1: trap "" 1
                      2: DESTDIR=${DESTDIR-/usr/dist3}
                      3: CC=cc
                      4: 
                      5: : make sure directory hierarchy exists
                      6: (      cd $DESTDIR
                      7:        for i in bin etc lib sys usr
                      8:        do      if [ ! -d $i ]
                      9:                then rm -f $i; mkdir $i
                     10:                fi
                     11:        done
                     12:        cd $DESTDIR/usr
                     13:        for i in bin dict games lib net spool ucb vpd
                     14:        do      if [ ! -d $i ]
                     15:                then rm -f $i; mkdir $i
                     16:                fi
                     17:        done
                     18:        cd $DESTDIR/usr/lib
                     19:        for i in learn lex lisp refer struct term tmac uucp
                     20:        do      if [ ! -d $i ]
                     21:                then rm -f $i; mkdir $i
                     22:                fi
                     23:        done
                     24:        cd $DESTDIR/usr/net
                     25:        for i in bin network
                     26:        do      if [ ! -d $i ]
                     27:                then rm -f $i; mkdir $i
                     28:                fi
                     29:        done
                     30:        cd $DESTDIR/usr/spool
                     31:        for i in lpd mail secretmail uucp uucppublic vpd
                     32:        do      if [ ! -d $i ]
                     33:                then rm -f $i; mkdir $i
                     34:                fi
                     35:        done
                     36: )
                     37: : cd ..
                     38: 
                     39: for i in $*
                     40: do     echo "  ======== $i"
                     41: 
                     42:        CFLAGS='-O -d2'
                     43:        case $i in
                     44:        512restor.c|analyze.c|colcrt.c|dump.c|dumpdir.c|egrep.y|fgrep.c|ncheck.c|ps.c|quot.c|restor.c|sa.c|sort.c) CFLAGS=-O ;;
                     45:        esac
                     46: 
                     47:        case $i in
                     48: 
                     49:        clean)  rm -f *.o core y.tab.c lex.yy.c  ;: Clean unwanted files.
                     50:                ;;
                     51: 
                     52:        *.y)    B=`basename $i .y`
                     53:                eval D=`grep " $B\$" Admin/destinations`
                     54:                   yacc $B.y  \
                     55:                && $CC $CFLAGS -o $B y.tab.c -lln \
                     56:                && install -s $B $DESTDIR$D/$B
                     57:                rm -f y.tab.[co] $B
                     58:                ;;
                     59: 
                     60:        *.l)    B=`basename $i .l`
                     61:                eval D=`grep " $B\$" Admin/destinations`
                     62:                   lex $B.l  \
                     63:                && $CC $CFLAGS -o $B lex.yy.c -lln \
                     64:                && install -s $B $DESTDIR$D/$B
                     65:                rm -f lex.yy.[co] $B
                     66:                ;;
                     67: 
                     68:        clear.c|more.c|ul.c)
                     69:                B=`basename $i .c`
                     70:                eval D=`grep " $B\$" Admin/destinations`
                     71:                   $CC $CFLAGS -o $B $B.c -ltermlib \
                     72:                && install -s $B $DESTDIR$D/$B
                     73:                rm -f $B.o $B
                     74:                ;;
                     75: 
                     76:        *.c)    B=`basename $i .c`
                     77:                eval D=`grep " $B\$" Admin/destinations`
                     78:                   $CC $CFLAGS -o $B $B.c \
                     79:                && install -s $B $DESTDIR$D/$B
                     80:                rm -f $B.o $B
                     81:                ;;
                     82: 
                     83:        *.s)    B=`basename $i .s`
                     84:                eval D=`grep " $B\$" Admin/destinations`
                     85:                   as -o $B.o $B.s \
                     86:                && $CC -o $B $B.o \
                     87:                && install -s $B $DESTDIR$D/$B
                     88:                rm -f $B.o $B
                     89:                ;;
                     90: 
                     91:        *.sh)   B=`basename $i .sh`
                     92:                eval D=`grep " $B\$" Admin/destinations`
                     93:                install -c $B.sh $DESTDIR$D/$B
                     94:                ;;
                     95: 
                     96:        Admin)  echo Do nothing.
                     97:                ;;
                     98: 
                     99: 
                    100:        MODES)
                    101:                BINF="  df login mail mkdir mv passwd rmdir su"
                    102:                UBINF=" at newgrp"
                    103:                UCBF="  chfn chsh netrm netq net renice"
                    104:                LIBF="  atrun ex3.2preserve ex3.2recover"
                    105:                UULIBF="uucp/uuxqt uucp/uucico"
                    106:                UUBINF="uucp uux uulog uuname"
                    107:                TMPF="  /tmp /usr/tmp /usr/lib/uucp/.XQTDIR /usr/msgs"
                    108:                TSPOOL="lpd mail secretmail uucp uucppublic"
                    109:                cd $DESTDIR/bin; chown root $BINF; chmod 4755 $BINF
                    110:                cd $DESTDIR/usr/bin; chown root $UBINF; chmod 4755 $UBINF
                    111:                cd $DESTDIR/usr/ucb; chown root $UCBF; chmod 4755 $UCBF
                    112:                cd $DESTDIR/usr/lib; chown root $LIBF; chmod 4755 $LIBF
                    113:                cd $DESTDIR/usr/lib; chown uucp $UULIBF; chmod 4755 $UULIBF
                    114:                cd $DESTDIR/usr/bin; chown uucp $UUBINF; chmod 4755 $UUBINF
                    115:                chmod 777 $DESTDIR/$TMPF 
                    116:                cd $DESTDIR/usr/spool; chmod 777 $TSPOOL ${DESTDIR}/usr/vpd
                    117: 
                    118:                ;;
                    119: 
                    120:        ALIASES) echo Establish alias names.
                    121:                rm -f $DESTDIR/usr/bin/[ $DESTDIR/bin/rmail
                    122:                ln $DESTDIR/usr/bin/test $DESTDIR/usr/bin/[
                    123:                ln $DESTDIR/bin/mail $DESTDIR/bin/rmail
                    124:                rm -f $DESTDIR/usr/ucb/l $DESTDIR/usr/ucb/f $DESTDIR/usr/ucb/u
                    125:                ln $DESTDIR/usr/ucb/ls $DESTDIR/usr/ucb/l
                    126:                ln $DESTDIR/usr/ucb/finger $DESTDIR/usr/ucb/f
                    127:                ln $DESTDIR/usr/ucb/users $DESTDIR/usr/ucb/u
                    128:                ;;
                    129: 
                    130:        *)      if [ ! -d $i ]
                    131:                then    echo "Don't know what to do with $i."
                    132:                else
                    133:                        date
                    134:                        cd $i
                    135:                           make CC=$CC DESTDIR=$DESTDIR \
                    136:                        && make install DESTDIR=$DESTDIR \
                    137:                        && make clean
                    138:                        date
                    139:                        cd ..
                    140:                fi
                    141: 
                    142:        esac
                    143: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.