home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / conf / makefile < prev    next >
Makefile  |  1995-04-27  |  2KB  |  79 lines

  1. # =()<@<INCLUDE>@>()=
  2. .include "../include/config.make"
  3.  
  4.  
  5.  
  6. A=$(NEWSARTS)
  7. C=$(NEWSCTL)
  8. NDIRS=$(A) $(A)/in.coming $(A)/in.coming/bad $(A)/out.master $(C) $(C)/bin
  9.  
  10. EGS=active.eg active.times mailname.eg mailpaths.eg organization\
  11.     sys.eg whoami.eg
  12. ALL=$(EGS) report.ctl crontab $(SERVER)
  13.  
  14. all:    $(ALL)
  15.     $(MX) report.ctl config histsetup
  16.  
  17. install:    $(ALL)
  18.  
  19. LASTGROUP=`egrep -v '=|x$$' $(NEWSCTL)/active | tr . / | sed -n '$$s/ .*//p'`
  20.  
  21. setup:    $(ALL)
  22.     $(MKDIR) $(NEWSCTL)/bin
  23.     $(TO) -n $(NEWSCTL) report.ctl $(SERVER)
  24.     $(TO) `echo $(NEWSCONFIG) | sed 's;/[^/]*$$;;'` config
  25.     $(TO) -e -n $(NEWSCTL) $(EGS)
  26.     ./histsetup
  27.     if test -d $(NEWSARTS)/$(LASTGROUP) -a -d $(NEWSOV)/$(LASTGROUP) ;\
  28.     then \
  29.         : no adddirs needed ;\
  30.     else \
  31.         $(NEWSBIN)/maint/adddirs ;\
  32.     fi
  33.  
  34. versetup:
  35.     $(TO) $(NEWSCTL) versionname
  36.  
  37. cmp:    $(ALL)
  38.     : make sure major directories have right ownership
  39.     @$(CF) $(UID) $(GID) '^drwx' $(NDIRS)
  40.     : compare some files
  41.     @$(IN) -i $(NEWSCTL) report.ctl
  42.     @$(IN) `echo $(NEWSCONFIG) | sed 's;/[^/]*$$;;'` config
  43.     @$(IN) $(NEWSCTL) versionname
  44.     : make sure the whoami and mailname files have been configured
  45.     test " `cat $(NEWSCTL)/whoami`" != " nosuchsite" ;
  46.     test " `cat $(NEWSCTL)/mailname`" != " no.such.domain" ;
  47.     : check that crucial files exist
  48.     test -r $(NEWSCTL)/history ;
  49.     test -s $(NEWSCTL)/history.dir ;
  50.     test -r $(NEWSCTL)/history.pag ;
  51.     : check that the last newsgroup in active has directories -- too
  52.     : expensive to check all of them
  53.     test -d $(NEWSARTS)/$(LASTGROUP) -a -d $(NEWSOV)/$(LASTGROUP) ;
  54.  
  55. mx:
  56.     $(MX) checkfile cmpto cpto inall libcmp maker
  57.     $(MX) mkdirs rconfig rsetup subst update.*
  58.  
  59. active.times:    active.eg
  60.     sed 's/ .*/ 0 unknown/' active.eg >$@
  61.  
  62. crontab:    cron.proto
  63.     egrep -v '^#' cron.proto >$@
  64.  
  65. server:    ../include/config.make
  66.     echo "$(SERVERNAME)" >$@
  67.  
  68. report.ctl:    ../include/config.make
  69.     echo "urgentto=$(URGENTTO)" >$@
  70.     echo "nonurgentto=$(REPORTTO)" >>$@
  71.  
  72. liblist:
  73.     cd .. ; $(MAKE) $(SIZE) DBZ=$(DBZ) $(STDIO)
  74.  
  75. r rclean:    $(ALL)
  76.  
  77. clean:
  78.     rm -f active.times crontab server report.ctl
  79.