# ~/public_html/Makefile by Julian H. Stacey # JJLATER: # All .html have been converted to .lmth, Except in bim/ # The following dirs may break, Makefiles need looking at: # src/bsd/jhs/bin/public/phone/ # src/bsd/jhs/bin/public/satelite/ # I could add public /etc files .include "/site/Makefile.rdist6" # See also: README.htaccess # NO_OBJ does not stop /usr/obj/`pwd` being created, # as subsidiary directories create it. SUBDIR += Inc # SUBDIR += ../private/html/mac # SUBDIR += fun # SUBDIR += home # SUBDIR += jpg # SUBDIR += pics #ifndef BERKLIX_SERVER #{ SUBDIR += cv # Build depends on source text not on server. #endif #} #ifndef BERKLIX_SERVER #{ SUBDIR += bin # Loops on land.berklix.org 9.3-RELEASE #endif #} SUBDIR += aachen_1944 SUBDIR += adverts SUBDIR += android SUBDIR += average_adjuster SUBDIR += bash SUBDIR += berklix SUBDIR += bg SUBDIR += bike SUBDIR += bike-fast SUBDIR += bim SUBDIR += blog SUBDIR += books SUBDIR += brexit SUBDIR += bsd SUBDIR += bsdpie SUBDIR += cars/narrow SUBDIR += chilli SUBDIR += chinchilla_giganta SUBDIR += consultants SUBDIR += contact SUBDIR += contacts SUBDIR += cool_box SUBDIR += corona SUBDIR += ctm SUBDIR += deter SUBDIR += dots SUBDIR += epub SUBDIR += eu SUBDIR += ewinter SUBDIR += fall SUBDIR += faraday SUBDIR += fax SUBDIR += ferries SUBDIR += flights SUBDIR += fraud SUBDIR += free SUBDIR += freebsd SUBDIR += ftp SUBDIR += garda SUBDIR += gea SUBDIR += gifs SUBDIR += github SUBDIR += hardware SUBDIR += harries SUBDIR += help SUBDIR += holz SUBDIR += ibu SUBDIR += idacas SUBDIR += isar SUBDIR += jlucas SUBDIR += kindle SUBDIR += laptops SUBDIR += mail SUBDIR += maps SUBDIR += mecc SUBDIR += media SUBDIR += meet SUBDIR += mobile SUBDIR += monorail SUBDIR += ms SUBDIR += nim SUBDIR += north SUBDIR += pc532 SUBDIR += pcs SUBDIR += petitions SUBDIR += phone SUBDIR += pi SUBDIR += pics SUBDIR += pirates SUBDIR += population SUBDIR += post SUBDIR += pri SUBDIR += project SUBDIR += putin SUBDIR += puzzle SUBDIR += qr SUBDIR += rates SUBDIR += sale SUBDIR += scanjet SUBDIR += security SUBDIR += seismik SUBDIR += sfd SUBDIR += ski SUBDIR += smart-home SUBDIR += sms SUBDIR += src SUBDIR += ssl SUBDIR += stadtmuenchen SUBDIR += standards SUBDIR += starnberg SUBDIR += std SUBDIR += symmetric SUBDIR += systems SUBDIR += techtalk SUBDIR += teeth SUBDIR += test SUBDIR += tolino SUBDIR += toytown SUBDIR += trans SUBDIR += translate SUBDIR += txt SUBDIR += vcfe SUBDIR += video SUBDIR += volksentscheid SUBDIR += walk SUBDIR += water .if exists (pics/isar/Makefile) SUBDIR += pics/isar .endif .if (make(clean) || make(obj)) # Reduce SUBDIR to only clean src/ # cleandir is not here, as I want all # dependent files generated local ready for access by web server; # so I do not limit the removal of obj links. .if !target(html) SUBDIR = src .endif .endif # Next target not called automatically, till I work out how to # do it along with SUBDIR & working on different versions of FreeBSD all: html index.html all.html modes rd asclist grepnowww warn_mirror # checks usb cdrom # Incomplete experiment JJLATER # REVTMP= # REV != echo ${SUBDIR} | \ # ( for d in `cat` ; do \ # REVTMP:= echo "aa $$d bb $${REVTMP} cc" ; \ # done ; \ # echo "$${REVTMP}" ) # rev: # @echo ${REV} all_lmth_hook: ${.CURDIR}/all.lmth Makefile @${STA} #{ cd ${.CURDIR} ; make all.html @${FIN} #} all_html_hook: all.html @${STA} #{ @echo "You should have called all_lmth_hook, calling for you" cd ${.CURDIR} ; make all_lmth_hook @${FIN} #} clean: @${STA} #{ @# echo "Not removing all.html index.html" @# -cd ${.CURDIR} ; ls -l all.html index.html @echo "Suggestion: make clean-c" @echo "Suggestion: make cleandepend" @${FIN} #} cleandepend: find . -type f -name \.depend\* | xargs rm @# this works, clean-c does not clean-c: @# -cd ${.CURDIR}/src/bsd/jhs/bin && \ find . -type f -name \\.depend\\* | xargs ls -l -cd ${.CURDIR}/src/bsd/jhs/bin && \ find . -type f -name \\.depend\\* | xargs rm -f @# -cd ${.CURDIR}/src/bsd/jhs/bin && \ find . -type f -name \\.depend\\.\*\\.o | xargs ls -l -cd ${.CURDIR}/src/bsd/jhs/bin && \ find . -type f -name \\.depend\\.\*\\.o | xargs rm -f -cd ${.CURDIR}/src/bsd/jhs/bin && \ find . -type f -name \*\.o | xargs ls -l ${.CURDIR}/all.lmth! echo -n '' >> $@ echo "" >> $@ echo "
' >> $@
echo '' >> $@
echo '' >> $@
echo '' >> $@
chmod 644 $@
@${FIN} #}
asclist:
@${STA} #{
@echo "Convert these to .txt make it easy for others browsers"
find . -name \*.asc
@${FIN} #}
clean_find_depends:
@${STA} #{
cd ${.CURDIR} ; find . -name .depend.\* | xargs ls -l
@# cd ${.CURDIR} ; find . -name .depend.\* | xargs rm
@${FIN} #}
warn_find_obsolete_links:
@${STA} #{
@echo "Patches for obsolete release I no longer use"
@# Links need to be removed After pointing to new files I still need
-cd ${.CURDIR}/src/bsd/fixes/FreeBSD ; pwd ; \
find . -name \*REL=10.0-RELEASE\*
-cd ${.CURDIR}/src/bsd/fixes/FreeBSD ; pwd ; \
find . -name \*REL=10.1-RELEASE\*
-cd ${.CURDIR}/src/bsd/fixes/FreeBSD ; pwd ; \
find . -type l | xargs ls -l | grep REL=10.2-RELEASE
-cd ${.CURDIR}/src/bsd/fixes/FreeBSD ; pwd ; \
find . -type l | xargs ls -l | grep REL=10.3-RELEASE
@echo "I should move 10.* files to 10.4-RELEASE" # released 2017-10-03
-cd ${.CURDIR}/src/bsd/fixes/FreeBSD ; pwd ; \
find . -name \*REL=11.0-RELEASE\*
@echo "I should move 11.* files to 11.3-RELEASE" # released 2019-07-09
-cd ${.CURDIR}/src/bsd/fixes/FreeBSD ; pwd ; \
find . -name \*REL=9.0-RELEASE\*
@# In future I'd be better having symbolic links all pointing forward,
@# not backward to older releases, then each new release per item,
@# I would just have to move 1 file & create 1 link.
@${FIN} #}
# man make:
@${STA} #{
# ! Targets are always re-created, but not until all sources
# have been examined and re-created as necessary. Sources for a
# target accumu- late over dependency lines when this operator is
# used. The target is removed if make is interrupted.
modes!
echo $@
.if exists(/site)
@echo "Next chown fails only if something is not owned by jhs"
cd /tmp; cd ${.CURDIR} && find . -print0 | \
xargs -0 ${XS} chown -h jhs
.else # build for cdrom inside a chroot
find . -print0 | xargs -0 chown -h www
.endif
@# chown fixes things like src/bsd/jhs/bin/public/filesize/tst.20
@# which if make runs as root are uid 0
@# The print0 & xargs -0 are to cope with a nasty
@# ".kde/share/apps/knotes/notes/knote/knote 1"
.if exists(/site)
cd /tmp;cd ${.CURDIR} && find . -type f -print0 \
| xargs -0 chmod a+r
cd /tmp;cd ${.CURDIR} && find . -type d -print0 \
| xargs -0 chmod a+rx
.else # build for cdrom inside a chroot
.endif
@# Symbolic links must be owned by me, (not root as I once discovered
@# some to be), else I suspect rdist may not upload them to the web.
rd!
@echo "skipping rdist lap 2>&1 > /dev/null &"
tidy:
@${STA} #{
find . -type f -name \*.lmth | \
grep -v ./bin/index.html | \
grep -v ./src/fixes.html | \
grep -v ./dots/index.html | \
xargs tidy -i -m
@# I could add some bim m4 exceptions to the list above.
@# but not important if I dont, equally unimportantn if I
@# werent to except the 3 above.
@${FIN} #}
script_strip:
@${STA} #{
@# Run this after "script webcp_local_one_off"
@# to show only errors im interested to fix.
cat typescript | \
grep -v jhs/ewinter | \
grep -v jhs/bim/talks/asterisk | \
grep -v Inc/gifs | \
grep -v JHS | \
grep -v "Authorization Required" | \
grep -v "Forbidden" | \
grep -v "not parsed, looks like binary" | \
@${FIN} #}
# JJLATER fix webcp_local_one_off to supply flags to tell httrack
# to ignore files called inc & .sed
usb: usb.ufs usb.dos
@${STA} #{
usb.ufs:
@${STA} #{
cd ${.CURDIR}/.. ; rdist -R -f public_html/Distfile usb.ufs
@${FIN} #}
usb.dos:
@${STA} #{
cd ${.CURDIR}/.. ; rdist -R -f public_html/Distfile usb.dos
@${FIN} #}
cdrom:
@${STA} #{
@echo "JJLATER also mkisofs a cdrom rock ridge image & put it on"
@echo "king /dev/da0s1 so that it can be read on MS systems"
@${FIN} #}
# Scan for phone numbers @ other strings I may not want public.
.if exists(../private/Makefile_personal)
.include "../private/Makefile_personal"
SCAN_TEL =
SCAN_TEL += $(TKOM_CARD_FAX)
SCAN_TEL += $(TKOM_CARD_TEL)
SCAN_TEL += $(TKOM_FAMILY_TEL)
SCAN_TEL += $(TKOM_MODEM)
SCAN_TEL += $(TKOM_PERMIN_TEL)
SCAN_TEL += $(TKOM_PERSONAL_FAX)
SCAN_TEL += $(TKOM_PERSONAL_TEL)
SCAN_TEL += $(TKOM_MEL)
SCAN_TEL += $(MOBILE_REAL)
# JJLATER MOBILE_REAL is just last digit string
# JJLATER MOBILE_DE is full +49 etc
# SCAN_TEL += $(TKOM_CDROM_TEL) # Do not scan for this.
# SCAN_TEL += $(TKOM_WEB_TEL) # Do not scan for this.
SCAN_TEL += $(AACHEN_1)
SCAN_TEL += $(AACHEN_2)
SCAN_TEL += $(AACHEN_3)
SCAN_TEL += $(MOBILE_UK)
.else
SCAN_TEL = "no_Makefile_personal_list_of_numbers"
.endif
grep_tel:
@${STA} #{
-for i in ${SCAN_TEL} ; \
do \
echo "Scanning for $$i" ; \
find . -type f \
| xargs grep -l $$i ; \
done
@echo done
@${FIN} #}
# Scan for phone numbers @ other strings I may not want public
.if exists(../private/Makefile_personal)
SCAN_EML =
SCAN_EML += $(EMAIL_BUSINESS)
SCAN_EML += $(EMAIL_PERSONAL)
SCAN_EML += $(LEAK_SCAN)
.else
SCAN_EML = "no_Makefile_personal_list_of_emails"
.endif
SCAN_EML += jhs@'berklix'\.com
SCAN_EML += jhs@'berklix'\.net
SCAN_EML += jhs@'berklix'\.org
SCAN_EML += jhs\-list@'berklix'\.com
SCAN_EML += jhs\-list@'berklix'\.net
SCAN_EML += jhs\-list@'berklix'\.org
SCAN_EML += jhs@'bsdpie'\.com
SCAN_EML += jhs@'freebsd'\.org
SCAN_EML += jhs@'surfacevision'\.com
SCAN_EML += postmaster@'berklix'\.com
SCAN_EML += postmaster@'berklix'\.net
SCAN_EML += postmaster@'berklix'\.org
SCAN_EML += postmaster@'bsdpie'\.com
SCAN_EML += postmaster@'surfacevision'\.com
SCAN_EML += webmaster@'berklix'\.com
SCAN_EML += webmaster@'berklix'\.net
SCAN_EML += webmaster@'berklix'\.org
SCAN_EML += webmaster@'bsdpie'\.com
grep_private:
@${STA} #{
@echo Scanning for ${SCAN_EML}
@# The echo is to break up components in LEAK_SCAN.
-cd ${.CURDIR}; for i in `echo ${SCAN_EML}` ; \
do \
echo " " ; \
echo "Scanning for $$i" ; \
find . -type f | xargs grep -l $$i ; \
done
@echo done
@${FIN} #}
grep_for:
@${STA} #{
-cd ${.CURDIR}; find . -name \*.eps -o -name \*.ps | \
xargs grep "^%%For: " | rev | sort | uniq | rev
@${FIN} #}
# LINKCHECKER= -t -1 -r20 --no-warnings --no-status
LINKCHECKER=
LINKCHECKER+= -t-1
# -t-1 disable threading
# Cos otherwise going through the log
# looking for errors, one keep dancing around chopping
# between same hand full of files editing them, & its
# a waste of time keep editing single errors in
# dfferent files, closing & opening others.
LINKCHECKER+= -r20
# -r20 restricy recursion to 20, not infinite
LINKCHECKER+= --no-warnings
# Suppress warnings until all errors cleared.
# LINKCHECKER+= -oblacklist
# too cryptic only lists failing URLS, but where they come from,
# so might be OK later if I only have a a few errors left to
# keep under control, but not now while I have loads to search for.
LINKCHECKER+= --no-status
# LINKCHECKER+= --ignore-url=^https://
# LinkChecker internal error, over and out
# LINKCHECKER+= --ignore-url=https://
# LinkChecker internal error, over and out
# LINKCHECKER+= --ignore-url=^mailto:
# I deliberately cripple all my mailto to upset spammers
# so I used not to check,
# but now am I am moving my cripplings to left of the @
# so I can at least check domains exist.
# -q
checks: checkindex all_lmth_hook linkcheck linkchecker.jhs httrack_chk \
symlinkcheck checksite
checkindex:
@${STA} #{
@echo "Starting `pwd`/Makefile $@"
test -e ${.CURDIR}/index.html
@# Above is to check index.html is under eg
@# /home/jhs/public_html/ or /0s1/usr1/home/jhs/._dir/public_html
@# and not under /usr/obj/`pwd`, else ~jhs/ Web will not be visible
@# to browsers.
@echo "Finished `pwd`/Makefile $@"
@${FIN} #}
linkcheck:
@${STA} #{
@echo "Starting `pwd`/Makefile $@"
@# linkcheck -help
-ls -l ${HOME}/tmp/linkcheck.report.localhost
@# This recurses.
@# It doesnt write ${HOME}/linkcheck.report.localhost till ^C
echo Skipping # cd ${HOME}/tmp && linkcheck -r http://localhost/~jhs/
@# the command above creates loads of useless "Bad return code!!!!"
-ls -l ${HOME}/tmp/linkcheck.report.localhost
@echo "Finished `pwd`/Makefile $@"
@${FIN} #}
linkchecker.jhs:
@${STA} #{
@echo "Starting `pwd`/Makefile $@"
@echo "Big test of all of ~jhs"
@echo "Problem faraday & newer have a load of missing .txt in"
@echo "free/talk/faraday/presentations/export/1_intro_julian/"
@# - Run on remote servers fails, fails,
@# complaining it needs some python that clashes with Mailman.
@# - Run on gate: Loads of spurious 'Connection reset by peer'
@# - Run on internal host behind a forewall, using a proxy:"
@# all these things fail, making it hard to peruse the log
@# Error - Cause
@# 403 Forbidden - https
@# error: [Errno 61] Connection refused - mailto:
@# These would still fail even if run direct on internet:
@# 401 Unauthorized - passworded pages
cd ${HOME}/tmp && linkchecker ${LINKCHECKER} http://localhost/~jhs/
@echo "Finished `pwd`/Makefile $@"
@${FIN} #}
httrack_chk:
@${STA} #{
@echo "Starting `pwd`/Makefile $@"
@echo "This will not copy, just check"
@# It is not much use as:
@# - It produces a files with no CR,
@# so I use s/localhost/ControlVEnter/g
@# - Theres then a load of Escape[ to swap to CR
@# - Then use !}sort !}uniq
@# - Then unresolved refs end in eg:
@# localhost/~jhs/cv/stacey_g.1.pcl (220 bytes) - 404
@# - So use | rev | sort | rev
@# - 301 OK
@# - 401 Password locked
@# - 403 .htaccess
cd ${HOME}/tmp && httrack -d --spider http://localhost/~jhs/
@# --spider