# ~jhs/public_html/src/Makefile by Julian H. Stacey SUBDIR += bsd all: automatic.html \ fixes_files.lmth \ fixes_files.html \ fixes_diffs.lmth \ fixes_diffs.html \ index.html \ obj \ # ../src.tgz @${STA} #{ # ../src.tgz is about 24 Meg # It is linked from this index.html @${FIN} #} clean: @echo "Default clean if you remove this line, zaps index.html"# JJLATER @# maybe also zaps automatic.html fixes_diffs.html fixes_files.html @echo Suggestion zap these: -find . -name .depend | xargs rm HEAD=head -6 # The head above should be changed to some better utility that cat's # till a blank line # LOTS!=cd ${.CURDIR} ; find . -type f # # ../src.tgz: ${LOTS} # ../src.tgz: # @echo "Ensuring a minimal size, first running:" # @echo " make clean && make cleandir && make clean" # make clean && make cleandir && make clean # tar -z -c --exclude $@ -f ../src.tgz \ # src Inc standards/common.rof standards/umlauts.rof Makefile.inc # @# Makefile.inc to supply BINDIR to src/bsd/jhs/bin/public/brackets/ # @# One day I might make a FreeBSD port as suggested by Chris H # @# http://lists.freebsd.org/pipermail/freebsd-hackers/\ # @# 2015-March/047211.html # @# meantime I have created $@ as distfile/ # @# for my entire ~/public_html/src/ # @echo "This has been tested by installing into a fresh virgin jail," # @echo "fetching and building ports I need for some tools." # @# My test is still from an Outer Berklix prison, building a # @# FreeBSD jail, then converting it to a Berklix jail. # @# I have not tried a more rigorous test, from a FreeBSD prison to # @# a FreeBSD jail to a Berklix jail. # @# ---------- # @# Manually called occasionaly. # @# (It may be older than some components, as just built # @# intermittently as a convenience in case someone want to # @# fetch all sources in a single fetch). berklix_install: @${STA} #{ @echo "About to install your src.tgz into a new jail" @echo "Assuming you have already done this:" @echo " mkdir /somewhere/jail ; ln -s /somewhere/jail /jail" @echo " setenv DESTDIR /jail" @echo " cd /usr/src/etc && make distrib-dirs" @echo " cd /usr/src && make install" @echo " cd /jail/usr/ports" @echo " mdir ../distfiles; ln -s ../distfiles" @echo " mdir ../packages; ln -s ../packages" @echo " tar zxf /pri/FreeBSD/releases/\`uname -r`\/tars/ports.tgz" @echo " install -c -m 644 /usr/src/etc/master.passwd /jail/etc" @echo " install -c -m 644 /usr/src/etc/group /jail/etc" @# passwd & group needed for root to avoid @# mtree: line 6: unknown user root @# mtree: line 6: unknown group wheel @# when building /usr/ports/www/tidy @# for public_html/src/bsd/jhs/bin/public/date @echo -n " install -c /site/domain/js.berklix.net/etc/make.conf.fetch" @echo " /jail/etc/make.conf" @# make.conf needed to supply old local distfiles to match @# existing uname -r ; that may no longer be on internet. @# You will need your own local version of /etc/make.conf, @# copying components from your files included by your @# outer prison /etc/make.conf @# ----------------- @echo "cd /usr/src/etc ;install -c services /jail/etc @# Needed to avoid fetch of local ports distfiles failing with: @# ftp: Can't lookup `ftp.js.berklix.net:ftp': \ @# servname not supported for ai_socktype @# ----------------- mount -t devfs dev /jail/dev @# avoid failure from /usr/ports/lang/perl5.14 @# /dev/null appears to be a file rather than a device @# Leave the word, jump in a jail, & start adding Berklix @echo " chroot /jail" @#echo " setenv HOME /home/me_in_jail" @echo " HOME=/home/me_in_jail;export HOME" @echo " mkdir -p $HOME/public_html" @echo " cd $HOME/public_html ; tar zxf src.tgz" @echo " cd $HOME/public_html/src && make berklix_install" @# public_html/src is assumed for now by UMLAUTS_INC & COMMON_INC @# by berklix2.mk for bsd/jhs/bin/public/satellite/data/ @echo "The next 2 files are Not standard to generic FreeBSD" @echo "but will have been installed by the above," @echo "if you are already running an external prison with src/" @echo "with Berklix hacks" @echo "If not, next ls will break, & you will need to:" @echo " cd bsd/fixes/FreeBSD/src/jhs/share/mk" @echo " install -c -m 755 berklix.mk berklix2.mk /usr/share/mk/" ls -l /usr/share/mk/berklix.mk /usr/share/mk/berklix2.mk pwd_mkdb -i -p -d /etc /etc/master.passwd make all install echo "The berklix tools are now installed." echo -n "I suggest you now apply the berklix patches" echo " to freebsd src & ports, by doing this:" echo "mkdir -p $HOME/bin/.sh ; cd $HOME/bin/.sh" echo "fetch http://berklix.com/~jhs/bin/.csh/customise" echo "./customise ; cd /usr/src && make install" @${FIN} #} # This does not always work: # LISTFIXES!= cd ${.CURDIR} ; find bsd/fixes -type f -print # fixes_diffs.lmth: ${LISTFIXES} Makefile # fixes_files.lmth: ${LISTFIXES} Makefile # as it sometimes complains about not knowing how to build # bsd/fixes/FreeBSD/ports/jhs/x11-wm/fvwm/debug/index.html fixes_head.lmth_tmp: Makefile @${STA} #{ echo \ '' > ${.CURDIR}/`basename $@` echo "
" >> ${.CURDIR}/`basename $@` echo "" >> ${.CURDIR}/`basename $@` echo "Generated `date` by " >> ${.CURDIR}/`basename $@` echo "Makefile
" >> ${.CURDIR}/`basename $@` @${FIN} #} fixes_diffs.lst_tmp: @${STA} #{ @echo "Creating $@ List of diffs only" (cd ${.CURDIR} ; find bsd/fixes -type f -name \*.diff | sort ) > ${.CURDIR}/`basename $@` @${FIN} #} fixes_files.lst_tmp: @${STA} #{ @echo -n "Creating $@ List of most files, including diff," @echo " excluding executables *.tgz etc" echo "Removing executables" echo "Hashed out: (cd ${.CURDIR} && make clean)" @# If OBJDIR exists, then clean only happesn is OBJDIR so @# executable binaires may still lurk in ${.CURDIR} @echo "If next find errors as it has found nothing, that is Good!" @echo "Else If next find list files, You need to delete them:" -find . -type f \ | xargs file \ | grep -i executable \ | grep -v "ASCII text executable" \ | grep -v "POSIX shell script, ISO-8859 text executable" (cd ${.CURDIR} ; find bsd/fixes -type f \( \ \! -name \*.EXE -a \ \! -name \*.exe -a \ \! -name \*.gz -a \ \! -name \*.jpg -a \ \! -name \*.lmth -a \ \! -name \*.no_customise -a \ \! -name \*.o -a \ \! -name \*.pdf -a \ \! -name \*.pgp -a \ \! -name \*.png -a \ \! -name \*.tgz -a \ \! -name \*.xmhcache \ \! -name \*/mail/\* -a \ \) -print ) | sort | grep -v /mail/> ${.CURDIR}/`basename $@` @# bsd/jhs/bin/public/phone/fritz/mail/2 has high bit in mail @${FIN} #} fixes_files.lmth: fixes_head.lmth_tmp fixes_files.lst_tmp @${STA} #{ rm -f ${.CURDIR}/fixes_tail.lst_tmp ln -s fixes_files.lst_tmp ${.CURDIR}/fixes_tail.lst_tmp @# make fixes_tail.lmth_tmp cd ${.CURDIR} && make fixes_tail.lmth_tmp echo xxxxxxxxx1 ls -l ${.CURDIR}/fixes_head.lmth_tmp ls -l ${.CURDIR}/fixes_tail.lmth_tmp cat ${.CURDIR}/fixes_head.lmth_tmp ${.CURDIR}/fixes_tail.lmth_tmp \ > ${.CURDIR}/`basename $@` @# Not necessary to rm the common ${.CURDIR}/fixes_head.lmth_tmp @# Remove the switchable symbolic link ${.CURDIR}/fixes_tail.lmth_tmp rm ${.CURDIR}/fixes_tail.lmth_tmp @# Not necessary to rm fixes_files.lst_tmp echo xxxxxxxx11 @${FIN} #} fixes_diffs.lmth: fixes_head.lmth_tmp fixes_diffs.lst_tmp @${STA} #{ rm -f ${.CURDIR}/fixes_tail.lst_tmp ln -s fixes_diffs.lst_tmp ${.CURDIR}/fixes_tail.lst_tmp cd ${.CURDIR} && make fixes_tail.lmth_tmp echo xxxxxxxxx2 cat ${.CURDIR}/fixes_head.lmth_tmp ${.CURDIR}/fixes_tail.lmth_tmp \ > ${.CURDIR}/`basename $@` @# Not necessary to rm the common ${.CURDIR}/fixes_head.lmth_tmp @# Remove the switchable symbolic link ${.CURDIR}/fixes_tail.lmth_tmp rm ${.CURDIR}/fixes_tail.lmth_tmp @# Not necessary to rm fixes_diffs.lst_tmp @${FIN} #} # fixes_files.lmth from fixes_files.lmth via standard berklix.mk macros # fixes_diffs.html from fixes_diffs.lmth via standard berklix.mk macros # Some files are called *.lmth_tmp & *.lst_tmp rather than .lmth & .lst, # to avoid any chance of suffix rules interfering fixes_tail.lmth_tmp: fixes_tail.lst_tmp Makefile # Dependency fixes_tail.lst_tmp is just a sanity check, # it is pre-created by fixes_files.lmth & fixes_diffs.lmth @${STA} #{ echo "" >> ${.CURDIR}/`basename $@` ; \ ${HEAD} ${.CURDIR}/$$i | sed 's/\</g' | \ sed 's/>/\>/g' | sed 's/&/\&/g' >> ${.CURDIR}/`basename $@` ; \ echo "
" >> ${.CURDIR}/`basename $@` ; \ ${HEAD} ${.CURDIR}/$$i | sed 's/\</g'\ | sed 's/>/\>/g' | sed 's/&/\&/g' >> ${.CURDIR}/`basename $@` ; \ echo "