# # Makefile for FreeBSD Japanese Documentation Project # # Copyright(c)1999-2000 Hiroki Sato/HRS # $hrs: www/sut/diary/data/20000709/Makefile,v 1.1 2002/02/03 07:36:13 hrs Exp $ # SHELL=/bin/sh LCVSROOT= /home/ncvs FCVSROOT= freefall.FreeBSD.org:/home/ncvs ### .diff and .cvslog directory (do not use ~) BASE= ${HOME}/work.freefall/commit ### top of checkout directory WORK= ~/work.freefall ### VIAHOST!= echo castle.jp.FreeBSD.org | tr A-Z a-z HOSTNAME!= hostname | tr A-Z a-z ORGDIFF= ${WORK}/commit/orgdiff.pl DOCLANG?= ja_JP.eucJP WWWLANG?= ja DOCPREFIX= doc/${DOCLANG} WWWPREFIX= www/${WWWLANG} default: all: handbook faq www _putpwd: @echo "===> ${PWD}:" clean: _putpwd rm -f *.diff *.files *.cvslog.template *.cvslog.template.old cleanall: clean rm -f *.cvslog pack: *.diff @echo "===> $@:" @echo -n " " @if [ \! -z "$?" ]; then\ gzip -9 $?;\ echo "packed.";\ else\ echo "(ignore: already packed)";\ fi unpack: *.gz @echo "===> $@:" @echo -n " " @if [ \! -z "$?" ]; then\ gzip -d $?;\ echo "unpacked.";\ else\ echo "(ignore: already unpacked)";\ fi update: @{ cd ${WORK}; cvs -qnR -d ${LCVSROOT} update -Pd ${DOCPREFIX}; } | grep -v "^\?" @{ cd ${WORK}; cvs -qnR -d ${LCVSROOT} update -Pd ${WWWPREFIX}; } | grep -v "^\?" realupdate: @{ cd ${WORK}; cvs -qR -d ${LCVSROOT} update -Pd ${DOCPREFIX}; } | grep -v "^\?" @{ cd ${WORK}; cvs -qR -d ${LCVSROOT} update -Pd ${WWWPREFIX}; } | grep -v "^\?" handbook faq: _putpwd @echo "===> $@:" @{ cd ${WORK}; cvs -qR -d ${LCVSROOT} diff ${DOCPREFIX}/books/$@; }\ | { grep -v "^\?" || cat /dev/null; } >./$@.diff @if [ -s ./$@.diff ]; then\ grep "^Index: " ./$@.diff | sed -e 's/^Index: *//' > ./$@.files;\ [ -f ./$@.cvslog.template ] && mv ./$@.cvslog.template ./$@.cvslog.template.old;\ cat ./$@.diff | ${ORGDIFF} ${DOCPREFIX}/books/$@ > ./$@.cvslog.template;\ [ -f ./$@.cvslog.template.old ] && cmp -s ./$@.cvslog.template ./$@.cvslog.template.old && rm -f ./$@.cvslog.template.old;\ cat ./$@.files | sed -e 's/^/ /g';\ echo ' ===>' `cat ./$@.files | wc -l` 'file(s). ';\ else\ echo " (ignore: no deltas)";\ rm ./$@.diff;\ fi www: _putpwd @echo "===> $@:" -@{ cd ${WORK}; cvs -qR -d ${LCVSROOT} diff ${WWWPREFIX}; } | grep -v "^\?" >./$@.diff @if [ -s ./$@.diff ]; then\ grep "^Index: " ./$@.diff | sed -e 's/^Index: *//' > ./$@.files;\ [ -f ./$@.cvslog.template ] && mv ./$@.cvslog.template ./$@.cvslog.template.old;\ cat ./$@.diff | ${ORGDIFF} ${WWWPREFIX} > ./$@.cvslog.template;\ [ -f ./$@.cvslog.template.old ] && cmp -s ./$@.cvslog.template ./$@.cvslog.template.old && rm -f ./$@.cvslog.template.old;\ cat ./$@.files | sed -e 's/^/ /g';\ echo ' ===>' `cat ./$@.files | wc -l` 'file(s). ';\ else\ echo " (ignore: no deltas)";\ rm ./$@.diff;\ fi .if exists(${BASE}/www.files) && exists(${BASE}/www.cvslog) WWW!=cat ${BASE}/www.files .endif .if exists(${BASE}/handbook.files) && exists(${BASE}/handbook.cvslog) HANDBOOK!=cat ${BASE}/handbook.files .endif .if exists(${BASE}/faq.files) && exists(${BASE}/faq.cvslog) FAQ!=cat ${BASE}/faq.files .endif TARGET=${WWW} ${FAQ} ${HANDBOOK} .if ${HOSTNAME} != ${VIAHOST} sync: _putpwd { cd ${WORK}; rsync -CtzrlpR -vP -e "ssh -x -l hrs" --delete commit ${TARGET} ${VIAHOST}:${WORK}; } .else .if defined(SSH_CLIENT) && !empty(TARGET) CLIENT!=echo ${SSH_CLIENT} | awk '{print $$1}' resync: _putpwd @echo '{ cd ${WORK}; rsync -CtzrlpR -vP -e "ssh -x -l hrs" ${TARGET} ${CLIENT}:${WORK}; }' .endif commit: _putpwd .if exists(${BASE}/www.files) && exists(${BASE}/www.cvslog) @echo "CVS_RSH='ssh' cvs -d ${FCVSROOT} commit -F ${BASE}/www.cvslog ${WWW}" @echo "OK?" @cat > /dev/null cd ${WORK}; CVS_RSH='ssh' cvs -d ${FCVSROOT} commit -F ${BASE}/www.cvslog ${WWW} .endif .if exists(${BASE}/handbook.files) && exists(${BASE}/handbook.cvslog) @echo "CVS_RSH='ssh' cvs -d ${FCVSROOT} commit -F ${BASE}/handbook.cvslog ${HANDBOOK}" @echo "OK?" @cat > /dev/null cd ${WORK}; CVS_RSH='ssh' cvs -d ${FCVSROOT} commit -F ${BASE}/handbook.cvslog ${HANDBOOK} .endif .if exists(${BASE}/faq.files) && exists(${BASE}/faq.cvslog) @echo "CVS_RSH='ssh' cvs -d ${FCVSROOT} commit -F ${BASE}/faq.cvslog ${FAQ}" @echo "OK?" @cat > /dev/null cd ${WORK}; CVS_RSH='ssh' cvs -d ${FCVSROOT} commit -F ${BASE}/faq.cvslog ${FAQ} .endif .endif