Annotation of db/prgsrc/Makefile, revision 1.39
1.6 boris 1: ifndef ROOT
2: ROOT = /home/znatoki
3: endif
1.1 boris 4: PERL = perl
5: TMPSAV = /tmp
6: PMODE = 775
7: LMODE = 664
1.7 boris 8: KULICHKI=znatoki.kulichki.net
1.4 boris 9: RSYNC = rsync -ruvpte ssh --delete --progress --rsync-path='~/bin/rsync'
1.16 boris 10: SCP=scp
1.5 boris 11: DESTSRCDIR=~piataev/public_html/dimrub/src/
1.23 roma7 12: SRCDIR=../baza
1.5 boris 13: DESTPRGSRC=~piataev/db/prgsrc
1.1 boris 14: DUMPDIR=../dump
1.17 boris 15: DESTDUMPDIR=/var/tmp/
1.33 boris 16: TABLES= Questions Tournaments word2question nf nests Authors A2Q
1.38 roma7 17: INDEXWRITER= rubash@yandex.ru, roma7@zaba.ru
1.34 boris 18: #INDEXWRITER= boris
19: AUTHORCHECKER = roma7@zaba.ru
20: #AUTHORCHECKER = boris
21: DELIVERER = roma7@zaba.ru, boris
1.35 boris 22: #DELIVERER = boris
1.34 boris 23: UPDATELOG = $(DUMPDIR)/update.log
24: UAUTHORS=$(DUMPDIR)/uauthors
25: UNSORTED=$(DUMPDIR)/unsorted
1.36 boris 26: RSPARAMS= 2000 50
1.39 ! boris 27: TIMESTAMP= $(DUMPDIR)/timestamp
1.1 boris 28:
29: DBSCRIPTS = mkdb.pl \
30: updatem.pl \
31: updatedb.pl \
32: changecities.pl\
33: createindex.pl\
34: updateindex.pl \
1.8 boris 35: addlinks.pl \
1.9 boris 36: deletefiles.pl\
1.10 boris 37: renamefile.pl \
1.11 boris 38: makecheck.pl\
39: mkRS.pl\
1.14 boris 40: delRS.pl\
1.11 boris 41: updateRS.pl\
42: updateRS1.pl\
1.15 boris 43: updateRS2.pl\
44: updateRS3.pl\
1.11 boris 45: dumpRS.pl\
46: dumpin2out.pl\
47: dump2dump.pl\
48: checkPBS.pl\
1.34 boris 49: loaddump.pl \
50: makeauthors.pl
1.11 boris 51:
52: LIBS = chgkfiles.pm \
1.10 boris 53: common.pl\
54: chgk.cnf\
1.11 boris 55: dbchgk.pm\
56: check.pl
1.10 boris 57:
1.1 boris 58:
59: CGISCRIPTS = db.cgi
60:
1.12 boris 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:
1.39 ! boris 75: TEXTS = $(wildcard $(SRCDIR)/*.txt) $(SRCDIR)/index
1.12 boris 76:
1.13 boris 77:
1.1 boris 78: DBBIN = ../bin
79: MANDIR = ../man
1.10 boris 80: LIBDIR = ../lib
1.6 boris 81: CGIBIN = $(ROOT)/public_html/cgi-bin
1.13 boris 82: HTMLDIR = $(ROOT)/public_html/dimrub/db
1.1 boris 83:
1.10 boris 84: BININSTALL = ${DBSCRIPTS:%=$(DBBIN)/%}
1.1 boris 85: CGIINSTALL = ${CGISCRIPTS:%.cgi=$(CGIBIN)/%.cgi}
1.10 boris 86: LIBINSTALL = ${LIBS:%=$(LIBDIR)/%}
1.13 boris 87: HTMLINSTALL = ${HTMLS:%.html=$(HTMLDIR)/%.html}
1.10 boris 88:
1.13 boris 89: all: $(LIBINSTALL) $(BININSTALL) $(CGIINSTALL) $(HTMLINSTALL)
1.1 boris 90:
1.39 ! boris 91: install: all
! 92:
! 93: test:
! 94: echo $(TEXTS)
1.1 boris 95:
1.11 boris 96: $(DBBIN)/%.pl: %.pl
1.1 boris 97: ${PERL} -c $<
98: - pod2man --center "Internet Club DB" $< > $*.1
99: - install -m $(LMODE) $*.1 $(MANDIR)/man1
1.10 boris 100: - rm $*.1
1.1 boris 101: if [ -f $@ ]; then mv $@ $(TMPSAV); fi
102: cp $< $@
103: chmod $(PMODE) $@
104: if [ -f $(TMPSAV)/$(@F) ]; then rm -f $(TMPSAV)/$(@F); fi
1.33 boris 105:
1.1 boris 106: $(CGIBIN)/%.cgi: %.cgi
107: ${PERL} -c $<
108: - pod2man --center "Internet Club DB" $< > $*.1
109: - install -m $(LMODE) $*.1 $(MANDIR)/man1
1.10 boris 110: - rm $*.1
1.1 boris 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:
1.10 boris 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
1.11 boris 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
1.10 boris 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:
1.12 boris 151: $(HTMLDIR)/%.html: %.html
152: cp $< $@
153:
1.10 boris 154:
1.1 boris 155:
156: srcdeliver:
157: $(RSYNC) $(SRCDIR) $(KULICHKI):$(DESTSRCDIR)
158:
159:
160: prgdeliver:
161: $(RSYNC) ./ $(KULICHKI):$(DESTPRGSRC)
162:
163: dbdeliver:
1.16 boris 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
1.18 boris 167: rm $(DUMPDIR)/chgkdump.0
1.16 boris 168: $(SCP) $(DUMPDIR)/chgkdump.gz $(KULICHKI):$(DESTDUMPDIR)
1.37 boris 169: mail -s"Database delivered" $(DELIVERER)
1.12 boris 170:
1.24 roma7 171: update:
1.21 roma7 172: cvs update $(SRCDIR)
1.39 ! boris 173: $(MAKE) $(TIMESTAMP)
! 174:
! 175: $(TIMESTAMP): $(TEXTS)
1.27 roma7 176: mysql -upiataev chgk <delq.sql
1.36 boris 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
1.34 boris 181: if [ -s $(UAUTHORS) ]; then \
182: mail -sUauthors $(AUTHORCHECKER) < $(UAUTHORS); \
183: fi
184: if [ -s $(UNSORTED) ]; then \
185: mail -sUnsorted $(INDEXWRITER) <$(UNSORTED);\
186: else \
1.36 boris 187: $(DBBIN)/mkRS.pl; \
188: $(DBBIN)/updateRS2.pl $(RSPARAMS);\
1.34 boris 189: mail -s"Ready to deliver" $(DELIVERER);\
190: fi
1.39 ! boris 191: touch $(TIMESTAMP)
! 192:
1.33 boris 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>