File:  [Local Repository] / db / prgsrc / Makefile
Revision 1.39: download - view: text, annotated - select for diffs - revision graph
Fri Jan 10 18:55:38 2003 UTC (21 years, 4 months ago) by boris
Branches: MAIN
CVS tags: HEAD
Added timestamp

    1: ifndef ROOT
    2: ROOT = /home/znatoki
    3: endif
    4: PERL = perl
    5: TMPSAV = /tmp
    6: PMODE = 775
    7: LMODE = 664
    8: KULICHKI=znatoki.kulichki.net
    9: RSYNC = rsync -ruvpte ssh --delete --progress --rsync-path='~/bin/rsync'
   10: SCP=scp
   11: DESTSRCDIR=~piataev/public_html/dimrub/src/
   12: SRCDIR=../baza
   13: DESTPRGSRC=~piataev/db/prgsrc
   14: DUMPDIR=../dump
   15: DESTDUMPDIR=/var/tmp/
   16: TABLES= Questions Tournaments word2question nf nests Authors A2Q
   17: INDEXWRITER= rubash@yandex.ru, roma7@zaba.ru
   18: #INDEXWRITER= boris
   19: AUTHORCHECKER = roma7@zaba.ru
   20: #AUTHORCHECKER = boris
   21: DELIVERER = roma7@zaba.ru, boris
   22: #DELIVERER = boris
   23: UPDATELOG = $(DUMPDIR)/update.log
   24: UAUTHORS=$(DUMPDIR)/uauthors
   25: UNSORTED=$(DUMPDIR)/unsorted
   26: RSPARAMS= 2000 50
   27: TIMESTAMP= $(DUMPDIR)/timestamp
   28: 
   29: DBSCRIPTS = mkdb.pl \
   30: 	    updatem.pl \
   31: 	    updatedb.pl \
   32: 	    changecities.pl\
   33: 	    createindex.pl\
   34: 	    updateindex.pl \
   35: 	    addlinks.pl \
   36: 	    deletefiles.pl\
   37: 	    renamefile.pl \
   38: 	    makecheck.pl\
   39: 	    mkRS.pl\
   40: 	    delRS.pl\
   41: 	    updateRS.pl\
   42: 	    updateRS1.pl\
   43: 	    updateRS2.pl\
   44: 	    updateRS3.pl\
   45: 	    dumpRS.pl\
   46: 	    dumpin2out.pl\
   47: 	    dump2dump.pl\
   48: 	    checkPBS.pl\
   49: 	    loaddump.pl \
   50: 	    makeauthors.pl
   51: 
   52: LIBS = chgkfiles.pm \
   53: 	    common.pl\
   54: 	    chgk.cnf\
   55: 	    dbchgk.pm\
   56:             check.pl
   57: 
   58: 
   59: CGISCRIPTS = db.cgi
   60: 
   61: 
   62: HTMLS = contribute.html \
   63: 	copyright.html \
   64: 	copyright_mozg.html \
   65: 	credits.html \
   66: 	dbmain.html \
   67: 	footer.html \
   68: 	guestbook.html \
   69: 	index.html \
   70: 	random.html \
   71: 	reklama.html \
   72: 	search.html  
   73: 
   74: 
   75: TEXTS = $(wildcard $(SRCDIR)/*.txt) $(SRCDIR)/index
   76: 
   77: 
   78: DBBIN = ../bin
   79: MANDIR = ../man
   80: LIBDIR = ../lib
   81: CGIBIN = $(ROOT)/public_html/cgi-bin
   82: HTMLDIR = $(ROOT)/public_html/dimrub/db
   83: 
   84: BININSTALL =    ${DBSCRIPTS:%=$(DBBIN)/%}
   85: CGIINSTALL =    ${CGISCRIPTS:%.cgi=$(CGIBIN)/%.cgi}
   86: LIBINSTALL =    ${LIBS:%=$(LIBDIR)/%}
   87: HTMLINSTALL =   ${HTMLS:%.html=$(HTMLDIR)/%.html}
   88: 
   89: all: $(LIBINSTALL) $(BININSTALL) $(CGIINSTALL) $(HTMLINSTALL)
   90: 
   91: install: all
   92: 
   93: test:
   94: 	echo $(TEXTS)
   95: 
   96: $(DBBIN)/%.pl:       %.pl
   97: 	${PERL} -c $<
   98: 	- pod2man --center "Internet Club DB" $< > $*.1
   99: 	- install -m $(LMODE) $*.1 $(MANDIR)/man1
  100: 	- rm $*.1
  101: 	if [ -f $@ ]; then mv $@ $(TMPSAV); fi
  102: 	cp $< $@
  103: 	chmod $(PMODE) $@
  104: 	if [ -f $(TMPSAV)/$(@F) ]; then rm -f $(TMPSAV)/$(@F); fi
  105: 
  106: $(CGIBIN)/%.cgi:       %.cgi
  107: 	${PERL} -c $<
  108: 	- pod2man --center "Internet Club DB" $< > $*.1
  109: 	- install -m $(LMODE) $*.1 $(MANDIR)/man1
  110: 	- rm $*.1	
  111: 	if [ -f $@ ]; then mv $@ $(TMPSAV); fi
  112: 	cp $< $@
  113: 	chmod $(PMODE) $@
  114: 	if [ -f $(TMPSAV)/$(@F) ]; then rm -f $(TMPSAV)/$(@F); fi
  115: 
  116: 
  117: 
  118: $(LIBDIR)/%.pm:       %.pm
  119: 	${PERL} -c $<
  120: 	- pod2man --center "Internet Club DB" $< > $*.3
  121: 	- install -m $(LMODE) $*.3 $(MANDIR)/man3
  122: 	- rm $*.3
  123: 	if [ -f $@ ]; then mv $@ $(TMPSAV); fi
  124: 	cp $< $@
  125: 	chmod $(LMODE) $@
  126: 	if [ -f $(TMPSAV)/$(@F) ]; then rm -f $(TMPSAV)/$(@F); fi
  127: 
  128: 
  129: $(LIBDIR)/%.pl:       %.pl
  130: 	${PERL} -c $<
  131: 	- pod2man --center "Internet Club DB" $< > $*.3
  132: 	- install -m $(LMODE) $*.3 $(MANDIR)/man3
  133: 	- rm $*.3
  134: 	if [ -f $@ ]; then mv $@ $(TMPSAV); fi
  135: 	cp $< $@
  136: 	chmod $(LMODE) $@
  137: 	if [ -f $(TMPSAV)/$(@F) ]; then rm -f $(TMPSAV)/$(@F); fi
  138: 
  139: 
  140: $(LIBDIR)/%.cnf:       %.cnf
  141: 	${PERL} -c $<
  142: 	- pod2man --center "Internet Club DB" $< > $*.5
  143: 	- install -m $(LMODE) $*.5 $(MANDIR)/man5
  144: 	- rm $*.5
  145: 	if [ -f $@ ]; then mv $@ $(TMPSAV); fi
  146: 	cp $< $@
  147: 	chmod $(LMODE) $@
  148: 	if [ -f $(TMPSAV)/$(@F) ]; then rm -f $(TMPSAV)/$(@F); fi
  149: 
  150: 
  151: $(HTMLDIR)/%.html:       %.html
  152: 	cp $< $@
  153: 
  154: 
  155: 
  156: srcdeliver:
  157: 	$(RSYNC) $(SRCDIR) $(KULICHKI):$(DESTSRCDIR)
  158: 
  159: 
  160: prgdeliver:
  161: 	$(RSYNC) ./ $(KULICHKI):$(DESTPRGSRC)
  162: 
  163: dbdeliver:
  164: 	mysqldump --add-drop-table -u piataev chgk $(TABLES)  > $(DUMPDIR)/chgkdump.0
  165: 	sed 's/TYPE=ISAM PACK_KEYS=1//g' $(DUMPDIR)/chgkdump.0 > $(DUMPDIR)/chgkdump
  166: 	gzip $(DUMPDIR)/chgkdump
  167: 	rm $(DUMPDIR)/chgkdump.0
  168: 	$(SCP) $(DUMPDIR)/chgkdump.gz  $(KULICHKI):$(DESTDUMPDIR)
  169: 	mail -s"Database delivered" $(DELIVERER)
  170: 
  171: update: 
  172: 	cvs update $(SRCDIR)
  173: 	$(MAKE) $(TIMESTAMP)
  174: 
  175: $(TIMESTAMP): $(TEXTS)
  176: 	mysql -upiataev chgk <delq.sql
  177: 	$(DBBIN)/mkdb.pl
  178: 	$(DBBIN)/updateindex.pl -i$(SRCDIR)/index
  179: 	$(DBBIN)/updatedb.pl $(SRCDIR)/*.txt 2>&1 | tee $(UPDATELOG)
  180: 	$(DBBIN)/makeauthors.pl
  181: 	if [ -s $(UAUTHORS) ]; then  \
  182: 		mail -sUauthors $(AUTHORCHECKER) < $(UAUTHORS); \
  183: 	fi
  184: 	if [ -s $(UNSORTED) ]; then \
  185: 		mail -sUnsorted $(INDEXWRITER) <$(UNSORTED);\
  186: 	 else \
  187: 		$(DBBIN)/mkRS.pl; \
  188: 		$(DBBIN)/updateRS2.pl $(RSPARAMS);\
  189: 		mail -s"Ready to deliver" $(DELIVERER);\
  190: 	 fi
  191: 	touch $(TIMESTAMP)
  192: 
  193: 
  194: authorsdeliver:
  195: 	mysqldump --add-drop-table -u piataev chgk Authors A2Q  > $(DUMPDIR)/chgkdump.0
  196: 	sed 's/TYPE=ISAM PACK_KEYS=1//g' $(DUMPDIR)/chgkdump.0 > $(DUMPDIR)/chgkdump
  197: 	gzip $(DUMPDIR)/chgkdump
  198: 	rm $(DUMPDIR)/chgkdump.0
  199: 	$(SCP) $(DUMPDIR)/chgkdump.gz  $(KULICHKI):$(DESTDUMPDIR)
  200: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>