home *** CD-ROM | disk | FTP | other *** search
-
- # (Large) prefix inserted above by Make
-
- # BSD systems keep chown in /etc
- PATH="$PATH:/etc"
-
- case "$1" in
- mkdir)
- if [ -n "$2" -a ! -d "$2"/. ]
- then
- mkdir $2
- if [ ! -d "$2" ] ; then
- echo "Cannot create directory $2"
- exit 1
- fi
- chmod $3 $2
- chgrp $GROUP $2
- chown $OWNER $2
- echo Created directory $2
- fi
- exit 0
- ;;
- copy)
- cp $4 $3
- chmod $2 $3/$4
- chgrp $GROUP $3/$4
- chown $OWNER $3/$4
- echo "$4 -> $3/$4"
- exit 0
- ;;
- chmod)
- chmod $2 $3
- chgrp $GROUP $3
- chown $OWNER $3
- exit 0
- ;;
-
- inews)
- if [ ! -d "${INEWS_DIR}"/. ]
- then
- ../inst mkdir ${INEWS_DIR} 755 || exit 1
- fi
- echo Installing $2 in $INEWS
- cp $2 $INEWS && ../inst chmod 755 $INEWS
- exit 0
- ;;
- esac
-
- set -u
-
- (
- if $NNTP
- then
- :
- else
- if [ ! -d "$SPOOL"/. ]
- then
- echo Error: News spool directory $SPOOL not found.
- fi
-
- if [ ! -d "$NLIB"/. ]
- then
- echo Error: News lib directory $NLIB not found.
- fi
- fi
-
- set $INEWS
- if [ ! -f "$1" ]
- then
- echo ERROR: Inews program $INEWS not found.
- fi
-
- set $RECMAIL
- if [ ! -f "$1" ]
- then
- echo ERROR: Mailer program $RECMAIL not found.
- fi
- ) > ErrorCheck
-
- if [ -s ErrorCheck ]
- then
- cat ErrorCheck
- echo "Hit return to continue"
- read X
- fi
- rm -f ErrorCheck
-
- LOOP=true
- while $LOOP
- do
-
- if [ $# -ge 1 ]
- then
- OPT="$1"
- shift
- if [ $# -eq 0 ]
- then
- LOOP=false
- fi
- PAUSE=false
- else
- PAUSE=true
-
- echo
- echo
- echo "INSTALLATION"
- echo ""
- echo "1) Master programs (machine dependent)"
- echo "2) User programs (machince dependent, shareable)"
- echo "3) Help files and auxiliary programs (shareable)"
- echo "4) Documentation (shareable)"
- echo "5) Online manual (shareable with 3)"
- echo ""
- echo "INIT) Initialize database"
- echo ""
- echo "s) Server installation: 1 + 2 + 3 + 4 + 5"
- echo "n) Network installation: 2 + 3 + 4 + 5"
- echo "m) Master installation: 1"
- echo "c) Client installation: 2"
- echo "u) Update after patch"
- echo "q) Quit"
- echo ""
- if ./usercheck 0 ; then
- :
- else
- echo "Warning: not running as super user"
- echo ""
- fi
- ${AWK} 'BEGIN{printf "Select option: "}' < /dev/null
- read OPT
- echo
-
- fi
-
- case $OPT in
-
- s*|a*)
- OPT="master bin aux help online man"
- ;;
- u*)
- OPT=""
- if [ -f "$MASTER/nnmaster" ]
- then
- OPT="$OPT master"
- fi
- if [ -f "$BIN/nn" ]
- then
- OPT="$OPT bin"
- fi
- if [ -f "$LIB/aux" ]
- then
- OPT="$OPT aux help"
- fi
- if [ -f "$DMAN_DIR/nnmaster.$DMAN_SECT" ]
- then
- OPT="$OPT man"
- fi
- if [ -f "$HELP/Manual" ]
- then
- OPT="$OPT online"
- fi
- ;;
- 1|m)
- OPT=master
- ;;
- n)
- OPT="bin aux help online man"
- ;;
- 2|c)
- OPT=bin
- ;;
- 3)
- OPT="aux help"
- ;;
- x)
- OPT=aux
- ;;
- h)
- OPT=help
- ;;
- 4)
- OPT="man"
- ;;
- 5)
- OPT="online"
- ;;
- INIT)
- OPT=init
- ;;
- q*|"")
- if [ -f $MASTER/nnmaster -a ! -f $MASTER/MPID ]
- then
- echo "Remember to restart $MASTER/nnmaster"
- fi
- exit 0
- ;;
- *)
- echo "Unrecognized option: $OPT"
- exit 1
- ;;
- esac
-
- for OP in $OPT
- do
- case "$OP" in
-
- master)
- ./inst mkdir $MASTER 755 || exit 1
-
- if [ -f $MASTER/nnmaster ]
- then
- (
- cd $MASTER
- if [ -f MPID ]
- then
- echo "Stopping running master..."
- kill -1 `cat MPID`
- sleep 5
- rm -f MPID
- fi
- mv nnmaster nnmaster.old
- )
- fi
-
- echo Installing master in $MASTER
-
- for prog in $MASTER_PROG
- do
- ./inst copy 755 $MASTER $prog
- done
-
- chmod 4750 $MASTER/nnmaster
- ;;
-
- bin)
- echo
- if [ ! -d "$BIN"/. ]
- then
- echo Directory $BIN does not found!
- exit 1
- fi
-
- echo Installing user programs in $BIN
-
- if [ -f $BIN/nn ]
- then
- (
- cd $BIN
- mv nn nn.old
- rm -f $BIN_PROG $BIN_LINK
- )
- fi
-
- for prog in $BIN_PROG
- do
- ./inst copy 755 $BIN $prog
- done
-
- for link in $BIN_LINK
- do
- ln $BIN/nn $BIN/$link
- echo $link linked to nn
- done
-
- if [ -f $BIN/nnacct ] ; then
- chmod 4755 $BIN/nnacct
- echo nnacct is setuid ${OWNER}.
- fi
- ;;
-
- aux)
- echo
- ./inst mkdir $LIB 755 || exit 1
-
- echo Installing auxiliary programs in $LIB
-
- for prog in $LIB_PROG
- do
- ./inst copy 755 $LIB $prog
- done
-
- ./mkprefix conf > ${LIB}/conf
- grep "^#" config.h |
- sed -e '/_MAN_/d' -e 's/[ ]*\/\*.*$//' >> ${LIB}/conf
- ./inst chmod 644 ${LIB}/conf
- ;;
-
- help)
- ./inst mkdir $HELP 755 || exit 1
-
- echo
- echo Installing help files in $HELP
-
- for h in `grep '^help/' MANIFEST | sed 's/^help\/\([a-z0-9.]*\).*$/\1/'`
- do
- ./cvt-help < help/$h > $HELP/$h
- ./inst chmod 644 $HELP/$h
- echo $h
- done
- ;;
-
- man)
- echo
- echo Installing manuals
-
- {
- echo $UMAN_DIR $UMAN_SECT .1
- echo $SMAN_DIR $SMAN_SECT .1m
- echo $DMAN_DIR $DMAN_SECT .8
- } |
- while read DIR SECT SRC
- do
-
- if [ -d "$DIR"/. -a -w "$DIR"/. ]
- then
- for i in man/*$SRC
- do
- MAN=`basename ${i} $SRC`
- NEW=$DIR/${MAN}.$SECT
- cp $i $NEW
- ./inst chmod 644 $NEW
- echo $MAN in $NEW
- done
- else
- echo $DIR not found or not writeable
- fi
- done
- ;;
-
- online)
- ./inst mkdir $HELP 755 || exit 1
-
- MAN=$HELP/Manual
-
- echo
- echo "Formatting online manual $MAN"
- echo ".... (continues in background) ...."
-
- rm -f $MAN
-
- (
- sed -e 's/\\f[BPI]//g' \
- -e 's/\\-/-/g' -e 's/\\&//g' -e 's/\\e/\\/g' \
- -e '/^\.\\"ta/p' -e '/^\.\\"/d' \
- -e '/^\.nf/d' -e '/^\.fi/d' \
- -e '/^\.if/d' -e '/^\.ta/d' -e '/^\.nr/d' \
- -e '/^\.in/d' -e 's/^\.[BI] //' \
- `grep '^man/' MANIFEST | ${AWK} '{print $1}'` |
- ${AWK} -f format.awk - > $MAN
-
- ./inst chmod 644 $MAN
- ) &
- ;;
-
- init)
- echo
- ./inst mkdir "$DB" 755 || exit 1
- ./inst mkdir "$DBDATA" 755 || exit 1
-
- if $NNTP ; then
- if [ x"$NNTPCACHE" != "x" ] ; then
- ./inst mkdir "$NNTPCACHE" 777 || exit 1
- fi
- ILIMIT=50
- DFLT=50
-
- cat <<'EOF'
-
- When nnmaster is started the first time after initializing nn's
- database, it will attempt to fetch all the articles from the nntp
- server. It does this by successively requesting each article in the
- range min..last obtained from the NNTP server. Often the 'min' number
- is unreliable or even zero (Cnews doesn't maintain it). This means
- that the nnmaster will request a lot of non-existing articles from the
- server, causing a lot of network traffic.
-
- To limit this activity, nn will normally only attempt to fetch the
- fifty newest articles in each group. This shouldn't really be a
- problem since that will give you enough news to start with, and the
- older articles will probably be expired in a few days anyway.
-
- You can change this limit if you like. Or you can disable this
- limitation completely if you trust the min field by giving a 0 limit.
-
- EOF
- else
- ILIMIT=""
- DFLT="none"
-
- cat <<'EOF'
-
- If the 'min' field in your active file is not reliable, nnmaster can
- waste a lot of time trying to locate non-existing articles in the news
- groups when it is collecting the available articles the first time it
- is started after the database is initialized. This is especially true
- with Cnews where the min field is not normally maintained.
-
- To limit the efforts during the initial collection, you can set a
- limit on the number of articles in each group which nnmaster should
- try to locate in each group. This may get you running faster, and it
- shouldn't matter much anyway since the articles that may be ignored
- will be the oldest articles in the group, and they will probably be
- expired soon anyway. A value in the range 100-500 should be more than
- enough. If you don't specify a limit, all articles will be collected,
- but it may take quite some time if the min fields are unreliable.
- EOF
- fi
-
- ${AWK} 'END{printf "Initial article limit ('"$DFLT"') "}' < /dev/null
- read L
- if [ -n "$L" ] ; then
- ILIMIT="$L"
- fi
-
- echo Running nnmaster -I $ILIMIT to initialize database....
- echo
- $MASTER/nnmaster -I $ILIMIT
- echo
- echo "Now start $MASTER/nnmaster [ -D ] [ -r ]"
- ;;
- esac
-
- done
-
- if [ -f $LOG ]
- then
- chmod 666 $LOG
- fi
-
- if $PAUSE
- then
- ${AWK} 'BEGIN{printf("\nHit return to continue....")}' < /dev/null
- read X
- fi
- done
-