home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / ctl / makefile < prev    next >
Makefile  |  1994-11-27  |  4KB  |  117 lines

  1. # =()<@<INCLUDE>@>()=
  2. .include "../include/config.make"
  3.  
  4. BINS=
  5. CTL=checkgroups newgroup rmgroup sendsys version
  6. AUX=delsendsys delversion dodelayed newsreply
  7. PROGS=$(BINS) $(CTL) $(AUX)
  8. CDEST=$(NEWSBIN)/ctl
  9. ADEST=$(NEWSBIN)/relay
  10. ALL=$(PROGS) controlperm.eg
  11.  
  12. all:    $(ALL)
  13.     $(MX) $(PROGS)
  14.  
  15. setup:
  16.     $(TO) -n -e $(NEWSCTL) controlperm.eg
  17.  
  18. install:    $(PROGS)
  19.     $(MKDIR) $(CDEST) $(ADEST)
  20.     $(TO) $(CDEST) $(CTL)
  21.     $(TO) $(ADEST) $(AUX)
  22.  
  23. cmp:    $(ALL)
  24.     @$(IN) $(CDEST) $(CTL)
  25.     @$(IN) $(ADEST) $(AUX)
  26.     @$(IN) -i -e $(NEWSCTL) controlperm.eg
  27.  
  28. # stuff for regression test
  29. UTIL=../util/gngp ../util/canonhdr ../util/newshostname ../util/now \
  30.     ../util/mkpdir
  31. AWK=../util/namecheck.awk ../util/canonsys.awk
  32.  
  33. ../util/gngp:
  34.     cd ../util ; $(MAKE) gngp
  35.  
  36. ../util/canonhdr:
  37.     cd ../util ; $(MAKE) canonhdr
  38.  
  39. ../util/newshostname:
  40.     cd ../util ; $(MAKE) newshostname
  41.  
  42. ../util/now:
  43.     cd ../util ; $(MAKE) now
  44.  
  45. ../util/mkpdir:
  46.     cd ../util ; $(MAKE) mkpdir
  47.  
  48. r:    rclean $(PROGS) $(UTIL)
  49.     touch controlperm active active.times newsgroups
  50.     echo "alt any nr nv" >>controlperm
  51.     echo "comp tale@uunet.uu.net nr yv" >>controlperm
  52.     echo "comp.sys.ibm.pc.soundcard 000 001 y" >>active
  53.     echo "comp.sys.ibm.pc.soundcard 0 nobody" >>active.times
  54.     echo "comp.sys.ibm.pc.soundcard something or other" >>newsgroups
  55.     echo "sci.space 000 001 y" >>active
  56.     echo "sci.space 0 somebody" >>active.times
  57.     echo "sci.space spacey stuff" >>newsgroups
  58.     mkdir bin
  59.     cp $(UTIL) bin
  60.     echo '( echo $$* ; echo ::: ; cat ) >>'`pwd`/reports >bin/report
  61.     $(MX) bin/*
  62.     cp $(AWK) .
  63.     echo "site" >whoami
  64.     echo "ME:comp" >sys
  65.     : newgroup
  66.     cp active active.good
  67.     echo "comp.lang.beta 0000000000 00001 y" >>active.good
  68.     cp active.times at.good
  69.     echo "comp.lang.beta 0 tale@uunet.uu.net (David C Lawrence)" >>at.good
  70.     cp newsgroups newsgroups.ok
  71.     egrep '^comp.lang.beta    ' reg/n.1 >>newsgroups.ok
  72.     $(HERE) ./newgroup comp.lang.beta <reg/n.1 >out.tmp 2>err.tmp
  73.     test ! -s out.tmp ;
  74.     test ! -s err.tmp ;
  75.     cmp active.good active || diff active.good active
  76.     sed 's/ [0-9][0-9]* / 0 /' active.times >at.tmp
  77.     cmp at.good at.tmp || diff at.good at.tmp
  78.     cmp newsgroups.ok newsgroups || diff newsgroups.ok newsgroups
  79.     cmp reg/n.1r reports || diff reg/n.1r reports
  80.     test -d arts/comp/lang/beta ;
  81.     test -r arts/comp/lang/beta/.overview ;
  82.     rm -f reports
  83.     : newgroup for status change
  84.     sed '/^comp.lang.beta/s/y$$/m/' active >active.good
  85.     sed 's/ [0-9][0-9]* / 0 /' active.times >at.good
  86.     cp newsgroups newsgroups.ok
  87.     $(HERE) ./newgroup comp.lang.beta moderated <reg/n.2 >out.tmp 2>err.tmp
  88.     test ! -s out.tmp ;
  89.     test ! -s err.tmp ;
  90.     cmp active.good active || diff active.good active
  91.     sed 's/ [0-9][0-9]* / 0 /' active.times >at.tmp
  92.     cmp at.good at.tmp || diff at.good at.tmp
  93.     cmp newsgroups.ok newsgroups || diff newsgroups.ok newsgroups
  94.     cmp reg/n.2r reports || diff reg/n.2r reports
  95.     rm -f reports
  96.     : rmgroup
  97.     egrep -v soundcard active >active.good
  98.     egrep -v soundcard active.times >at.good
  99.     egrep -v soundcard newsgroups >newsgroups.ok
  100.     $(HERE) ./rmgroup comp.sys.ibm.pc.soundcard <reg/r.1 >out.tmp 2>err.tmp
  101.     test ! -s out.tmp ;
  102.     test ! -s err.tmp ;
  103.     cmp active.good active || diff active.good active
  104.     cmp at.good active.times || diff at.good active.times
  105.     cmp newsgroups.ok newsgroups || diff newsgroups.ok newsgroups
  106.     cmp reg/r.1r reports || diff reg/r.1r reports
  107.     test " `cat dirs.tbd`" = " comp/sys/ibm/pc/soundcard" ;
  108.     : success
  109.  
  110. rclean:
  111.     rm -f controlperm active active.times newsgroups dirs.tbd reports
  112.     rm -f *.good *.tmp namecheck.awk canonsys.awk whoami sys newsgroups.ok
  113.     rm -rf bin arts
  114.  
  115. clean:    rclean
  116.     rm -f core a.out *.o $(BINS)
  117.