pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Wed Jul  4 13:40:45 UTC 2018

Modified Files:
        pkgsrc/archivers/dar: Makefile
        pkgsrc/archivers/freeze: Makefile
        pkgsrc/archivers/p7zip: Makefile
        pkgsrc/archivers/rox-archive: Makefile
        pkgsrc/archivers/sarab: Makefile
        pkgsrc/archivers/zutils: Makefile
        pkgsrc/audio/amarok: Makefile
        pkgsrc/audio/daapd: Makefile
        pkgsrc/audio/esound: Makefile
        pkgsrc/audio/gramofile: Makefile
        pkgsrc/audio/juke: Makefile
        pkgsrc/audio/liblo: Makefile
        pkgsrc/audio/libvisual: Makefile
        pkgsrc/audio/moss: Makefile
        pkgsrc/audio/mt-daapd: Makefile
        pkgsrc/audio/muse: Makefile
        pkgsrc/audio/musicpd: Makefile
        pkgsrc/audio/tap-plugins: Makefile
        pkgsrc/audio/terminatorx: Makefile
        pkgsrc/audio/timidity: Makefile
        pkgsrc/audio/toolame: Makefile
        pkgsrc/audio/wavesurfer: Makefile
        pkgsrc/audio/wsoundserver: Makefile
        pkgsrc/biology/cdhit: Makefile
        pkgsrc/biology/htslib: Makefile
        pkgsrc/biology/ncbi-blast+: Makefile
        pkgsrc/cad/klayout: Makefile
        pkgsrc/cad/mex-wcalc: Makefile
        pkgsrc/cad/qcad: Makefile
        pkgsrc/cad/solvespace: Makefile
        pkgsrc/chat/anope: Makefile
        pkgsrc/chat/bitchx: Makefile
        pkgsrc/chat/ircd-hybrid: Makefile
        pkgsrc/chat/ircservices: Makefile
        pkgsrc/chat/jabberd2: Makefile
        pkgsrc/chat/psybnc: Makefile
        pkgsrc/chat/quirc: Makefile
        pkgsrc/chat/roxirc: Makefile
        pkgsrc/chat/silc-server: Makefile
        pkgsrc/chat/spectrum: Makefile
        pkgsrc/chat/telegram-purple: Makefile
        pkgsrc/chat/tkirc2: Makefile
        pkgsrc/chat/unrealircd: Makefile
        pkgsrc/comms/asterisk: options.mk
        pkgsrc/comms/asterisk13: options.mk
        pkgsrc/comms/asterisk14: options.mk
        pkgsrc/comms/asterisk18: options.mk
        pkgsrc/comms/conserver: Makefile
        pkgsrc/comms/conserver8: Makefile
        pkgsrc/comms/minicom: Makefile
        pkgsrc/comms/op_panel: Makefile
        pkgsrc/comms/p5-pilot-link: Makefile
        pkgsrc/cross/avr-gcc: Makefile
        pkgsrc/cross/cc65: Makefile
        pkgsrc/cross/nios2-gcc: Makefile
        pkgsrc/cross/nios2-gcc41: options.mk
        pkgsrc/databases/cstore: Makefile
        pkgsrc/databases/mysqltuner: Makefile
        pkgsrc/databases/openldap: Makefile.common
        pkgsrc/databases/pgbuildfarm: Makefile
        pkgsrc/databases/poco-data-mysql: Makefile
        pkgsrc/devel/ExmanIDE: Makefile
        pkgsrc/devel/ProjectCenter: Makefile
        pkgsrc/devel/adacurses: Makefile
        pkgsrc/devel/bullet: Makefile
        pkgsrc/devel/cpuflags: Makefile
        pkgsrc/devel/cscope: Makefile
        pkgsrc/devel/distcc: Makefile.common
        pkgsrc/devel/distccmon-gtk: Makefile
        pkgsrc/devel/elfsh: Makefile
        pkgsrc/devel/emacs-ilisp: Makefile
        pkgsrc/devel/exctags: Makefile
        pkgsrc/devel/glib2: Makefile.common
        pkgsrc/devel/gnustep-make: Makefile gnustep.mk
        pkgsrc/devel/gprbuild-aux: Makefile
        pkgsrc/devel/gps: Makefile
        pkgsrc/devel/grantlee: Makefile
        pkgsrc/devel/lcov: Makefile
        pkgsrc/devel/lemon: Makefile
        pkgsrc/devel/libgphoto2: Makefile
        pkgsrc/devel/libmemmgr: Makefile
        pkgsrc/devel/mico: Makefile
        pkgsrc/devel/mono-tools: Makefile
        pkgsrc/devel/monodevelop: Makefile
        pkgsrc/devel/noweb: Makefile
        pkgsrc/devel/nsis: Makefile
        pkgsrc/devel/nss: Makefile
        pkgsrc/devel/pwlib: Makefile
        pkgsrc/devel/rebar: Makefile
        pkgsrc/devel/rox-lib: Makefile
        pkgsrc/devel/rt3: Makefile.install
        pkgsrc/devel/slib: Makefile
        pkgsrc/devel/sloccount: Makefile
        pkgsrc/devel/tcllib: Makefile
        pkgsrc/devel/tclreadline: Makefile
        pkgsrc/devel/ucl: Makefile
        pkgsrc/devel/ucpp: Makefile
        pkgsrc/devel/uno: Makefile
        pkgsrc/devel/vanessa_logger: Makefile
        pkgsrc/devel/zookeeper: Makefile
        pkgsrc/devel/zzuf: Makefile
        pkgsrc/editors/TeXmacs: Makefile
        pkgsrc/editors/lpe: Makefile
        pkgsrc/editors/rox-edit: Makefile
        pkgsrc/editors/tomboy: Makefile
        pkgsrc/editors/vim-share: Makefile.common
        pkgsrc/emulators/dosbox: Makefile
        pkgsrc/emulators/dynagen: Makefile
        pkgsrc/emulators/dynamips: Makefile
        pkgsrc/emulators/emulationstation: Makefile
        pkgsrc/emulators/fceu: Makefile
        pkgsrc/emulators/gxemul: Makefile
        pkgsrc/emulators/pearpc: Makefile
        pkgsrc/emulators/simulavr: Makefile
        pkgsrc/emulators/ski: Makefile
        pkgsrc/emulators/spim: Makefile
        pkgsrc/emulators/tuxnes: Makefile
        pkgsrc/emulators/xbeeb: Makefile options.mk
        pkgsrc/filesystems/fuse-afpfs-ng: Makefile
        pkgsrc/filesystems/fuse-gmailfs: Makefile
        pkgsrc/filesystems/fuse-svnfs: Makefile
        pkgsrc/filesystems/fuse-wikipediafs: Makefile
        pkgsrc/finance/tclticker: Makefile
        pkgsrc/fonts/t1lib: Makefile
        pkgsrc/games/0verkill: Makefile
        pkgsrc/games/blindmine: Makefile
        pkgsrc/games/bzflag: Makefile
        pkgsrc/games/crossfire-client: Makefile.common
        pkgsrc/games/et: Makefile
        pkgsrc/games/falcons-eye: Makefile
        pkgsrc/games/fillets-ng: Makefile
        pkgsrc/games/freeciv-share: Makefile.common
        pkgsrc/games/gnome-games: Makefile
        pkgsrc/games/libkdegames: Makefile
        pkgsrc/games/pioneers: Makefile
        pkgsrc/games/powermanga: Makefile
        pkgsrc/games/prboom: Makefile
        pkgsrc/games/prboom-plus: Makefile
        pkgsrc/games/pysolfc: Makefile
        pkgsrc/games/quake2forge: Makefile
        pkgsrc/games/quakeforge: Makefile
        pkgsrc/games/tyrquake: Makefile
        pkgsrc/games/xrick: Makefile
        pkgsrc/geography/kplex: Makefile
        pkgsrc/graphics/asymptote: Makefile
        pkgsrc/graphics/aview: Makefile
        pkgsrc/graphics/camlimages: Makefile
        pkgsrc/graphics/colord: Makefile
        pkgsrc/graphics/djview4: Makefile
        pkgsrc/graphics/f-spot: Makefile
        pkgsrc/graphics/imlib2: Makefile
        pkgsrc/graphics/netpbm: Makefile
        pkgsrc/graphics/py-qrcode: Makefile
        pkgsrc/graphics/tkpiechart: Makefile
        pkgsrc/ham/chirp: Makefile
        pkgsrc/ham/fldigi: Makefile
        pkgsrc/ham/gnuradio-core: Makefile.common
        pkgsrc/ham/trustedQSL: Makefile
        pkgsrc/inputmethod/canna-canuum: Makefile
        pkgsrc/lang/ccsh: Makefile
        pkgsrc/lang/ecl: Makefile
        pkgsrc/lang/erlang: Makefile
        pkgsrc/lang/ghc: Makefile
        pkgsrc/lang/mono2: Makefile
        pkgsrc/lang/pear: Makefile
        pkgsrc/lang/perl5: Makefile
        pkgsrc/lang/rust: Makefile
        pkgsrc/lang/scheme48: Makefile
        pkgsrc/lang/snobol: Makefile
        pkgsrc/mail/OSBF-lua: Makefile
        pkgsrc/mail/akonadi: options.mk
        pkgsrc/mail/courier-maildir: Makefile
        pkgsrc/mail/courier-mta: Makefile
        pkgsrc/mail/dcc: Makefile
        pkgsrc/mail/deliver: Makefile
        pkgsrc/mail/dk-milter: Makefile
        pkgsrc/mail/dspam: Makefile
        pkgsrc/mail/elm-me: Makefile
        pkgsrc/mail/exim: Makefile
        pkgsrc/mail/exim3: Makefile
        pkgsrc/mail/gld: Makefile
        pkgsrc/mail/gnus: Makefile
        pkgsrc/mail/mailman: Makefile
        pkgsrc/mail/metamail: Makefile
        pkgsrc/mail/minimalist: Makefile
        pkgsrc/mail/mush: Makefile
        pkgsrc/mail/neomutt: options.mk
        pkgsrc/mail/opensmtpd: Makefile
        pkgsrc/mail/pfqueue: Makefile options.mk
        pkgsrc/mail/postfix: Makefile
        pkgsrc/mail/qmail: options.mk
        pkgsrc/mail/qmail-run: Makefile
        pkgsrc/mail/spamd: Makefile
        pkgsrc/mail/sympa: Makefile
        pkgsrc/mail/up-imapproxy: Makefile
        pkgsrc/math/R-CGIwithR: Makefile
        pkgsrc/math/R-nloptr: Makefile
        pkgsrc/math/qalculate: Makefile
        pkgsrc/mbone/beacon: Makefile
        pkgsrc/misc/ansiweather: Makefile
        pkgsrc/misc/ascii: Makefile
        pkgsrc/misc/brs: Makefile
        pkgsrc/misc/calibre: Makefile
        pkgsrc/misc/rox-memo: Makefile
        pkgsrc/misc/screen: Makefile
        pkgsrc/misc/send-pr: Makefile
        pkgsrc/misc/vimpager: Makefile
        pkgsrc/misc/zyGrib: Makefile
        pkgsrc/multimedia/avidemux: Makefile
        pkgsrc/multimedia/dvdrip: Makefile
        pkgsrc/multimedia/ffmpeg010: Makefile.common
        pkgsrc/multimedia/ffmpeg1: Makefile.common
        pkgsrc/multimedia/ffmpeg2: Makefile.common
        pkgsrc/multimedia/libmp4v2: Makefile
        pkgsrc/multimedia/mediatomb: Makefile
        pkgsrc/multimedia/mplayer-plugin: Makefile
        pkgsrc/multimedia/sickbeard: Makefile
        pkgsrc/multimedia/xine-lib: Makefile
        pkgsrc/net/DarwinStreamingServer: Makefile
        pkgsrc/net/ORBit: hacks.mk
        pkgsrc/net/aget: Makefile
        pkgsrc/net/aiccu: Makefile
        pkgsrc/net/apollo: Makefile
        pkgsrc/net/arpwatch: Makefile
        pkgsrc/net/chrony: Makefile
        pkgsrc/net/coilmq: Makefile
        pkgsrc/net/dctc: Makefile
        pkgsrc/net/ddclient: Makefile
        pkgsrc/net/dgd: Makefile
        pkgsrc/net/ez-ipupdate: Makefile
        pkgsrc/net/freeradius2: Makefile
        pkgsrc/net/hf6to4: Makefile
        pkgsrc/net/irrd: Makefile
        pkgsrc/net/jftpgw: Makefile
        pkgsrc/net/knot: Makefile
        pkgsrc/net/libnipper: Makefile
        pkgsrc/net/libquic: Makefile
        pkgsrc/net/mono-nat: Makefile
        pkgsrc/net/monotorrent: Makefile
        pkgsrc/net/monsoon: Makefile
        pkgsrc/net/mrtg: Makefile
        pkgsrc/net/nagios-plugin-radius: Makefile
        pkgsrc/net/ndiff: Makefile
        pkgsrc/net/nipper: Makefile
        pkgsrc/net/ocsinventory-agent: Makefile
        pkgsrc/net/oinkmaster: Makefile
        pkgsrc/net/p5-RPC-XML: Makefile
        pkgsrc/net/pconsole: Makefile
        pkgsrc/net/poptop: Makefile
        pkgsrc/net/pptp: Makefile
        pkgsrc/net/proxytunnel: Makefile
        pkgsrc/net/publicfile-run: Makefile
        pkgsrc/net/py-pcap: Makefile
        pkgsrc/net/pygopherd: Makefile
        pkgsrc/net/rinetd: Makefile
        pkgsrc/net/rsync: Makefile
        pkgsrc/net/ruby-stompserver: Makefile
        pkgsrc/net/samba: Makefile
        pkgsrc/net/samba4: Makefile
        pkgsrc/net/scapy: Makefile
        pkgsrc/net/sipsak: Makefile
        pkgsrc/net/smokeping: Makefile
        pkgsrc/net/snort: Makefile
        pkgsrc/net/socat: Makefile
        pkgsrc/net/sysmon: Makefile
        pkgsrc/net/twittering-mode: Makefile
        pkgsrc/net/ucspi-tcp: options.mk
        pkgsrc/net/vpnc: Makefile options.mk
        pkgsrc/net/vsftpd: Makefile
        pkgsrc/net/xymon: Makefile
        pkgsrc/net/zenmap: Makefile
        pkgsrc/parallel/ganglia-monitor-core: Makefile
        pkgsrc/parallel/gridscheduler: Makefile
        pkgsrc/parallel/sge: Makefile
        pkgsrc/parallel/slurm-wlm: Makefile
        pkgsrc/pkgtools/dfdisk: Makefile
        pkgsrc/pkgtools/libkver: Makefile
        pkgsrc/pkgtools/pbulk: Makefile
        pkgsrc/pkgtools/pkg: Makefile
        pkgsrc/pkgtools/pkg_filecheck: Makefile
        pkgsrc/pkgtools/pkg_notify: Makefile
        pkgsrc/pkgtools/pkgclean: Makefile
        pkgsrc/pkgtools/pkgfind: Makefile
        pkgsrc/print/apsfilter: Makefile
        pkgsrc/print/cups-base: Makefile
        pkgsrc/print/cups15: Makefile
        pkgsrc/print/foo2zjs: Makefile
        pkgsrc/print/indexinfo: Makefile
        pkgsrc/print/pdfmod: Makefile
        pkgsrc/print/py-cups: Makefile
        pkgsrc/print/xpdf: Makefile
        pkgsrc/print/xpdf-korean: Makefile
        pkgsrc/security/base: Makefile
        pkgsrc/security/chkrootkit: Makefile
        pkgsrc/security/dropbear: Makefile
        pkgsrc/security/duo-unix: Makefile
        pkgsrc/security/easy-rsa: Makefile
        pkgsrc/security/gpgme: Makefile
        pkgsrc/security/ike-scan: Makefile
        pkgsrc/security/libprelude: Makefile.common
        pkgsrc/security/nikto: Makefile
        pkgsrc/security/opendnssec: Makefile
        pkgsrc/security/openvas-server: Makefile
        pkgsrc/security/p5-Crypt-GPG: Makefile
        pkgsrc/security/p5-pcsc: Makefile
        pkgsrc/security/pam-tacplus: Makefile
        pkgsrc/security/password-store: Makefile
        pkgsrc/security/pcsc-tools: Makefile
        pkgsrc/security/pks: Makefile
        pkgsrc/security/prelude-lml: Makefile
        pkgsrc/security/prelude-manager: Makefile
        pkgsrc/security/prelude-pflogger: Makefile
        pkgsrc/security/py-prewikka: Makefile
        pkgsrc/security/py-requests-kerberos: Makefile
        pkgsrc/security/qca2: Makefile.common
        pkgsrc/security/qca2-gnupg: Makefile
        pkgsrc/security/qca2-ossl: Makefile
        pkgsrc/security/qca2-qt5-gnupg: Makefile
        pkgsrc/security/qca2-qt5-ossl: Makefile
        pkgsrc/security/skey: hacks.mk
        pkgsrc/security/snortsnarf: Makefile
        pkgsrc/security/softhsm: Makefile
        pkgsrc/security/uvscan: Makefile
        pkgsrc/shells/lshell: Makefile
        pkgsrc/shells/xonsh: Makefile
        pkgsrc/sysutils/accountsservice: Makefile
        pkgsrc/sysutils/amanda-common: Makefile.common
        pkgsrc/sysutils/bcmfw: Makefile
        pkgsrc/sysutils/cdrtools: Makefile
        pkgsrc/sysutils/dbus-sharp: Makefile
        pkgsrc/sysutils/dbus-sharp-glib: Makefile
        pkgsrc/sysutils/dc-tools: Makefile
        pkgsrc/sysutils/e2fsprogs: Makefile
        pkgsrc/sysutils/gkrellm: Makefile
        pkgsrc/sysutils/gkrellm-server: Makefile
        pkgsrc/sysutils/gnometoaster: Makefile
        pkgsrc/sysutils/grub: Makefile
        pkgsrc/sysutils/grub2: Makefile
        pkgsrc/sysutils/k3b: Makefile
        pkgsrc/sysutils/mc46: Makefile
        pkgsrc/sysutils/mcollective: Makefile
        pkgsrc/sysutils/memtestplus: options.mk
        pkgsrc/sysutils/ndesk-dbus: Makefile
        pkgsrc/sysutils/ndesk-dbus-glib: Makefile
        pkgsrc/sysutils/pfstat: Makefile
        pkgsrc/sysutils/polysh: Makefile
        pkgsrc/sysutils/puppet: Makefile
        pkgsrc/sysutils/py-euca2ools: Makefile
        pkgsrc/sysutils/rdiff-backup: Makefile
        pkgsrc/sysutils/rox: Makefile
        pkgsrc/sysutils/su2: Makefile
        pkgsrc/sysutils/xe-guest-utilities: Makefile
        pkgsrc/sysutils/xfe: Makefile
        pkgsrc/textproc/eb: Makefile
        pkgsrc/textproc/fop: Makefile
        pkgsrc/textproc/helpdeco: Makefile
        pkgsrc/textproc/p5-Pod-Spell: Makefile
        pkgsrc/textproc/p5-XML-Bare: Makefile
        pkgsrc/textproc/rfcutil: Makefile
        pkgsrc/textproc/robodoc: Makefile
        pkgsrc/time/hamster-applet: Makefile
        pkgsrc/wm/compiz: Makefile
        pkgsrc/wm/fvwm-devel: Makefile
        pkgsrc/wm/golem: Makefile
        pkgsrc/wm/larswm: Makefile
        pkgsrc/wm/oroborox: Makefile
        pkgsrc/wm/wmii: Makefile
        pkgsrc/wm/xmonad: Makefile
        pkgsrc/wm/xmonad-contrib: options.mk
        pkgsrc/www/SOGo3: Makefile
        pkgsrc/www/SpeedyCGI: Makefile
        pkgsrc/www/album: Makefile
        pkgsrc/www/apache24: Makefile
        pkgsrc/www/aws-demos: Makefile
        pkgsrc/www/bannerfilter: Makefile
        pkgsrc/www/crawl: Makefile
        pkgsrc/www/cvsweb: Makefile
        pkgsrc/www/drraw: Makefile
        pkgsrc/www/drupal8: Makefile
        pkgsrc/www/gallery: Makefile
        pkgsrc/www/gallery2: Makefile
        pkgsrc/www/mediawiki: Makefile
        pkgsrc/www/mono-xsp: Makefile
        pkgsrc/www/moodle: Makefile
        pkgsrc/www/nspluginwrapper: Makefile
        pkgsrc/www/p5-Catalyst-Plugin-Session: Makefile
        pkgsrc/www/p5-libapreq2: Makefile
        pkgsrc/www/privoxy: Makefile
        pkgsrc/www/shibboleth-sp: Makefile
        pkgsrc/www/siege: Makefile
        pkgsrc/www/squidview: Makefile
        pkgsrc/www/swiggle: Makefile
        pkgsrc/www/thttpd: Makefile
        pkgsrc/www/viewvc: Makefile
        pkgsrc/www/w3c-httpd: Makefile
        pkgsrc/www/w3m: Makefile.common
        pkgsrc/www/wdg-validate: Makefile
        pkgsrc/www/wordpress: Makefile
        pkgsrc/x11/XaoS: Makefile
        pkgsrc/x11/Xbae: Makefile
        pkgsrc/x11/avant-window-navigator: Makefile
        pkgsrc/x11/gdm: Makefile
        pkgsrc/x11/gnome-desktop-sharp: Makefile
        pkgsrc/x11/gnome-sharp: Makefile
        pkgsrc/x11/gtk-sharp: Makefile
        pkgsrc/x11/gtkada: Makefile
        pkgsrc/x11/hyena: Makefile
        pkgsrc/x11/kde-runtime4: Makefile
        pkgsrc/x11/kde-workspace4: Makefile
        pkgsrc/x11/lxsession: Makefile
        pkgsrc/x11/ocaml-graphics: Makefile
        pkgsrc/x11/p5-Tk: Makefile
        pkgsrc/x11/pixman: Makefile
        pkgsrc/x11/py-qt5: Makefile
        pkgsrc/x11/rox-session: Makefile
        pkgsrc/x11/rox-wallpaper: Makefile
        pkgsrc/x11/xf86-input-joystick: Makefile
        pkgsrc/x11/xfstt: Makefile
        pkgsrc/x11/xorg-cf-files: Makefile
        pkgsrc/x11/xosd: Makefile.common

Log Message:
*: Move SUBST_STAGE from post-patch to pre-configure

Performing substitutions during post-patch breaks tools such as mkpatches,
making it very difficult to regenerate correct patches after making changes,
and often leading to substituted string replacements being committed.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 pkgsrc/archivers/dar/Makefile
cvs rdiff -u -r1.26 -r1.27 pkgsrc/archivers/freeze/Makefile
cvs rdiff -u -r1.65 -r1.66 pkgsrc/archivers/p7zip/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/archivers/rox-archive/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/archivers/sarab/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/archivers/zutils/Makefile
cvs rdiff -u -r1.179 -r1.180 pkgsrc/audio/amarok/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/audio/daapd/Makefile
cvs rdiff -u -r1.85 -r1.86 pkgsrc/audio/esound/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/audio/gramofile/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/audio/juke/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/audio/liblo/Makefile
cvs rdiff -u -r1.26 -r1.27 pkgsrc/audio/libvisual/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/audio/moss/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/audio/mt-daapd/Makefile
cvs rdiff -u -r1.59 -r1.60 pkgsrc/audio/muse/Makefile
cvs rdiff -u -r1.167 -r1.168 pkgsrc/audio/musicpd/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/audio/tap-plugins/Makefile
cvs rdiff -u -r1.49 -r1.50 pkgsrc/audio/terminatorx/Makefile
cvs rdiff -u -r1.107 -r1.108 pkgsrc/audio/timidity/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/audio/toolame/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/audio/wavesurfer/Makefile
cvs rdiff -u -r1.60 -r1.61 pkgsrc/audio/wsoundserver/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/biology/cdhit/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/biology/htslib/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/biology/ncbi-blast+/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/cad/klayout/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/cad/mex-wcalc/Makefile
cvs rdiff -u -r1.70 -r1.71 pkgsrc/cad/qcad/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/cad/solvespace/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/chat/anope/Makefile
cvs rdiff -u -r1.58 -r1.59 pkgsrc/chat/bitchx/Makefile
cvs rdiff -u -r1.53 -r1.54 pkgsrc/chat/ircd-hybrid/Makefile
cvs rdiff -u -r1.51 -r1.52 pkgsrc/chat/ircservices/Makefile
cvs rdiff -u -r1.121 -r1.122 pkgsrc/chat/jabberd2/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/chat/psybnc/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/chat/quirc/Makefile
cvs rdiff -u -r1.14 -r1.15 pkgsrc/chat/roxirc/Makefile
cvs rdiff -u -r1.68 -r1.69 pkgsrc/chat/silc-server/Makefile
cvs rdiff -u -r1.69 -r1.70 pkgsrc/chat/spectrum/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/chat/telegram-purple/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/chat/tkirc2/Makefile
cvs rdiff -u -r1.52 -r1.53 pkgsrc/chat/unrealircd/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/comms/asterisk/options.mk
cvs rdiff -u -r1.2 -r1.3 pkgsrc/comms/asterisk13/options.mk
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/comms/asterisk14/options.mk
cvs rdiff -u -r1.12 -r1.13 pkgsrc/comms/asterisk18/options.mk
cvs rdiff -u -r1.30 -r1.31 pkgsrc/comms/conserver/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/comms/conserver8/Makefile
cvs rdiff -u -r1.69 -r1.70 pkgsrc/comms/minicom/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/comms/op_panel/Makefile
cvs rdiff -u -r1.57 -r1.58 pkgsrc/comms/p5-pilot-link/Makefile
cvs rdiff -u -r1.39 -r1.40 pkgsrc/cross/avr-gcc/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/cross/cc65/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/cross/nios2-gcc/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/cross/nios2-gcc41/options.mk
cvs rdiff -u -r1.14 -r1.15 pkgsrc/databases/cstore/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/databases/mysqltuner/Makefile
cvs rdiff -u -r1.40 -r1.41 pkgsrc/databases/openldap/Makefile.common
cvs rdiff -u -r1.15 -r1.16 pkgsrc/databases/pgbuildfarm/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/databases/poco-data-mysql/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/devel/ExmanIDE/Makefile
cvs rdiff -u -r1.51 -r1.52 pkgsrc/devel/ProjectCenter/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/adacurses/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/devel/bullet/Makefile
cvs rdiff -u -r1.153 -r1.154 pkgsrc/devel/cpuflags/Makefile
cvs rdiff -u -r1.57 -r1.58 pkgsrc/devel/cscope/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/devel/distcc/Makefile.common
cvs rdiff -u -r1.37 -r1.38 pkgsrc/devel/distccmon-gtk/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/devel/elfsh/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/devel/emacs-ilisp/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/devel/exctags/Makefile
cvs rdiff -u -r1.63 -r1.64 pkgsrc/devel/glib2/Makefile.common
cvs rdiff -u -r1.57 -r1.58 pkgsrc/devel/gnustep-make/Makefile
cvs rdiff -u -r1.26 -r1.27 pkgsrc/devel/gnustep-make/gnustep.mk
cvs rdiff -u -r1.10 -r1.11 pkgsrc/devel/gprbuild-aux/Makefile
cvs rdiff -u -r1.53 -r1.54 pkgsrc/devel/gps/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/devel/grantlee/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/devel/lcov/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/devel/lemon/Makefile
cvs rdiff -u -r1.69 -r1.70 pkgsrc/devel/libgphoto2/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/devel/libmemmgr/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/devel/mico/Makefile
cvs rdiff -u -r1.88 -r1.89 pkgsrc/devel/mono-tools/Makefile
cvs rdiff -u -r1.95 -r1.96 pkgsrc/devel/monodevelop/Makefile
cvs rdiff -u -r1.41 -r1.42 pkgsrc/devel/noweb/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/devel/nsis/Makefile
cvs rdiff -u -r1.153 -r1.154 pkgsrc/devel/nss/Makefile
cvs rdiff -u -r1.69 -r1.70 pkgsrc/devel/pwlib/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/devel/rebar/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/devel/rox-lib/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/devel/rt3/Makefile.install
cvs rdiff -u -r1.37 -r1.38 pkgsrc/devel/slib/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/devel/sloccount/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/devel/tcllib/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/devel/tclreadline/Makefile
cvs rdiff -u -r1.23 -r1.24 pkgsrc/devel/ucl/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/devel/ucpp/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/devel/uno/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/devel/vanessa_logger/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/devel/zookeeper/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/devel/zzuf/Makefile
cvs rdiff -u -r1.118 -r1.119 pkgsrc/editors/TeXmacs/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/editors/lpe/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/editors/rox-edit/Makefile
cvs rdiff -u -r1.86 -r1.87 pkgsrc/editors/tomboy/Makefile
cvs rdiff -u -r1.161 -r1.162 pkgsrc/editors/vim-share/Makefile.common
cvs rdiff -u -r1.44 -r1.45 pkgsrc/emulators/dosbox/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/emulators/dynagen/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/emulators/dynamips/Makefile
cvs rdiff -u -r1.14 -r1.15 pkgsrc/emulators/emulationstation/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/emulators/fceu/Makefile
cvs rdiff -u -r1.59 -r1.60 pkgsrc/emulators/gxemul/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/emulators/pearpc/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/emulators/simulavr/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/emulators/ski/Makefile
cvs rdiff -u -r1.43 -r1.44 pkgsrc/emulators/spim/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/emulators/tuxnes/Makefile
cvs rdiff -u -r1.30 -r1.31 pkgsrc/emulators/xbeeb/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/emulators/xbeeb/options.mk
cvs rdiff -u -r1.13 -r1.14 pkgsrc/filesystems/fuse-afpfs-ng/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/filesystems/fuse-gmailfs/Makefile
cvs rdiff -u -r1.39 -r1.40 pkgsrc/filesystems/fuse-svnfs/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/filesystems/fuse-wikipediafs/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/finance/tclticker/Makefile
cvs rdiff -u -r1.51 -r1.52 pkgsrc/fonts/t1lib/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/games/0verkill/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/games/blindmine/Makefile
cvs rdiff -u -r1.61 -r1.62 pkgsrc/games/bzflag/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/games/crossfire-client/Makefile.common
cvs rdiff -u -r1.18 -r1.19 pkgsrc/games/et/Makefile
cvs rdiff -u -r1.45 -r1.46 pkgsrc/games/falcons-eye/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/games/fillets-ng/Makefile
cvs rdiff -u -r1.51 -r1.52 pkgsrc/games/freeciv-share/Makefile.common
cvs rdiff -u -r1.163 -r1.164 pkgsrc/games/gnome-games/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/games/libkdegames/Makefile
cvs rdiff -u -r1.57 -r1.58 pkgsrc/games/pioneers/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/games/powermanga/Makefile
cvs rdiff -u -r1.36 -r1.37 pkgsrc/games/prboom/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/games/prboom-plus/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/games/pysolfc/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/games/quake2forge/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/games/quakeforge/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/games/tyrquake/Makefile
cvs rdiff -u -r1.26 -r1.27 pkgsrc/games/xrick/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/geography/kplex/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/graphics/asymptote/Makefile
cvs rdiff -u -r1.32 -r1.33 pkgsrc/graphics/aview/Makefile
cvs rdiff -u -r1.105 -r1.106 pkgsrc/graphics/camlimages/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/graphics/colord/Makefile
cvs rdiff -u -r1.37 -r1.38 pkgsrc/graphics/djview4/Makefile
cvs rdiff -u -r1.90 -r1.91 pkgsrc/graphics/f-spot/Makefile
cvs rdiff -u -r1.74 -r1.75 pkgsrc/graphics/imlib2/Makefile
cvs rdiff -u -r1.217 -r1.218 pkgsrc/graphics/netpbm/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/graphics/py-qrcode/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/graphics/tkpiechart/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/ham/chirp/Makefile
cvs rdiff -u -r1.102 -r1.103 pkgsrc/ham/fldigi/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/ham/gnuradio-core/Makefile.common
cvs rdiff -u -r1.31 -r1.32 pkgsrc/ham/trustedQSL/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/inputmethod/canna-canuum/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/lang/ccsh/Makefile
cvs rdiff -u -r1.23 -r1.24 pkgsrc/lang/ecl/Makefile
cvs rdiff -u -r1.85 -r1.86 pkgsrc/lang/erlang/Makefile
cvs rdiff -u -r1.56 -r1.57 pkgsrc/lang/ghc/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/lang/mono2/Makefile
cvs rdiff -u -r1.41 -r1.42 pkgsrc/lang/pear/Makefile
cvs rdiff -u -r1.245 -r1.246 pkgsrc/lang/perl5/Makefile
cvs rdiff -u -r1.39 -r1.40 pkgsrc/lang/rust/Makefile
cvs rdiff -u -r1.42 -r1.43 pkgsrc/lang/scheme48/Makefile
cvs rdiff -u -r1.32 -r1.33 pkgsrc/lang/snobol/Makefile
cvs rdiff -u -r1.13 -r1.14 pkgsrc/mail/OSBF-lua/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/mail/akonadi/options.mk
cvs rdiff -u -r1.32 -r1.33 pkgsrc/mail/courier-maildir/Makefile
cvs rdiff -u -r1.50 -r1.51 pkgsrc/mail/courier-mta/Makefile
cvs rdiff -u -r1.13 -r1.14 pkgsrc/mail/dcc/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/mail/deliver/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/mail/dk-milter/Makefile
cvs rdiff -u -r1.92 -r1.93 pkgsrc/mail/dspam/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/mail/elm-me/Makefile
cvs rdiff -u -r1.160 -r1.161 pkgsrc/mail/exim/Makefile
cvs rdiff -u -r1.51 -r1.52 pkgsrc/mail/exim3/Makefile
cvs rdiff -u -r1.32 -r1.33 pkgsrc/mail/gld/Makefile
cvs rdiff -u -r1.23 -r1.24 pkgsrc/mail/gnus/Makefile
cvs rdiff -u -r1.81 -r1.82 pkgsrc/mail/mailman/Makefile
cvs rdiff -u -r1.52 -r1.53 pkgsrc/mail/metamail/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/mail/minimalist/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/mail/mush/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/mail/neomutt/options.mk
cvs rdiff -u -r1.10 -r1.11 pkgsrc/mail/opensmtpd/Makefile
cvs rdiff -u -r1.14 -r1.15 pkgsrc/mail/pfqueue/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mail/pfqueue/options.mk
cvs rdiff -u -r1.302 -r1.303 pkgsrc/mail/postfix/Makefile
cvs rdiff -u -r1.48 -r1.49 pkgsrc/mail/qmail/options.mk
cvs rdiff -u -r1.44 -r1.45 pkgsrc/mail/qmail-run/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/mail/spamd/Makefile
cvs rdiff -u -r1.67 -r1.68 pkgsrc/mail/sympa/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/mail/up-imapproxy/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/math/R-CGIwithR/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/math/R-nloptr/Makefile
cvs rdiff -u -r1.47 -r1.48 pkgsrc/math/qalculate/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/mbone/beacon/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/misc/ansiweather/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/misc/ascii/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/misc/brs/Makefile
cvs rdiff -u -r1.206 -r1.207 pkgsrc/misc/calibre/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/misc/rox-memo/Makefile
cvs rdiff -u -r1.106 -r1.107 pkgsrc/misc/screen/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/misc/send-pr/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/misc/vimpager/Makefile
cvs rdiff -u -r1.49 -r1.50 pkgsrc/misc/zyGrib/Makefile
cvs rdiff -u -r1.104 -r1.105 pkgsrc/multimedia/avidemux/Makefile
cvs rdiff -u -r1.61 -r1.62 pkgsrc/multimedia/dvdrip/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/multimedia/ffmpeg010/Makefile.common
cvs rdiff -u -r1.7 -r1.8 pkgsrc/multimedia/ffmpeg1/Makefile.common
cvs rdiff -u -r1.55 -r1.56 pkgsrc/multimedia/ffmpeg2/Makefile.common
cvs rdiff -u -r1.21 -r1.22 pkgsrc/multimedia/libmp4v2/Makefile
cvs rdiff -u -r1.59 -r1.60 pkgsrc/multimedia/mediatomb/Makefile
cvs rdiff -u -r1.45 -r1.46 pkgsrc/multimedia/mplayer-plugin/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/multimedia/sickbeard/Makefile
cvs rdiff -u -r1.147 -r1.148 pkgsrc/multimedia/xine-lib/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/net/DarwinStreamingServer/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/ORBit/hacks.mk
cvs rdiff -u -r1.15 -r1.16 pkgsrc/net/aget/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/net/aiccu/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/apollo/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/net/arpwatch/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/net/chrony/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/net/coilmq/Makefile
cvs rdiff -u -r1.56 -r1.57 pkgsrc/net/dctc/Makefile
cvs rdiff -u -r1.40 -r1.41 pkgsrc/net/ddclient/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/net/dgd/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/net/ez-ipupdate/Makefile
cvs rdiff -u -r1.46 -r1.47 pkgsrc/net/freeradius2/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/net/hf6to4/Makefile
cvs rdiff -u -r1.52 -r1.53 pkgsrc/net/irrd/Makefile
cvs rdiff -u -r1.13 -r1.14 pkgsrc/net/jftpgw/Makefile
cvs rdiff -u -r1.39 -r1.40 pkgsrc/net/knot/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/net/libnipper/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/net/libquic/Makefile
cvs rdiff -u -r1.23 -r1.24 pkgsrc/net/mono-nat/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/net/monotorrent/Makefile
cvs rdiff -u -r1.68 -r1.69 pkgsrc/net/monsoon/Makefile
cvs rdiff -u -r1.124 -r1.125 pkgsrc/net/mrtg/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/net/nagios-plugin-radius/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/ndiff/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/net/nipper/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/net/ocsinventory-agent/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/net/oinkmaster/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/net/p5-RPC-XML/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/net/pconsole/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/net/poptop/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/net/pptp/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/net/proxytunnel/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/publicfile-run/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/net/py-pcap/Makefile
cvs rdiff -u -r1.31 -r1.32 pkgsrc/net/pygopherd/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/net/rinetd/Makefile
cvs rdiff -u -r1.108 -r1.109 pkgsrc/net/rsync/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/net/ruby-stompserver/Makefile
cvs rdiff -u -r1.268 -r1.269 pkgsrc/net/samba/Makefile
cvs rdiff -u -r1.44 -r1.45 pkgsrc/net/samba4/Makefile
cvs rdiff -u -r1.23 -r1.24 pkgsrc/net/scapy/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/net/sipsak/Makefile
cvs rdiff -u -r1.38 -r1.39 pkgsrc/net/smokeping/Makefile
cvs rdiff -u -r1.58 -r1.59 pkgsrc/net/snort/Makefile
cvs rdiff -u -r1.39 -r1.40 pkgsrc/net/socat/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/sysmon/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/twittering-mode/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/net/ucspi-tcp/options.mk
cvs rdiff -u -r1.42 -r1.43 pkgsrc/net/vpnc/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/vpnc/options.mk
cvs rdiff -u -r1.44 -r1.45 pkgsrc/net/vsftpd/Makefile
cvs rdiff -u -r1.53 -r1.54 pkgsrc/net/xymon/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/zenmap/Makefile
cvs rdiff -u -r1.59 -r1.60 pkgsrc/parallel/ganglia-monitor-core/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/parallel/gridscheduler/Makefile
cvs rdiff -u -r1.65 -r1.66 pkgsrc/parallel/sge/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/parallel/slurm-wlm/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/dfdisk/Makefile
cvs rdiff -u -r1.38 -r1.39 pkgsrc/pkgtools/libkver/Makefile
cvs rdiff -u -r1.81 -r1.82 pkgsrc/pkgtools/pbulk/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/pkgtools/pkg/Makefile
cvs rdiff -u -r1.43 -r1.44 pkgsrc/pkgtools/pkg_filecheck/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/pkgtools/pkg_notify/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/pkgtools/pkgclean/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/pkgtools/pkgfind/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/print/apsfilter/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/print/cups-base/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/print/cups15/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/print/foo2zjs/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/print/indexinfo/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/print/pdfmod/Makefile
cvs rdiff -u -r1.37 -r1.38 pkgsrc/print/py-cups/Makefile
cvs rdiff -u -r1.85 -r1.86 pkgsrc/print/xpdf/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/print/xpdf-korean/Makefile
cvs rdiff -u -r1.42 -r1.43 pkgsrc/security/base/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/security/chkrootkit/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/security/dropbear/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/security/duo-unix/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/security/easy-rsa/Makefile
cvs rdiff -u -r1.88 -r1.89 pkgsrc/security/gpgme/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/security/ike-scan/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/security/libprelude/Makefile.common
cvs rdiff -u -r1.27 -r1.28 pkgsrc/security/nikto/Makefile
cvs rdiff -u -r1.70 -r1.71 pkgsrc/security/opendnssec/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/security/openvas-server/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/security/p5-Crypt-GPG/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/security/p5-pcsc/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/security/pam-tacplus/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/security/password-store/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/security/pcsc-tools/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/security/pks/Makefile
cvs rdiff -u -r1.41 -r1.42 pkgsrc/security/prelude-lml/Makefile
cvs rdiff -u -r1.46 -r1.47 pkgsrc/security/prelude-manager/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/security/prelude-pflogger/Makefile
cvs rdiff -u -r1.47 -r1.48 pkgsrc/security/py-prewikka/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/security/py-requests-kerberos/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/security/qca2/Makefile.common
cvs rdiff -u -r1.23 -r1.24 pkgsrc/security/qca2-gnupg/Makefile
cvs rdiff -u -r1.36 -r1.37 pkgsrc/security/qca2-ossl/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/security/qca2-qt5-gnupg/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/security/qca2-qt5-ossl/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/security/skey/hacks.mk
cvs rdiff -u -r1.25 -r1.26 pkgsrc/security/snortsnarf/Makefile
cvs rdiff -u -r1.38 -r1.39 pkgsrc/security/softhsm/Makefile
cvs rdiff -u -r1.49 -r1.50 pkgsrc/security/uvscan/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/shells/lshell/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/shells/xonsh/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/sysutils/accountsservice/Makefile
cvs rdiff -u -r1.42 -r1.43 pkgsrc/sysutils/amanda-common/Makefile.common
cvs rdiff -u -r1.12 -r1.13 pkgsrc/sysutils/bcmfw/Makefile
cvs rdiff -u -r1.116 -r1.117 pkgsrc/sysutils/cdrtools/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/sysutils/dbus-sharp/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/sysutils/dbus-sharp-glib/Makefile
cvs rdiff -u -r1.14 -r1.15 pkgsrc/sysutils/dc-tools/Makefile
cvs rdiff -u -r1.26 -r1.27 pkgsrc/sysutils/e2fsprogs/Makefile
cvs rdiff -u -r1.92 -r1.93 pkgsrc/sysutils/gkrellm/Makefile
cvs rdiff -u -r1.32 -r1.33 pkgsrc/sysutils/gkrellm-server/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/sysutils/gnometoaster/Makefile
cvs rdiff -u -r1.57 -r1.58 pkgsrc/sysutils/grub/Makefile
cvs rdiff -u -r1.13 -r1.14 pkgsrc/sysutils/grub2/Makefile
cvs rdiff -u -r1.94 -r1.95 pkgsrc/sysutils/k3b/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/sysutils/mc46/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/sysutils/mcollective/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/sysutils/memtestplus/options.mk
cvs rdiff -u -r1.27 -r1.28 pkgsrc/sysutils/ndesk-dbus/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/sysutils/ndesk-dbus-glib/Makefile
cvs rdiff -u -r1.31 -r1.32 pkgsrc/sysutils/pfstat/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/sysutils/polysh/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/sysutils/puppet/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/sysutils/py-euca2ools/Makefile
cvs rdiff -u -r1.53 -r1.54 pkgsrc/sysutils/rdiff-backup/Makefile
cvs rdiff -u -r1.86 -r1.87 pkgsrc/sysutils/rox/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/sysutils/su2/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/sysutils/xe-guest-utilities/Makefile
cvs rdiff -u -r1.50 -r1.51 pkgsrc/sysutils/xfe/Makefile
cvs rdiff -u -r1.54 -r1.55 pkgsrc/textproc/eb/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/textproc/fop/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/textproc/helpdeco/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/textproc/p5-Pod-Spell/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/textproc/p5-XML-Bare/Makefile
cvs rdiff -u -r1.29 -r1.30 pkgsrc/textproc/rfcutil/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/textproc/robodoc/Makefile
cvs rdiff -u -r1.57 -r1.58 pkgsrc/time/hamster-applet/Makefile
cvs rdiff -u -r1.105 -r1.106 pkgsrc/wm/compiz/Makefile
cvs rdiff -u -r1.52 -r1.53 pkgsrc/wm/fvwm-devel/Makefile
cvs rdiff -u -r1.32 -r1.33 pkgsrc/wm/golem/Makefile
cvs rdiff -u -r1.19 -r1.20 pkgsrc/wm/larswm/Makefile
cvs rdiff -u -r1.53 -r1.54 pkgsrc/wm/oroborox/Makefile
cvs rdiff -u -r1.34 -r1.35 pkgsrc/wm/wmii/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/wm/xmonad/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/wm/xmonad-contrib/options.mk
cvs rdiff -u -r1.10 -r1.11 pkgsrc/www/SOGo3/Makefile
cvs rdiff -u -r1.23 -r1.24 pkgsrc/www/SpeedyCGI/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/www/album/Makefile
cvs rdiff -u -r1.68 -r1.69 pkgsrc/www/apache24/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/www/aws-demos/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/www/bannerfilter/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/www/crawl/Makefile
cvs rdiff -u -r1.46 -r1.47 pkgsrc/www/cvsweb/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/www/drraw/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/www/drupal8/Makefile
cvs rdiff -u -r1.14 -r1.15 pkgsrc/www/gallery/Makefile
cvs rdiff -u -r1.15 -r1.16 pkgsrc/www/gallery2/Makefile
cvs rdiff -u -r1.70 -r1.71 pkgsrc/www/mediawiki/Makefile
cvs rdiff -u -r1.43 -r1.44 pkgsrc/www/mono-xsp/Makefile
cvs rdiff -u -r1.63 -r1.64 pkgsrc/www/moodle/Makefile
cvs rdiff -u -r1.62 -r1.63 pkgsrc/www/nspluginwrapper/Makefile
cvs rdiff -u -r1.30 -r1.31 pkgsrc/www/p5-Catalyst-Plugin-Session/Makefile
cvs rdiff -u -r1.40 -r1.41 pkgsrc/www/p5-libapreq2/Makefile
cvs rdiff -u -r1.60 -r1.61 pkgsrc/www/privoxy/Makefile
cvs rdiff -u -r1.26 -r1.27 pkgsrc/www/shibboleth-sp/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/www/siege/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/www/squidview/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/www/swiggle/Makefile
cvs rdiff -u -r1.48 -r1.49 pkgsrc/www/thttpd/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/www/viewvc/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/www/w3c-httpd/Makefile
cvs rdiff -u -r1.66 -r1.67 pkgsrc/www/w3m/Makefile.common
cvs rdiff -u -r1.28 -r1.29 pkgsrc/www/wdg-validate/Makefile
cvs rdiff -u -r1.78 -r1.79 pkgsrc/www/wordpress/Makefile
cvs rdiff -u -r1.38 -r1.39 pkgsrc/x11/XaoS/Makefile
cvs rdiff -u -r1.30 -r1.31 pkgsrc/x11/Xbae/Makefile
cvs rdiff -u -r1.42 -r1.43 pkgsrc/x11/avant-window-navigator/Makefile
cvs rdiff -u -r1.189 -r1.190 pkgsrc/x11/gdm/Makefile
cvs rdiff -u -r1.78 -r1.79 pkgsrc/x11/gnome-desktop-sharp/Makefile
cvs rdiff -u -r1.73 -r1.74 pkgsrc/x11/gnome-sharp/Makefile
cvs rdiff -u -r1.65 -r1.66 pkgsrc/x11/gtk-sharp/Makefile
cvs rdiff -u -r1.42 -r1.43 pkgsrc/x11/gtkada/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/x11/hyena/Makefile
cvs rdiff -u -r1.87 -r1.88 pkgsrc/x11/kde-runtime4/Makefile
cvs rdiff -u -r1.69 -r1.70 pkgsrc/x11/kde-workspace4/Makefile
cvs rdiff -u -r1.18 -r1.19 pkgsrc/x11/lxsession/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/x11/ocaml-graphics/Makefile
cvs rdiff -u -r1.91 -r1.92 pkgsrc/x11/p5-Tk/Makefile
cvs rdiff -u -r1.65 -r1.66 pkgsrc/x11/pixman/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/x11/py-qt5/Makefile
cvs rdiff -u -r1.53 -r1.54 pkgsrc/x11/rox-session/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/x11/rox-wallpaper/Makefile
cvs rdiff -u -r1.8 -r1.9 pkgsrc/x11/xf86-input-joystick/Makefile
cvs rdiff -u -r1.42 -r1.43 pkgsrc/x11/xfstt/Makefile
cvs rdiff -u -r1.35 -r1.36 pkgsrc/x11/xorg-cf-files/Makefile
cvs rdiff -u -r1.28 -r1.29 pkgsrc/x11/xosd/Makefile.common

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/archivers/dar/Makefile
diff -u pkgsrc/archivers/dar/Makefile:1.53 pkgsrc/archivers/dar/Makefile:1.54
--- pkgsrc/archivers/dar/Makefile:1.53  Fri Jan 26 13:38:17 2018
+++ pkgsrc/archivers/dar/Makefile       Wed Jul  4 13:40:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2018/01/26 13:38:17 jperkin Exp $
+# $NetBSD: Makefile,v 1.54 2018/07/04 13:40:07 jperkin Exp $
 
 DISTNAME=      dar-2.4.13
 PKGREVISION=   1
@@ -96,7 +96,7 @@ CPPFLAGS.SunOS+=      -D__EXTENSIONS__
 ## Build a static binary with threads is currently broken with glibc.
 .if ${OPSYS} == "Linux" && !empty(PKG_OPTIONS:Mthreads)
 SUBST_CLASSES+=                static
-SUBST_STAGE.static=    post-patch
+SUBST_STAGE.static=    pre-configure
 SUBST_MESSAGE.static=  Changing -all-static to -static
 SUBST_FILES.static=    src/testing/Makefile.in
 SUBST_SED.static=      -e 's,-all-static,-static,g'

Index: pkgsrc/archivers/freeze/Makefile
diff -u pkgsrc/archivers/freeze/Makefile:1.26 pkgsrc/archivers/freeze/Makefile:1.27
--- pkgsrc/archivers/freeze/Makefile:1.26       Thu Oct  9 14:05:51 2014
+++ pkgsrc/archivers/freeze/Makefile    Wed Jul  4 13:40:07 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2014/10/09 14:05:51 wiz Exp $
+# $NetBSD: Makefile,v 1.27 2018/07/04 13:40:07 jperkin Exp $
 
 DISTNAME=      freeze-2.5
 PKGREVISION=   3
@@ -19,7 +19,7 @@ CFLAGS+=      -DCOMPAT=1
 INSTALLATION_DIRS=     bin ${PKGMANDIR}/man1
 
 SUBST_CLASSES+=                freeze
-SUBST_STAGE.freeze=    post-patch
+SUBST_STAGE.freeze=    pre-configure
 SUBST_FILES.freeze=    *.1
 SUBST_SED.freeze=      -e 's|@PREFIX@|${PREFIX}|g'
 

Index: pkgsrc/archivers/p7zip/Makefile
diff -u pkgsrc/archivers/p7zip/Makefile:1.65 pkgsrc/archivers/p7zip/Makefile:1.66
--- pkgsrc/archivers/p7zip/Makefile:1.65        Wed Mar 21 18:47:02 2018
+++ pkgsrc/archivers/p7zip/Makefile     Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.65 2018/03/21 18:47:02 kamil Exp $
+# $NetBSD: Makefile,v 1.66 2018/07/04 13:40:08 jperkin Exp $
 
 DISTNAME=      p7zip_16.02_src_all
 PKGNAME=       ${DISTNAME:S/_src_all//S/_/-/}
@@ -33,7 +33,7 @@ INSTALLATION_DIRS+=   share/doc/p7zip/swit
 SUBST_CLASSES+=                lib
 SUBST_FILES.lib+=      CPP/7zip/UI/Common/LoadCodecs.cpp
 SUBST_SED.lib+=                -e "s,getenv(.P7ZIP_HOME_DIR.),\"${PREFIX}/lib/\","
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 
 .include "../../mk/dlopen.buildlink3.mk"
 BUILDLINK_TRANSFORM+=  opt:-ldl:${BUILDLINK_LDADD.dl:Q}

Index: pkgsrc/archivers/rox-archive/Makefile
diff -u pkgsrc/archivers/rox-archive/Makefile:1.11 pkgsrc/archivers/rox-archive/Makefile:1.12
--- pkgsrc/archivers/rox-archive/Makefile:1.11  Sat May 17 16:10:41 2014
+++ pkgsrc/archivers/rox-archive/Makefile       Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2014/05/17 16:10:41 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:08 jperkin Exp $
 #
 
 DISTNAME=      archive-2.0
@@ -28,7 +28,7 @@ INSTALLATION_DIRS=    share/rox/Archive
 
 SUBST_CLASSES+=                lib
 SUBST_MESSAGE.lib=     Fixing hardcoded paths for ROX-Lib.
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 SUBST_FILES.lib=       findrox.py
 SUBST_SED.lib=         -e 's,/usr/local/lib,${PREFIX}/share/rox,g'
 

Index: pkgsrc/archivers/sarab/Makefile
diff -u pkgsrc/archivers/sarab/Makefile:1.7 pkgsrc/archivers/sarab/Makefile:1.8
--- pkgsrc/archivers/sarab/Makefile:1.7 Sat May 14 21:06:11 2016
+++ pkgsrc/archivers/sarab/Makefile     Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2016/05/14 21:06:11 mef Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:08 jperkin Exp $
 
 DISTNAME=      sarab-1.0.0
 CATEGORIES=    archivers
@@ -25,20 +25,20 @@ CONF_FILES+= ${EGDIR}/sarab.conf    ${PKG_S
 CONF_FILES+= ${EGDIR}/sarab.dcf        ${PKG_SYSCONFDIR}/sarab.dcf
 
 SUBST_CLASSES+=                dar
-SUBST_STAGE.dar=       post-patch
+SUBST_STAGE.dar=       pre-configure
 SUBST_MESSAGE.dar=     Fix path to DAR utilities
 SUBST_FILES.dar=       etc/sarab.conf
 SUBST_SED.dar=         -e "s|/usr/local/bin/dar|${PREFIX}/bin/dar|"
 
 # archivers/dar disables building "dar_static"
 SUBST_CLASSES+=                nocopy
-SUBST_STAGE.nocopy=    post-patch
+SUBST_STAGE.nocopy=    pre-configure
 SUBST_MESSAGE.nocopy=  Do not copy dar_static
 SUBST_FILES.nocopy=    etc/sarab.conf
 SUBST_SED.nocopy=      -e "s|COPY_DAR=\"yes\"|COPY_DAR=\"no\"|"
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_MESSAGE.conf=    Fix path to SaraB configuration files
 SUBST_FILES.conf=      sarab.sh etc/sarab.conf
 SUBST_SED.conf=                -e "s|/etc/sarab|${PKG_SYSCONFDIR}|"
@@ -46,7 +46,7 @@ SUBST_SED.conf=               -e "s|/etc/sarab|${PKG_
 # NetBSD has /kern, and does not have /sys.  Other platforms might
 # differ.
 SUBST_CLASSES+=                prune
-SUBST_STAGE.prune=     post-patch
+SUBST_STAGE.prune=     pre-configure
 SUBST_MESSAGE.prune=   Prune /kern instead of /sys
 SUBST_FILES.prune=     etc/sarab.dcf
 SUBST_SED.prune=       -e "s|--prune sys|--prune kern|"

Index: pkgsrc/archivers/zutils/Makefile
diff -u pkgsrc/archivers/zutils/Makefile:1.8 pkgsrc/archivers/zutils/Makefile:1.9
--- pkgsrc/archivers/zutils/Makefile:1.8        Sun Apr  9 11:39:19 2017
+++ pkgsrc/archivers/zutils/Makefile    Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2017/04/09 11:39:19 mef Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:08 jperkin Exp $
 #
 
 DISTNAME=      zutils-1.6
@@ -26,7 +26,7 @@ EGDIR=                        ${PREFIX}/share/examples/zutils
 CONF_FILES=            ${EGDIR}/zutilsrc ${PREFIX}/etc/zutilsrc
 
 SUBST_CLASSES+=                sysconfdir
-SUBST_STAGE.sysconfdir=        post-patch
+SUBST_STAGE.sysconfdir=        pre-configure
 SUBST_FILES.sysconfdir= zutilsrc
 SUBST_MESSAGE.sysconfdir= path of sysconfdir in example (zutilsrc)
 SUBST_SED.sysconfdir=  -e '/sysconfdir/s,$${sysconfdir},${PREFIX}/etc,'

Index: pkgsrc/audio/amarok/Makefile
diff -u pkgsrc/audio/amarok/Makefile:1.179 pkgsrc/audio/amarok/Makefile:1.180
--- pkgsrc/audio/amarok/Makefile:1.179  Sun Apr 29 21:31:25 2018
+++ pkgsrc/audio/amarok/Makefile        Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.179 2018/04/29 21:31:25 adam Exp $
+# $NetBSD: Makefile,v 1.180 2018/07/04 13:40:08 jperkin Exp $
 
 DISTNAME=      amarok-${VERS}
 VERS=          2.8.0
@@ -30,7 +30,7 @@ CMAKE_ARGS+=  -DKDE4_BUILD_TESTS:BOOL=OFF
 REPLACE_PERL+= src/kconf_update/amarok-2.4.1-tokens_syntax_update.pl
 
 SUBST_CLASSES+=                mysql
-SUBST_STAGE.mysql=     post-patch
+SUBST_STAGE.mysql=     pre-configure
 SUBST_MESSAGE.mysql=   Fixup paths for MySQL embedded
 SUBST_FILES.mysql=     cmake/modules/FindMySQLAmarok.cmake
 SUBST_FILES.mysql+=    src/core-impl/collections/db/sql/mysqlecollection/CMakeLists.txt

Index: pkgsrc/audio/daapd/Makefile
diff -u pkgsrc/audio/daapd/Makefile:1.28 pkgsrc/audio/daapd/Makefile:1.29
--- pkgsrc/audio/daapd/Makefile:1.28    Wed Apr 20 12:10:25 2016
+++ pkgsrc/audio/daapd/Makefile Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2016/04/20 12:10:25 nros Exp $
+# $NetBSD: Makefile,v 1.29 2018/07/04 13:40:08 jperkin Exp $
 
 DISTNAME=              daapd-0.2.4b
 PKGREVISION=           1
@@ -30,7 +30,7 @@ FILES_SUBST+=         PKG_SYSCONFDIR=${PKG_SYSC
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     daapd.8 daapd.cc
 SUBST_SED.paths=       -e 's,/etc/,${PKG_SYSCONFDIR}/,g'
 

Index: pkgsrc/audio/esound/Makefile
diff -u pkgsrc/audio/esound/Makefile:1.85 pkgsrc/audio/esound/Makefile:1.86
--- pkgsrc/audio/esound/Makefile:1.85   Sun Sep  3 08:36:49 2017
+++ pkgsrc/audio/esound/Makefile        Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.85 2017/09/03 08:36:49 wiz Exp $
+# $NetBSD: Makefile,v 1.86 2018/07/04 13:40:08 jperkin Exp $
 
 DISTNAME=              esound-0.2.41
 PKGREVISION=           3
@@ -32,7 +32,7 @@ CONFIGURE_ARGS+=      --disable-local-sound
 .include "../../mk/oss.buildlink3.mk"
 MAKE_ENV+=             AM_CPPFLAGS='-DDEV_DSP=\"${DEVOSSAUDIO}\"'
 SUBST_CLASSES+=                oss
-SUBST_STAGE.oss=       post-patch
+SUBST_STAGE.oss=       pre-configure
 SUBST_FILES.oss=       configure
 SUBST_SED.oss=         -e 's,-lossaudio,${LIBOSSAUDIO},g'
 SUBST_MESSAGE.oss=     Fixing oss.

Index: pkgsrc/audio/gramofile/Makefile
diff -u pkgsrc/audio/gramofile/Makefile:1.19 pkgsrc/audio/gramofile/Makefile:1.20
--- pkgsrc/audio/gramofile/Makefile:1.19        Wed Apr 20 12:10:26 2016
+++ pkgsrc/audio/gramofile/Makefile     Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2016/04/20 12:10:26 nros Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:08 jperkin Exp $
 #
 
 DISTNAME=      gramofile-1.6
@@ -25,7 +25,7 @@ do-install:
        cd ${DESTDIR}${PREFIX}/bin && ${LN} -s bplay_gramo brec_gramo
 
 SUBST_CLASSES+=                snd
-SUBST_STAGE.snd=       post-patch
+SUBST_STAGE.snd=       pre-configure
 SUBST_FILES.snd=       bplaysrc/sndfunc.c
 SUBST_SED.snd=         -e "s,/dev/dsp,${DEVOSSAUDIO},g"
 SUBST_MESSAGE.snd=     Fixing harcoded audio device.

Index: pkgsrc/audio/juke/Makefile
diff -u pkgsrc/audio/juke/Makefile:1.18 pkgsrc/audio/juke/Makefile:1.19
--- pkgsrc/audio/juke/Makefile:1.18     Wed Jan  4 16:50:31 2017
+++ pkgsrc/audio/juke/Makefile  Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2017/01/04 16:50:31 roy Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:08 jperkin Exp $
 #
 
 DISTNAME=      juke-0.7
@@ -20,7 +20,7 @@ CONF_FILES=   ${EGDIR}/juke.conf.default $
 
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     doc/juke.1 MANUAL src/conf.c
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_SED.paths=       -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},'
 
 INSTALLATION_DIRS=     ${EGDIR} share/doc/juke

Index: pkgsrc/audio/liblo/Makefile
diff -u pkgsrc/audio/liblo/Makefile:1.2 pkgsrc/audio/liblo/Makefile:1.3
--- pkgsrc/audio/liblo/Makefile:1.2     Thu Sep 15 13:56:58 2016
+++ pkgsrc/audio/liblo/Makefile Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2016/09/15 13:56:58 wiedi Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:08 jperkin Exp $
 #
 
 DISTNAME=      liblo-0.28
@@ -24,7 +24,7 @@ SUBST_CLASSES+=               conf
 SUBST_FILES.conf=      configure Makefile.in src/Makefile.in liblo.pc.in
 SUBST_MESSAGE.conf=    Performing build-time configuration substitutions.
 SUBST_SED.conf=                -e 's,-lpthread,$${PTHREAD_LDFLAGS} $${PTHREAD_LIBS},'
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_VARS.conf=       PTHREAD_CFLAGS PTHREAD_LDFLAGS PTHREAD_LIBS
 
 LDFLAGS.SunOS+=                -lsocket -lnsl

Index: pkgsrc/audio/libvisual/Makefile
diff -u pkgsrc/audio/libvisual/Makefile:1.26 pkgsrc/audio/libvisual/Makefile:1.27
--- pkgsrc/audio/libvisual/Makefile:1.26        Wed Apr 20 12:10:28 2016
+++ pkgsrc/audio/libvisual/Makefile     Wed Jul  4 13:40:08 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2016/04/20 12:10:28 nros Exp $
+# $NetBSD: Makefile,v 1.27 2018/07/04 13:40:08 jperkin Exp $
 #
 
 DISTNAME=      libvisual-0.4.0
@@ -26,7 +26,7 @@ RT_LIB_SCHED=         # empty
 .endif
 MAKE_ENV+=             RT_LIB_SCHED=${RT_LIB_SCHED}
 SUBST_CLASSES+=        rtlib
-SUBST_STAGE.rtlib=     post-patch
+SUBST_STAGE.rtlib=     pre-configure
 SUBST_FILES.rtlib=     libvisual.pc.in
 SUBST_VARS.rtlib=      RT_LIB_SCHED
 

Index: pkgsrc/audio/moss/Makefile
diff -u pkgsrc/audio/moss/Makefile:1.29 pkgsrc/audio/moss/Makefile:1.30
--- pkgsrc/audio/moss/Makefile:1.29     Tue Jul  3 05:03:02 2018
+++ pkgsrc/audio/moss/Makefile  Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2018/07/03 05:03:02 adam Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=      moss-0.1.13
 PKGREVISION=   6
@@ -23,7 +23,7 @@ CONF_FILES=   ${PREFIX}/share/moss/moss.co
 
 SUBST_CLASSES+=                path
 SUBST_MESSAGE.path=    Fixing hardcoded paths.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      moss.conf.sample
 SUBST_SED.path=                -e 's,$${PREFIX}/var,${VARBASE},g'
 SUBST_SED.path+=       -e 's,$${PREFIX}/share,${PREFIX}/share,g'

Index: pkgsrc/audio/mt-daapd/Makefile
diff -u pkgsrc/audio/mt-daapd/Makefile:1.18 pkgsrc/audio/mt-daapd/Makefile:1.19
--- pkgsrc/audio/mt-daapd/Makefile:1.18 Sun Jan 28 20:10:42 2018
+++ pkgsrc/audio/mt-daapd/Makefile      Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2018/01/28 20:10:42 wiz Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=      mt-daapd-0.2.4.2
 PKGREVISION=   5
@@ -39,7 +39,7 @@ OWN_DIRS_PERMS=               ${VARBASE}/cache/mt-daa
 .include "options.mk"
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      contrib/mt-daapd.conf
 SUBST_SED.conf=                -e "s,@PREFIX@,${PREFIX},"
 SUBST_SED.conf+=       -e "s,@VARBASE@,${VARBASE},g"
@@ -48,7 +48,7 @@ SUBST_SED.conf+=      -e "s,@MTDAAPD_USER@,${
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     src/main.c
 SUBST_SED.paths=       -e "s,/etc,${PKG_SYSCONFDIR},"
 SUBST_SED.paths+=      -e "s,/var,${VARBASE},"

Index: pkgsrc/audio/muse/Makefile
diff -u pkgsrc/audio/muse/Makefile:1.59 pkgsrc/audio/muse/Makefile:1.60
--- pkgsrc/audio/muse/Makefile:1.59     Mon Apr 16 14:34:07 2018
+++ pkgsrc/audio/muse/Makefile  Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.59 2018/04/16 14:34:07 wiz Exp $
+# $NetBSD: Makefile,v 1.60 2018/07/04 13:40:09 jperkin Exp $
 #
 
 DISTNAME=      MuSE-0.9
@@ -28,7 +28,7 @@ MAKE_FLAGS+=          docsdir=${PREFIX:Q}/share/
 LIBS.SunOS+=           -lsocket -lnsl
 
 SUBST_CLASSES+=                dsp
-SUBST_STAGE.dsp=       post-patch
+SUBST_STAGE.dsp=       pre-configure
 SUBST_FILES.dsp=       src/jmixer.cpp src/libmpeg/fileplayer.cc
 SUBST_SED.dsp=         -e "s,/dev/dsp,${DEVOSSAUDIO},g"
 SUBST_MESSAGE.dsp=     Fixing hardcoded audio device.

Index: pkgsrc/audio/musicpd/Makefile
diff -u pkgsrc/audio/musicpd/Makefile:1.167 pkgsrc/audio/musicpd/Makefile:1.168
--- pkgsrc/audio/musicpd/Makefile:1.167 Sun May 27 09:56:11 2018
+++ pkgsrc/audio/musicpd/Makefile       Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.167 2018/05/27 09:56:11 wiz Exp $
+# $NetBSD: Makefile,v 1.168 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=              mpd-0.20.20
 PKGNAME=               ${DISTNAME:S/mpd/musicpd/}
@@ -36,7 +36,7 @@ RCD_SCRIPTS=          mpd
 FILES_SUBST+=          DEVOSSAUDIO=${DEVOSSAUDIO:Q}
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     mpd.conf
 SUBST_SED.paths=       -e 's,@DEVOSSAUDIO@,${DEVOSSAUDIO},'
 

Index: pkgsrc/audio/tap-plugins/Makefile
diff -u pkgsrc/audio/tap-plugins/Makefile:1.8 pkgsrc/audio/tap-plugins/Makefile:1.9
--- pkgsrc/audio/tap-plugins/Makefile:1.8       Sat Sep 16 19:26:42 2017
+++ pkgsrc/audio/tap-plugins/Makefile   Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2017/09/16 19:26:42 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:09 jperkin Exp $
 #
 
 DISTNAME=      tap-plugins-0.7.2
@@ -13,7 +13,7 @@ LICENSE=      gnu-gpl-v2
 USE_GCC_RUNTIME=       yes
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_MESSAGE.prefix=  Fixing PREFIX.
 SUBST_FILES.prefix=    Makefile
 SUBST_SED.prefix=      -e 's|/usr/local|${DESTDIR}${PREFIX}|'

Index: pkgsrc/audio/terminatorx/Makefile
diff -u pkgsrc/audio/terminatorx/Makefile:1.49 pkgsrc/audio/terminatorx/Makefile:1.50
--- pkgsrc/audio/terminatorx/Makefile:1.49      Mon Apr 16 14:34:10 2018
+++ pkgsrc/audio/terminatorx/Makefile   Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.49 2018/04/16 14:34:10 wiz Exp $
+# $NetBSD: Makefile,v 1.50 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=      terminatorX-3.82
 PKGNAME=       ${DISTNAME:S/X/x/}
@@ -25,7 +25,7 @@ LIBS+=                        ${LIBOSSAUDIO}
 CONFIGURE_ARGS+=       --disable-alsa
 
 SUBST_CLASSES+=                oss
-SUBST_STAGE.oss=       post-patch
+SUBST_STAGE.oss=       pre-configure
 SUBST_FILES.oss=       src/tX_global.c
 SUBST_SED.oss=         -e "s,/dev/dsp,${DEVOSSAUDIO},g"
 SUBST_MESSAGE.oss=     Fixing hardcoded audio device.

Index: pkgsrc/audio/timidity/Makefile
diff -u pkgsrc/audio/timidity/Makefile:1.107 pkgsrc/audio/timidity/Makefile:1.108
--- pkgsrc/audio/timidity/Makefile:1.107        Mon Apr 16 14:34:10 2018
+++ pkgsrc/audio/timidity/Makefile      Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.107 2018/04/16 14:34:10 wiz Exp $
+# $NetBSD: Makefile,v 1.108 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=      TiMidity++-2.14.0
 PKGNAME=       ${DISTNAME:S/TiMidity++/timidity/}
@@ -33,7 +33,7 @@ CONFIGURE_ARGS.Linux+=        --enable-alsaseq
 
 SUBST_CLASSES+=                confdir
 SUBST_MESSAGE.confdir= Configuring to use PKG_SYSCONFDIR.
-SUBST_STAGE.confdir=   post-patch
+SUBST_STAGE.confdir=   pre-configure
 SUBST_FILES.confdir=   doc/C/timidity.cfg.5 doc/ja_JP.eucJP/timidity.cfg.5
 SUBST_SED.confdir=     -e 's,/usr/local/share/timidity,${PKG_SYSCONFDIR},g'
 

Index: pkgsrc/audio/toolame/Makefile
diff -u pkgsrc/audio/toolame/Makefile:1.22 pkgsrc/audio/toolame/Makefile:1.23
--- pkgsrc/audio/toolame/Makefile:1.22  Wed Sep  6 09:03:00 2017
+++ pkgsrc/audio/toolame/Makefile       Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2017/09/06 09:03:00 wiz Exp $
+# $NetBSD: Makefile,v 1.23 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=      toolame-02l
 PKGREVISION=   4
@@ -25,7 +25,7 @@ INSTALLATION_DIRS=    bin share/doc/toolame
 .if !empty(PKGSRC_COMPILER:Msunpro)
 SUBST_CLASSES+=                inline
 SUBST_MESSAGE.inline=  Disable inline on Sun Studio
-SUBST_STAGE.inline=    post-patch
+SUBST_STAGE.inline=    pre-configure
 SUBST_FILES.inline=    Makefile
 SUBST_SED.inline=      -e 's,INLINE=inline,INLINE=,'
 .endif

Index: pkgsrc/audio/wavesurfer/Makefile
diff -u pkgsrc/audio/wavesurfer/Makefile:1.19 pkgsrc/audio/wavesurfer/Makefile:1.20
--- pkgsrc/audio/wavesurfer/Makefile:1.19       Wed Apr 20 12:10:33 2016
+++ pkgsrc/audio/wavesurfer/Makefile    Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2016/04/20 12:10:33 nros Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=      wavesurfer-1.8.5
 CATEGORIES=    audio
@@ -20,7 +20,7 @@ USE_LANGUAGES=        # empty
 
 SUBST_CLASSES+=                wish
 SUBST_MESSAGE.wish=    Fixing hardcoded command names.
-SUBST_STAGE.wish=      post-patch
+SUBST_STAGE.wish=      pre-configure
 SUBST_FILES.wish=      wavesurfer.tcl
 SUBST_SED.wish=                -e 's,wish8.4,wish,g'
 

Index: pkgsrc/audio/wsoundserver/Makefile
diff -u pkgsrc/audio/wsoundserver/Makefile:1.60 pkgsrc/audio/wsoundserver/Makefile:1.61
--- pkgsrc/audio/wsoundserver/Makefile:1.60     Mon Mar 12 11:15:25 2018
+++ pkgsrc/audio/wsoundserver/Makefile  Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.60 2018/03/12 11:15:25 wiz Exp $
+# $NetBSD: Makefile,v 1.61 2018/07/04 13:40:09 jperkin Exp $
 #
 
 DISTNAME=      WSoundServer-0.4.0
@@ -24,7 +24,7 @@ EGDIR=                        ${PREFIX}/share/examples/wsound
 CONF_FILES=            ${EGDIR:Q}/WMSound ${PKG_SYSCONFDIR:Q}/WMSound
 
 SUBST_CLASSES+=                1x
-SUBST_STAGE.1x=                post-patch
+SUBST_STAGE.1x=                pre-configure
 SUBST_MESSAGE.1x=      Changing the man page category from 1x to 1.
 SUBST_FILES.1x=                doc/*
 SUBST_SED.1x=          -e s,1x,1,g

Index: pkgsrc/biology/cdhit/Makefile
diff -u pkgsrc/biology/cdhit/Makefile:1.2 pkgsrc/biology/cdhit/Makefile:1.3
--- pkgsrc/biology/cdhit/Makefile:1.2   Sat Jul  9 06:37:51 2016
+++ pkgsrc/biology/cdhit/Makefile       Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2016/07/09 06:37:51 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:09 jperkin Exp $
 #
 ###########################################################
 #               Generated by fbsd2pkg                     #
@@ -23,13 +23,13 @@ REPLACE_PERL=       *.pl
 WRKSRC=                ${WRKDIR}/${DISTNAME}
 
 SUBST_CLASSES+=                compiler
-SUBST_STAGE.compiler=  post-patch
+SUBST_STAGE.compiler=  pre-configure
 SUBST_MESSAGE.compiler=        Fixing hardcoded compiler name
 SUBST_FILES.compiler=  ${MAKE_FILE}
 SUBST_SED.compiler=    -e 's|g++|${CXX:Q}|g'
 
 SUBST_CLASSES+=                bash
-SUBST_STAGE.bash=      post-patch
+SUBST_STAGE.bash=      pre-configure
 SUBST_MESSAGE.bash=    Fixing bash path
 SUBST_FILES.bash=      cd-hit-2d-para.pl cd-hit-para.pl
 SUBST_SED.bash=                -e 's|/bin/bash|${PREFIX}/bin/bash|g'

Index: pkgsrc/biology/htslib/Makefile
diff -u pkgsrc/biology/htslib/Makefile:1.1 pkgsrc/biology/htslib/Makefile:1.2
--- pkgsrc/biology/htslib/Makefile:1.1  Mon Apr 30 16:51:54 2018
+++ pkgsrc/biology/htslib/Makefile      Wed Jul  4 13:40:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2018/04/30 16:51:54 bacon Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:09 jperkin Exp $
 
 DISTNAME=      htslib-1.8
 CATEGORIES=    biology
@@ -16,7 +16,7 @@ GNU_CONFIGURE=        yes
 REPLACE_PERL=  test/compare_sam.pl test/test.pl
 
 SUBST_CLASSES+=                version
-SUBST_STAGE.version=   post-patch
+SUBST_STAGE.version=   pre-configure
 SUBST_SED.version=     -e "s|m4_esyscmd_s(\[make print-version\])|[${PKGVERSION_NOREV}]|"
 SUBST_FILES.version=   ${WRKSRC}/configure.ac
 

Index: pkgsrc/biology/ncbi-blast+/Makefile
diff -u pkgsrc/biology/ncbi-blast+/Makefile:1.2 pkgsrc/biology/ncbi-blast+/Makefile:1.3
--- pkgsrc/biology/ncbi-blast+/Makefile:1.2     Tue May 22 21:37:29 2018
+++ pkgsrc/biology/ncbi-blast+/Makefile Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2018/05/22 21:37:29 bacon Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:10 jperkin Exp $
 
 DISTNAME=      ncbi-blast-${PV}+-src
 PKGNAME=       ncbi-blast+-${PV}
@@ -15,7 +15,7 @@ LICENSE=      public-domain
 # Fix "undefined _ThreadRuneLocale" error on FreeBSD 10.0
 # Fix "unknown options" in configure
 SUBST_CLASSES+=                configure
-SUBST_STAGE.configure= post-patch
+SUBST_STAGE.configure= pre-configure
 SUBST_SED.configure+=  -e 's|-D_THREAD_SAFE|-D_THREAD_SAFE -D__RUNETYPE_INTERNAL|'
 SUBST_SED.configure+=  -e '/--infodir=DIR/d'
 SUBST_SED.configure+=  -e '/--mandir=DIR/d'

Index: pkgsrc/cad/klayout/Makefile
diff -u pkgsrc/cad/klayout/Makefile:1.10 pkgsrc/cad/klayout/Makefile:1.11
--- pkgsrc/cad/klayout/Makefile:1.10    Mon Mar 12 11:16:08 2018
+++ pkgsrc/cad/klayout/Makefile Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2018/03/12 11:16:08 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:10 jperkin Exp $
 
 DISTNAME=      klayout-0.24.10
 PKGREVISION=   1
@@ -19,7 +19,7 @@ NO_CONFIGURE= yes
 SUBST_CLASSES+=        rpath
 SUBST_MESSAGE.rpath=   Add COMPILER_RPATH_FLAG and PREFIX to NetBSD specific config file
 SUBST_FILES.rpath+=    config/Makefile.conf.netbsd-32-gcc-release
-SUBST_STAGE.rpath=     post-patch
+SUBST_STAGE.rpath=     pre-configure
 SUBST_VARS.rpath=      COMPILER_RPATH_FLAG PREFIX
 SUBST_SED.rpath=       -e 's|@@LDFLAGS@@|${LDFLAGS}|'
 

Index: pkgsrc/cad/mex-wcalc/Makefile
diff -u pkgsrc/cad/mex-wcalc/Makefile:1.10 pkgsrc/cad/mex-wcalc/Makefile:1.11
--- pkgsrc/cad/mex-wcalc/Makefile:1.10  Mon Oct  8 13:25:14 2012
+++ pkgsrc/cad/mex-wcalc/Makefile       Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2012/10/08 13:25:14 asau Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:10 jperkin Exp $
 #
 
 .include "../../cad/wcalc/Makefile.common"
@@ -19,7 +19,7 @@ CONFIGURE_ARGS+=      --without-octave
 CONFIGURE_ARGS+=       --without-scilab
 
 SUBST_CLASSES+=                mwc
-SUBST_STAGE.mwc=       post-patch
+SUBST_STAGE.mwc=       pre-configure
 SUBST_FILES.mwc=       mex-wcalc/mexopts.sh.in
 SUBST_SED.mwc=         -e 's;\.\./libwcalc;${BUILDLINK_DIR}/lib;g'
 

Index: pkgsrc/cad/qcad/Makefile
diff -u pkgsrc/cad/qcad/Makefile:1.70 pkgsrc/cad/qcad/Makefile:1.71
--- pkgsrc/cad/qcad/Makefile:1.70       Sat Mar 24 17:11:57 2018
+++ pkgsrc/cad/qcad/Makefile    Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2018/03/24 17:11:57 joerg Exp $
+# $NetBSD: Makefile,v 1.71 2018/07/04 13:40:10 jperkin Exp $
 #
 
 DISTNAME=              qcad-3.19.1.0
@@ -23,7 +23,7 @@ USE_LANGUAGES=                c c++
 USE_LIBTOOL=           yes
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_MESSAGE.paths=   Attending to hard-coded paths.
 SUBST_FILES.paths+=    shared.pri src/core/RS.cpp src/core/RSettings.cpp
 SUBST_FILES.paths+=    scripts/Help/ShowReadme/ShowReadme.js

Index: pkgsrc/cad/solvespace/Makefile
diff -u pkgsrc/cad/solvespace/Makefile:1.5 pkgsrc/cad/solvespace/Makefile:1.6
--- pkgsrc/cad/solvespace/Makefile:1.5  Mon Apr 16 14:34:12 2018
+++ pkgsrc/cad/solvespace/Makefile      Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2018/04/16 14:34:12 wiz Exp $
+# $NetBSD: Makefile,v 1.6 2018/07/04 13:40:10 jperkin Exp $
 #
 #
 # Both of these hashes need to be updated when the solvespace version
@@ -38,13 +38,13 @@ USE_CMAKE=          yes
 CMAKE_ARGS+=           -DGIT_COMMIT_HASH=${SOLVESPACE_HASH}
 
 SUBST_CLASSES+=                desktop
-SUBST_STAGE.desktop=   post-patch
+SUBST_STAGE.desktop=   pre-configure
 SUBST_MESSAGE.desktop= Fixing absolute path in desktop file
 SUBST_FILES.desktop=   src/unix/solvespace.desktop
 SUBST_SED.desktop=     -e "s,/usr/bin,${PREFIX}/bin,"
 
 SUBST_CLASSES+=                libdxfrw
-SUBST_STAGE.libdxfrw=  post-patch
+SUBST_STAGE.libdxfrw=  pre-configure
 SUBST_MESSAGE.libdxfrw=        Set libdxfrw directory
 SUBST_FILES.libdxfrw=  CMakeLists.txt
 SUBST_SED.libdxfrw=    -e "s,extlib/libdxfrw,extlib/libdxfrw-${LIBDXF_HASH},"

Index: pkgsrc/chat/anope/Makefile
diff -u pkgsrc/chat/anope/Makefile:1.19 pkgsrc/chat/anope/Makefile:1.20
--- pkgsrc/chat/anope/Makefile:1.19     Sat Jan 13 23:18:25 2018
+++ pkgsrc/chat/anope/Makefile  Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2018/01/13 23:18:25 rillig Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:10 jperkin Exp $
 
 DISTNAME=      anope-1.7.21
 PKGREVISION=   8
@@ -47,7 +47,7 @@ CONFIGURE_ARGS+=      --with-rungroup=${ANOPE
 .include "options.mk"
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     data/example.chk data/example.conf
 SUBST_SED.paths=       -e "s|/home/ircd/services|${PREFIX}/lib/anope|g"
 SUBST_SED.paths+=      -e "s|/usr/local/lib/services|${PREFIX}/lib/anope|g"
@@ -55,7 +55,7 @@ SUBST_SED.paths+=     -e "s|/home/username/s
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
 
 SUBST_CLASSES+=                utils
-SUBST_STAGE.utils=     post-patch
+SUBST_STAGE.utils=     pre-configure
 SUBST_FILES.utils=     src/Makefile
 SUBST_SED.utils=       -e "s|find|${FIND}|g"
 SUBST_SED.utils+=      -e "s|chgrp|${CHGRP}|g"

Index: pkgsrc/chat/bitchx/Makefile
diff -u pkgsrc/chat/bitchx/Makefile:1.58 pkgsrc/chat/bitchx/Makefile:1.59
--- pkgsrc/chat/bitchx/Makefile:1.58    Sat Mar  5 11:28:06 2016
+++ pkgsrc/chat/bitchx/Makefile Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.58 2016/03/05 11:28:06 jperkin Exp $
+# $NetBSD: Makefile,v 1.59 2018/07/04 13:40:10 jperkin Exp $
 
 DISTNAME=      bitchx-1.2.1
 PKGREVISION=   1
@@ -20,7 +20,7 @@ CONFIG_SHELL=         ${TOOLS_PATH.bash}
 CFLAGS.Darwin+=        -DBIND_8_COMPAT
 
 SUBST_CLASSES+=                manpage
-SUBST_STAGE.manpage=   post-patch
+SUBST_STAGE.manpage=   pre-configure
 SUBST_FILES.manpage+=  doc/BitchX.1
 SUBST_SED.manpage+=    -e 's,@PREFIX@,${PREFIX},g'
 

Index: pkgsrc/chat/ircd-hybrid/Makefile
diff -u pkgsrc/chat/ircd-hybrid/Makefile:1.53 pkgsrc/chat/ircd-hybrid/Makefile:1.54
--- pkgsrc/chat/ircd-hybrid/Makefile:1.53       Sat Jan 13 23:18:26 2018
+++ pkgsrc/chat/ircd-hybrid/Makefile    Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2018/01/13 23:18:26 rillig Exp $
+# $NetBSD: Makefile,v 1.54 2018/07/04 13:40:10 jperkin Exp $
 
 DISTNAME=      ircd-hybrid-7.2.3
 PKGREVISION=   11
@@ -54,7 +54,7 @@ PKG_GROUPS_VARS+=     IRCD_HYBRID_IRC_GROUP
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     etc/example.conf etc/example.efnet.conf \
                        etc/example.conf.quick doc/ircd.8
 SUBST_SED.paths=       -e "s|/usr/local/ircd/etc|${PKG_SYSCONFDIR}|g"

Index: pkgsrc/chat/ircservices/Makefile
diff -u pkgsrc/chat/ircservices/Makefile:1.51 pkgsrc/chat/ircservices/Makefile:1.52
--- pkgsrc/chat/ircservices/Makefile:1.51       Sat Jan 13 23:18:26 2018
+++ pkgsrc/chat/ircservices/Makefile    Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.51 2018/01/13 23:18:26 rillig Exp $
+# $NetBSD: Makefile,v 1.52 2018/07/04 13:40:10 jperkin Exp $
 #
 
 DISTNAME=      ircservices-5.0.64
@@ -32,7 +32,7 @@ CONFIGURE_ARGS+=      ${empty(LDFLAGS):?:-lfl
 CONFIGURE_ARGS+=       ${empty(LIBS):?:-libs ${LIBS:Q}}
 
 SUBST_CLASSES+=                install
-SUBST_STAGE.install=   post-patch
+SUBST_STAGE.install=   pre-configure
 SUBST_FILES.install=   install-script tools/ircservices-chk.in
 SUBST_SED.install=     -e "s|/bin/cp|${CP}|g"
 SUBST_SED.install+=    -e "s|/bin/chown|${CHOWN}|g"
@@ -42,7 +42,7 @@ SUBST_SED.install+=   -e "s|@DATDEST@|${VA
 SUBST_MESSAGE.install= Fixing scripts.
 
 SUBST_CLASSES+=                utils
-SUBST_STAGE.utils=     post-patch
+SUBST_STAGE.utils=     pre-configure
 SUBST_FILES.utils=     data/Makefile tools/Makefile
 SUBST_SED.utils=       -e "s|chgrp|${CHGRP}|g"
 SUBST_SED.utils+=      -e "s|chmod|${CHMOD}|g"
@@ -50,7 +50,7 @@ SUBST_SED.utils+=     -e "s|find|${FIND}|g"
 SUBST_MESSAGE.utils=   Fixing paths of hard-coded utilities.
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      data/example-ircservices.conf data/example-modules.conf
 SUBST_SED.conf=                -e "s|/usr/local|${PREFIX}|g"
 SUBST_SED.conf+=       -e "s|ircservices.log|${VARBASE}/log/ircservices.log|g"

Index: pkgsrc/chat/jabberd2/Makefile
diff -u pkgsrc/chat/jabberd2/Makefile:1.121 pkgsrc/chat/jabberd2/Makefile:1.122
--- pkgsrc/chat/jabberd2/Makefile:1.121 Sat Apr 14 07:34:11 2018
+++ pkgsrc/chat/jabberd2/Makefile       Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.121 2018/04/14 07:34:11 adam Exp $
+# $NetBSD: Makefile,v 1.122 2018/07/04 13:40:10 jperkin Exp $
 
 DISTNAME=      jabberd-2.6.1
 PKGREVISION=   3
@@ -30,7 +30,7 @@ LIBS+=                ${PTHREAD_LIBS}
 CFLAGS.SunOS+=         -D__EXTENSIONS__        # sockaddr_storage
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      configure
 SUBST_MESSAGE.path=    Fixing configure script.
 SUBST_SED.path=                -e "s,/usr/local,${PREFIX},g"

Index: pkgsrc/chat/psybnc/Makefile
diff -u pkgsrc/chat/psybnc/Makefile:1.3 pkgsrc/chat/psybnc/Makefile:1.4
--- pkgsrc/chat/psybnc/Makefile:1.3     Tue Aug 26 20:55:08 2014
+++ pkgsrc/chat/psybnc/Makefile Wed Jul  4 13:40:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2014/08/26 20:55:08 joerg Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:10 jperkin Exp $
 #
 
 DISTNAME=      psyBNC-2.4BETA2
@@ -28,7 +28,7 @@ CONF_FILES=   share/examples/psybnc/psybnc
 SUBST_CLASSES+=                prefix
 SUBST_FILES.prefix=    tools/autoconf.c
 SUBST_SED.prefix=      -e "s|@PREFIX@|${PREFIX}|g"
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 
 SUBST_CLASSES+=         openssl
 SUBST_FILES.openssl=   makefile.out

Index: pkgsrc/chat/quirc/Makefile
diff -u pkgsrc/chat/quirc/Makefile:1.29 pkgsrc/chat/quirc/Makefile:1.30
--- pkgsrc/chat/quirc/Makefile:1.29     Mon Mar 12 11:16:11 2018
+++ pkgsrc/chat/quirc/Makefile  Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2018/03/12 11:16:11 wiz Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:11 jperkin Exp $
 #
 
 DISTNAME=      quirc-0.9.84
@@ -19,7 +19,7 @@ CONFIGURE_ARGS+=      --with-wish=${TOOLS_PAT
 MAKE_FLAGS+=   docdir=${PREFIX}/share/doc/quirc
 
 SUBST_CLASSES+=                T86
-SUBST_STAGE.T86=       post-patch
+SUBST_STAGE.T86=       pre-configure
 SUBST_FILES.T86=       configure configure.in
 SUBST_MESSAGE.T86=     Changing tcl/tk 8.3 search into tcl/tk 8.6 search
 SUBST_SED.T86=         -e 's,8_3,8_6,g'

Index: pkgsrc/chat/roxirc/Makefile
diff -u pkgsrc/chat/roxirc/Makefile:1.14 pkgsrc/chat/roxirc/Makefile:1.15
--- pkgsrc/chat/roxirc/Makefile:1.14    Mon Sep  4 18:00:50 2017
+++ pkgsrc/chat/roxirc/Makefile Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2017/09/04 18:00:50 wiz Exp $
+# $NetBSD: Makefile,v 1.15 2018/07/04 13:40:11 jperkin Exp $
 #
 
 DISTNAME=      roxirc-1.8
@@ -19,7 +19,7 @@ EXAMPLESDIR=  ${PREFIX}/share/examples/ro
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded command names.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     roxirc
 SUBST_SED.paths=       -e 's,wish8.3,wish,g'
 

Index: pkgsrc/chat/silc-server/Makefile
diff -u pkgsrc/chat/silc-server/Makefile:1.68 pkgsrc/chat/silc-server/Makefile:1.69
--- pkgsrc/chat/silc-server/Makefile:1.68       Thu Jan 19 18:52:04 2017
+++ pkgsrc/chat/silc-server/Makefile    Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.68 2017/01/19 18:52:04 agc Exp $
+# $NetBSD: Makefile,v 1.69 2018/07/04 13:40:11 jperkin Exp $
 
 DISTNAME=      silc-server-1.1.18
 PKGREVISION=   2
@@ -64,7 +64,7 @@ OWN_DIRS_PERMS+=      ${VARBASE}/log/silcd ${
 .include "options.mk"
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     motd.txt
 SUBST_SED.paths=       -e 's,@PREFIX@,${PREFIX},'
 

Index: pkgsrc/chat/spectrum/Makefile
diff -u pkgsrc/chat/spectrum/Makefile:1.69 pkgsrc/chat/spectrum/Makefile:1.70
--- pkgsrc/chat/spectrum/Makefile:1.69  Tue Jul  3 05:03:04 2018
+++ pkgsrc/chat/spectrum/Makefile       Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.69 2018/07/03 05:03:04 adam Exp $
+# $NetBSD: Makefile,v 1.70 2018/07/04 13:40:11 jperkin Exp $
 
 DISTNAME=              spectrum-1.4.8
 PKGREVISION=           45
@@ -55,7 +55,7 @@ CONF_FILES+=          ${EGDIR}/spectrum.cfg ${PK
 .include "options.mk"
 
 SUBST_CLASSES+=                cfgpath
-SUBST_STAGE.cfgpath=   post-patch
+SUBST_STAGE.cfgpath=   pre-configure
 SUBST_FILES.cfgpath+=  src/configfile.cpp
 SUBST_FILES.cfgpath+=  tools/migrate-db/main.cpp
 SUBST_FILES.cfgpath+=  spectrumctl/spectrumctl.py
@@ -65,13 +65,13 @@ SUBST_SED.cfgpath=  -e 's,/etc/spectrum,$
 SUBST_SED.cfgpath+=    -e 's,@ETC_SPECTRUM@,${PKG_SYSCONFDIR},g'
 
 SUBST_CLASSES+=                manpath
-SUBST_STAGE.manpath=   post-patch
+SUBST_STAGE.manpath=   pre-configure
 SUBST_FILES.manpath=   CMakeLists.txt
 SUBST_MESSAGE.manpath= Correcting man page directory
 SUBST_SED.manpath+=    -e 's,@PKGMANDIR@,${PKGMANDIR},g'
 
 SUBST_CLASSES+=                users
-SUBST_STAGE.users=     post-patch
+SUBST_STAGE.users=     pre-configure
 SUBST_FILES.users=     spectrumctl/spectrumctl.py
 SUBST_FILES.users+=    spectrumctl/spectrum/env.py
 SUBST_FILES.users+=    man/spectrumctl.8
@@ -79,7 +79,7 @@ SUBST_MESSAGE.users=  Correcting spectrum
 SUBST_SED.users=       -e 's/@SPECTRUM_USER@/${JABBER_USER}/g'
 
 SUBST_CLASSES+=                cfg
-SUBST_STAGE.cfg=       post-patch
+SUBST_STAGE.cfg=       pre-configure
 SUBST_FILES.cfg=       spectrum.cfg
 SUBST_MESSAGE.cfg=     Fixing paths in default config file
 SUBST_SED.cfg=         -e 's,/var/run/spectrum,${SPECTRUM_RUN},g'

Index: pkgsrc/chat/telegram-purple/Makefile
diff -u pkgsrc/chat/telegram-purple/Makefile:1.5 pkgsrc/chat/telegram-purple/Makefile:1.6
--- pkgsrc/chat/telegram-purple/Makefile:1.5    Fri May 12 22:35:52 2017
+++ pkgsrc/chat/telegram-purple/Makefile        Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2017/05/12 22:35:52 khorben Exp $
+# $NetBSD: Makefile,v 1.6 2018/07/04 13:40:11 jperkin Exp $
 
 DISTNAME=      telegram-purple_1.3.0.orig
 PKGNAME=       telegram-purple-1.3.0
@@ -25,7 +25,7 @@ INSTALLATION_DIRS+=   ${EGDIR}
 OWN_DIRS+=             ${PKG_SYSCONFDIR}/${PKGBASE}
 
 SUBST_CLASSES+=                tglpub
-SUBST_STAGE.tglpub=    post-patch
+SUBST_STAGE.tglpub=    pre-configure
 SUBST_MESSAGE.tglpub=  Adjust path to server.tglpub
 SUBST_FILES.tglpub=    telegram-purple.c
 SUBST_SED.tglpub=      -e "s|/etc/|${PKG_SYSCONFDIR}/|g"

Index: pkgsrc/chat/tkirc2/Makefile
diff -u pkgsrc/chat/tkirc2/Makefile:1.15 pkgsrc/chat/tkirc2/Makefile:1.16
--- pkgsrc/chat/tkirc2/Makefile:1.15    Thu Oct  9 14:06:03 2014
+++ pkgsrc/chat/tkirc2/Makefile Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2014/10/09 14:06:03 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:11 jperkin Exp $
 
 DISTNAME=      tkirc2.46
 PKGNAME=       tkirc2-2.46
@@ -19,7 +19,7 @@ NO_BUILD=     yes
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded command names.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     tkirc2
 SUBST_SED.paths=       -e 's,wish8.3,wish,g'
 

Index: pkgsrc/chat/unrealircd/Makefile
diff -u pkgsrc/chat/unrealircd/Makefile:1.52 pkgsrc/chat/unrealircd/Makefile:1.53
--- pkgsrc/chat/unrealircd/Makefile:1.52        Sun Apr 29 21:31:29 2018
+++ pkgsrc/chat/unrealircd/Makefile     Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.52 2018/04/29 21:31:29 adam Exp $
+# $NetBSD: Makefile,v 1.53 2018/07/04 13:40:11 jperkin Exp $
 
 DISTNAME=      Unreal3.2.10.5
 PKGNAME=       ${DISTNAME:tl:S/l/lircd-/1}
@@ -79,7 +79,7 @@ FILES_SUBST+= UIRCD_USER=${UIRCD_USER}
 FILES_SUBST+=  UIRCD_GROUP=${UIRCD_GROUP}
 
 SUBST_CLASSES+=                homedir
-SUBST_STAGE.homedir=   post-patch
+SUBST_STAGE.homedir=   pre-configure
 SUBST_FILES.homedir=   doc/example.conf
 SUBST_SED.homedir=     -e "s|src/modules|${IRCD_SHARE}/modules|g"
 SUBST_SED.homedir+=    -e "s|include \"|include \"${IRCD_SHARE}/|g"

Index: pkgsrc/comms/asterisk/options.mk
diff -u pkgsrc/comms/asterisk/options.mk:1.8 pkgsrc/comms/asterisk/options.mk:1.9
--- pkgsrc/comms/asterisk/options.mk:1.8        Tue Oct 27 08:49:01 2015
+++ pkgsrc/comms/asterisk/options.mk    Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.8 2015/10/27 08:49:01 jnemeth Exp $
+# $NetBSD: options.mk,v 1.9 2018/07/04 13:40:11 jperkin Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.asterisk
 PKG_SUPPORTED_OPTIONS=         zaptel x11 unixodbc ilbc webvmail ldap spandsp
@@ -78,7 +78,7 @@ post-configure:
 .if !empty(PKG_OPTIONS:Mwebvmail)
 DEPENDS+=              p5-DBI-[0-9]*:../../databases/p5-DBI
 SUBST_CLASSES+=                webvmail
-SUBST_STAGE.webvmail=  post-patch
+SUBST_STAGE.webvmail=  pre-configure
 SUBST_FILES.webvmail=  contrib/scripts/vmail.cgi
 SUBST_SED.webvmail+=   -e 's|@ASTETCDIR@|${ASTETCDIR}|'
 SUBST_SED.webvmail+=   -e "s|@ASTSPOOLDIR@|${ASTSPOOLDIR}|"

Index: pkgsrc/comms/asterisk13/options.mk
diff -u pkgsrc/comms/asterisk13/options.mk:1.2 pkgsrc/comms/asterisk13/options.mk:1.3
--- pkgsrc/comms/asterisk13/options.mk:1.2      Sat Dec  5 23:42:44 2015
+++ pkgsrc/comms/asterisk13/options.mk  Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.2 2015/12/05 23:42:44 jnemeth Exp $
+# $NetBSD: options.mk,v 1.3 2018/07/04 13:40:11 jperkin Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.asterisk
 PKG_SUPPORTED_OPTIONS=         zaptel x11 unixodbc ilbc webvmail ldap spandsp
@@ -78,7 +78,7 @@ post-configure:
 .if !empty(PKG_OPTIONS:Mwebvmail)
 DEPENDS+=              p5-DBI-[0-9]*:../../databases/p5-DBI
 SUBST_CLASSES+=                webvmail
-SUBST_STAGE.webvmail=  post-patch
+SUBST_STAGE.webvmail=  pre-configure
 SUBST_FILES.webvmail=  contrib/scripts/vmail.cgi
 SUBST_SED.webvmail+=   -e 's|@ASTETCDIR@|${ASTETCDIR}|'
 SUBST_SED.webvmail+=   -e "s|@ASTSPOOLDIR@|${ASTSPOOLDIR}|"

Index: pkgsrc/comms/asterisk14/options.mk
diff -u pkgsrc/comms/asterisk14/options.mk:1.1.1.1 pkgsrc/comms/asterisk14/options.mk:1.2
--- pkgsrc/comms/asterisk14/options.mk:1.1.1.1  Tue Oct 25 08:17:03 2016
+++ pkgsrc/comms/asterisk14/options.mk  Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1.1.1 2016/10/25 08:17:03 jnemeth Exp $
+# $NetBSD: options.mk,v 1.2 2018/07/04 13:40:11 jperkin Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.asterisk
 PKG_SUPPORTED_OPTIONS=         zaptel x11 unixodbc ilbc webvmail ldap spandsp
@@ -78,7 +78,7 @@ post-configure:
 .if !empty(PKG_OPTIONS:Mwebvmail)
 DEPENDS+=              p5-DBI-[0-9]*:../../databases/p5-DBI
 SUBST_CLASSES+=                webvmail
-SUBST_STAGE.webvmail=  post-patch
+SUBST_STAGE.webvmail=  pre-configure
 SUBST_FILES.webvmail=  contrib/scripts/vmail.cgi
 SUBST_SED.webvmail+=   -e 's|@ASTETCDIR@|${ASTETCDIR}|'
 SUBST_SED.webvmail+=   -e "s|@ASTSPOOLDIR@|${ASTSPOOLDIR}|"

Index: pkgsrc/comms/asterisk18/options.mk
diff -u pkgsrc/comms/asterisk18/options.mk:1.12 pkgsrc/comms/asterisk18/options.mk:1.13
--- pkgsrc/comms/asterisk18/options.mk:1.12     Thu Jan 29 21:48:07 2015
+++ pkgsrc/comms/asterisk18/options.mk  Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.12 2015/01/29 21:48:07 jnemeth Exp $
+# $NetBSD: options.mk,v 1.13 2018/07/04 13:40:11 jperkin Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.asterisk
 PKG_SUPPORTED_OPTIONS=         zaptel x11 unixodbc ilbc webvmail ldap spandsp
@@ -78,7 +78,7 @@ post-configure:
 .if !empty(PKG_OPTIONS:Mwebvmail)
 DEPENDS+=              p5-DBI-[0-9]*:../../databases/p5-DBI
 SUBST_CLASSES+=                webvmail
-SUBST_STAGE.webvmail=  post-patch
+SUBST_STAGE.webvmail=  pre-configure
 SUBST_FILES.webvmail=  contrib/scripts/vmail.cgi
 SUBST_SED.webvmail+=   -e 's|@ASTETCDIR@|${ASTETCDIR}|'
 SUBST_SED.webvmail+=   -e "s|@ASTSPOOLDIR@|${ASTSPOOLDIR}|"

Index: pkgsrc/comms/conserver/Makefile
diff -u pkgsrc/comms/conserver/Makefile:1.30 pkgsrc/comms/conserver/Makefile:1.31
--- pkgsrc/comms/conserver/Makefile:1.30        Mon Sep 11 15:21:27 2017
+++ pkgsrc/comms/conserver/Makefile     Wed Jul  4 13:40:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2017/09/11 15:21:27 hauke Exp $
+# $NetBSD: Makefile,v 1.31 2018/07/04 13:40:11 jperkin Exp $
 #
 
 DISTNAME=      conserver-7.2.7
@@ -39,7 +39,7 @@ CONF_FILES+=  ${EGDIR}/conserver.passwd.e
 OWN_DIRS=      ${VARBASE}/consoles
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      conserver.cf/conserver.cf
 SUBST_SED.conf=                -e s,/var/consoles,${VARBASE}/consoles,
 

Index: pkgsrc/comms/conserver8/Makefile
diff -u pkgsrc/comms/conserver8/Makefile:1.24 pkgsrc/comms/conserver8/Makefile:1.25
--- pkgsrc/comms/conserver8/Makefile:1.24       Fri Feb 10 10:38:42 2017
+++ pkgsrc/comms/conserver8/Makefile    Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2017/02/10 10:38:42 he Exp $
+# $NetBSD: Makefile,v 1.25 2018/07/04 13:40:12 jperkin Exp $
 #
 
 PKGVER=                8.2.1
@@ -41,7 +41,7 @@ CONF_FILES+=  ${EGDIR}/conserver.passwd $
 OWN_DIRS=      ${VARBASE}/consoles
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      conserver.cf/conserver.cf
 SUBST_SED.conf=                -e "s,/var/consoles,${VARBASE}/consoles,"
 

Index: pkgsrc/comms/minicom/Makefile
diff -u pkgsrc/comms/minicom/Makefile:1.69 pkgsrc/comms/minicom/Makefile:1.70
--- pkgsrc/comms/minicom/Makefile:1.69  Tue Apr 18 13:30:57 2017
+++ pkgsrc/comms/minicom/Makefile       Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.69 2017/04/18 13:30:57 wiz Exp $
+# $NetBSD: Makefile,v 1.70 2018/07/04 13:40:12 jperkin Exp $
 
 DISTNAME=      minicom-2.7.1
 CATEGORIES=    comms
@@ -24,7 +24,7 @@ EGDIR=                        ${PREFIX}/share/examples/minico
 
 SUBST_CLASSES+=                minicom
 SUBST_MESSAGE.minicom= Fixing hardcoded paths.
-SUBST_STAGE.minicom=   post-patch
+SUBST_STAGE.minicom=   pre-configure
 SUBST_FILES.minicom=   src/rwconf.c
 SUBST_VARS.minicom=    PREFIX
 

Index: pkgsrc/comms/op_panel/Makefile
diff -u pkgsrc/comms/op_panel/Makefile:1.10 pkgsrc/comms/op_panel/Makefile:1.11
--- pkgsrc/comms/op_panel/Makefile:1.10 Sat Jul  9 06:37:55 2016
+++ pkgsrc/comms/op_panel/Makefile      Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2016/07/09 06:37:55 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:12 jperkin Exp $
 #
 
 DISTNAME=      op_panel-0.29
@@ -54,7 +54,7 @@ SUBST_SED.paths+=     -e 's,@PREFIX@,${PREFI
 SUBST_SED.paths+=      -e 's,@SMDIR@,${SMDIR},g'
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
 SUBST_SED.paths+=      -e 's,@PERL5@,${PERL5},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 INSTALLATION_DIRS+=    share/examples/${FOP}
 INSTALLATION_DIRS+=    share/${FOP}

Index: pkgsrc/comms/p5-pilot-link/Makefile
diff -u pkgsrc/comms/p5-pilot-link/Makefile:1.57 pkgsrc/comms/p5-pilot-link/Makefile:1.58
--- pkgsrc/comms/p5-pilot-link/Makefile:1.57    Mon Jun  5 14:22:20 2017
+++ pkgsrc/comms/p5-pilot-link/Makefile Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2017/06/05 14:22:20 ryoon Exp $
+# $NetBSD: Makefile,v 1.58 2018/07/04 13:40:12 jperkin Exp $
 #
 
 .include "../../comms/pilot-link/Makefile.common"
@@ -40,7 +40,7 @@ BUILD_DIRS+=          src
 BUILD_DIRS+=           ${INSTALL_DIRS}
 
 SUBST_CLASSES+=                progs
-SUBST_STAGE.progs=     post-patch
+SUBST_STAGE.progs=     pre-configure
 SUBST_MESSAGE.progs=   Trim programs to build
 SUBST_FILES.progs=     src/Makefile.in
 SUBST_SED.progs=       -e s:@ENABLE_CONDUITS_TRUE@bin_PROGRAMS:@ENABLE_CONDUITS_TRUE@bin_PROGRAMSX:

Index: pkgsrc/cross/avr-gcc/Makefile
diff -u pkgsrc/cross/avr-gcc/Makefile:1.39 pkgsrc/cross/avr-gcc/Makefile:1.40
--- pkgsrc/cross/avr-gcc/Makefile:1.39  Sun Jan 28 16:24:12 2018
+++ pkgsrc/cross/avr-gcc/Makefile       Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2018/01/28 16:24:12 wiz Exp $
+# $NetBSD: Makefile,v 1.40 2018/07/04 13:40:12 jperkin Exp $
 
 DISTNAME=              gcc-4.8.3
 PKGNAME=               ${DISTNAME:C/^/avr-/}
@@ -39,7 +39,7 @@ MAKE_ENV+=            CPPFLAGS_FOR_BUILD=${CPPFLAG
 SUBST_CLASSES+=                sed
 SUBST_FILES.sed=       fixincludes/fixincl.x
 SUBST_SED.sed=         -e 's|@SED@|${TOOLS_PATH.sed}|g'
-SUBST_STAGE.sed=       post-patch
+SUBST_STAGE.sed=       pre-configure
 
 pre-configure:
        ${MKDIR} ${WRKDIR}/obj

Index: pkgsrc/cross/cc65/Makefile
diff -u pkgsrc/cross/cc65/Makefile:1.11 pkgsrc/cross/cc65/Makefile:1.12
--- pkgsrc/cross/cc65/Makefile:1.11     Sat Jul  9 06:37:58 2016
+++ pkgsrc/cross/cc65/Makefile  Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2016/07/09 06:37:58 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:12 jperkin Exp $
 #
 
 DISTNAME=      cc65-sources-2.13.3
@@ -23,7 +23,7 @@ INSTALL_MAKE_FLAGS+=  PREFIX=${DESTDIR}${
 
 SUBST_CLASSES+=                perl
 SUBST_MESSAGE.perl=    Fixing the path of perl.
-SUBST_STAGE.perl=      post-patch
+SUBST_STAGE.perl=      pre-configure
 SUBST_FILES.perl=      src/ca65/macpack/cvt-mac.pl src/ld65/cfg/cvt-cfg.pl
 SUBST_SED.perl=                -e "s,/usr/bin/perl,${PREFIX}/bin/perl,g"
 

Index: pkgsrc/cross/nios2-gcc/Makefile
diff -u pkgsrc/cross/nios2-gcc/Makefile:1.12 pkgsrc/cross/nios2-gcc/Makefile:1.13
--- pkgsrc/cross/nios2-gcc/Makefile:1.12        Sun Jan 28 16:24:12 2018
+++ pkgsrc/cross/nios2-gcc/Makefile     Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2018/01/28 16:24:12 wiz Exp $
+# $NetBSD: Makefile,v 1.13 2018/07/04 13:40:12 jperkin Exp $
 .include               "../../cross/nios2/Makefile.common"
 PKGNAME=               nios2-gcc-${PKG_VERSION}
 PKG_VERSION=           4.7.3
@@ -38,7 +38,7 @@ SUBST_CLASSES+=                       host-subdir
 # Work around for the problem
 # gmake[2]: *** No rule to make target `../.././gcc/libgcc.mvars'.  Stop.
 SUBST_MESSAGE.host-subdir=     Purely work-around, replacing @host-subdir@ in advance
-SUBST_STAGE.host-subdir=       post-patch
+SUBST_STAGE.host-subdir=       pre-configure
 SUBST_FILES.host-subdir=       libgcc/Makefile.in
 SUBST_SED.host-subdir=         '-e /host_subdir = @host_subdir@/s,@host_subdir@,host-${MACHINE_ARCH}--${OPSYS:tl},'
 

Index: pkgsrc/cross/nios2-gcc41/options.mk
diff -u pkgsrc/cross/nios2-gcc41/options.mk:1.3 pkgsrc/cross/nios2-gcc41/options.mk:1.4
--- pkgsrc/cross/nios2-gcc41/options.mk:1.3     Thu Jul  7 13:26:16 2016
+++ pkgsrc/cross/nios2-gcc41/options.mk Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.3 2016/07/07 13:26:16 rillig Exp $
+# $NetBSD: options.mk,v 1.4 2018/07/04 13:40:12 jperkin Exp $
 
 ### Set options
 PKG_OPTIONS_VAR=       PKG_OPTIONS.nios2-gcc
@@ -15,7 +15,7 @@ CFLAGS+=              -DTARGET_SYSTEM_ROOT=0 -DTARGE
 # conditional SUBST_CLASSES
 .if empty(PKG_OPTIONS:Mdoc)
 SUBST_CLASSES+=                nios
-SUBST_STAGE.nios=      post-patch
+SUBST_STAGE.nios=      pre-configure
 SUBST_FILES.nios=      gcc/Makefile.in
 SUBST_SED.nios=                -e s/@@DOC@@//
 SUBST_SED.nios+=       -e s/@@INSTALL_HTML@@//
@@ -32,7 +32,7 @@ BUILD_DEPENDS+=               gtexinfo-[0-9]*:../../d
 PLIST.doc=             yes
 
 SUBST_CLASSES+=                nios
-SUBST_STAGE.nios=      post-patch
+SUBST_STAGE.nios=      pre-configure
 SUBST_FILES.nios=      gcc/Makefile.in
 SUBST_SED.nios=                -e s/@@DOC@@/doc/
 SUBST_SED.nios+=       -e s/@@INSTALL_HTML@@/install-html/

Index: pkgsrc/databases/cstore/Makefile
diff -u pkgsrc/databases/cstore/Makefile:1.14 pkgsrc/databases/cstore/Makefile:1.15
--- pkgsrc/databases/cstore/Makefile:1.14       Thu Jan 19 18:52:04 2017
+++ pkgsrc/databases/cstore/Makefile    Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2017/01/19 18:52:04 agc Exp $
+# $NetBSD: Makefile,v 1.15 2018/07/04 13:40:12 jperkin Exp $
 
 DISTNAME=      cstore0.2
 PKGNAME=       cstore-0.2
@@ -20,7 +20,7 @@ WRKSRC=                       ${WRKDIR}/cstore
 REPLACE_PERL=          Build/BSsrcs
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    Build/makefile.init
 SUBST_SED.prefix=      -e 's|@PREFIX@|'${PREFIX}'|g'
 

Index: pkgsrc/databases/mysqltuner/Makefile
diff -u pkgsrc/databases/mysqltuner/Makefile:1.4 pkgsrc/databases/mysqltuner/Makefile:1.5
--- pkgsrc/databases/mysqltuner/Makefile:1.4    Tue Jan 16 12:43:17 2018
+++ pkgsrc/databases/mysqltuner/Makefile        Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2018/01/16 12:43:17 mef Exp $
+# $NetBSD: Makefile,v 1.5 2018/07/04 13:40:12 jperkin Exp $
 
 GITHUB_PROJECT=        MySQLTuner-perl
 DISTNAME=      1.7.2
@@ -25,7 +25,7 @@ SUBST_CLASSES+=               docdir
 SUBST_FILES.docdir=    mysqltuner.pl
 SUBST_MESSAGE.docdir=  Fixing DOCDIR.
 SUBST_SED.docdir=      -e "s|/usr/share/mysqltuner|${PREFIX}/${PKGDOCDIR}|1"
-SUBST_STAGE.docdir=    post-patch
+SUBST_STAGE.docdir=    pre-configure
 
 INSTALLATION_DIRS+=    bin ${PKGDOCDIR}
 

Index: pkgsrc/databases/openldap/Makefile.common
diff -u pkgsrc/databases/openldap/Makefile.common:1.40 pkgsrc/databases/openldap/Makefile.common:1.41
--- pkgsrc/databases/openldap/Makefile.common:1.40      Sat Apr 21 13:38:04 2018
+++ pkgsrc/databases/openldap/Makefile.common   Wed Jul  4 13:40:12 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.40 2018/04/21 13:38:04 wiz Exp $
+# $NetBSD: Makefile.common,v 1.41 2018/07/04 13:40:12 jperkin Exp $
 #
 # used by databases/openldap-client/Makefile
 # used by databases/openldap-cloak/Makefile
@@ -50,7 +50,7 @@ PKG_USERS_VARS+=      SLAPD_USER
 # the internal avl_* prototypes conflict with those in <sys/avl.h> which
 # is included by another system header file on Solaris, so subst them.
 SUBST_CLASSES.SunOS+=  conflict
-SUBST_STAGE.conflict=  post-patch
+SUBST_STAGE.conflict=  pre-configure
 SUBST_FILES.conflict=  ${WRKSRC}/*/*.h
 SUBST_FILES.conflict+= ${WRKSRC}/*/*/*.c ${WRKSRC}/*/*/*/*.c
 SUBST_SED.conflict+=   -e 's,avl_free,openldap_avl_free,g'

Index: pkgsrc/databases/pgbuildfarm/Makefile
diff -u pkgsrc/databases/pgbuildfarm/Makefile:1.15 pkgsrc/databases/pgbuildfarm/Makefile:1.16
--- pkgsrc/databases/pgbuildfarm/Makefile:1.15  Sat Jul  9 06:38:01 2016
+++ pkgsrc/databases/pgbuildfarm/Makefile       Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2016/07/09 06:38:01 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:13 jperkin Exp $
 
 DISTNAME=              build-farm-4_15_1
 PKGNAME=               ${DISTNAME:S/build-farm/pgbuildfarm/:S/_/./g}
@@ -29,7 +29,7 @@ CONF_FILES=           ${EGDIR}/build-farm.conf \
 PKG_SYSCONFSUBDIR=     pgbuildfarm
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      setnotes.pl update_personality.pl PGBuild/Options.pm
 SUBST_SED.conf=                -e 's,build-farm.conf,${PKG_SYSCONFDIR}/build-farm.conf,'
 SUBST_MESSAGE.conf=    Fixing default value for build-farm.conf

Index: pkgsrc/databases/poco-data-mysql/Makefile
diff -u pkgsrc/databases/poco-data-mysql/Makefile:1.11 pkgsrc/databases/poco-data-mysql/Makefile:1.12
--- pkgsrc/databases/poco-data-mysql/Makefile:1.11      Sat Mar  5 11:27:43 2016
+++ pkgsrc/databases/poco-data-mysql/Makefile   Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2016/03/05 11:27:43 jperkin Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:13 jperkin Exp $
 #
 
 PKGNAME=       poco-data-mysql-${POCO_VERSION}
@@ -31,7 +31,7 @@ do-install:
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   pkgsrc-izing paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     Data/MySQL/Makefile
 SUBST_SED.paths=    -e 's,@MYSQLLIBDIR@,${BUILDLINK_DIR}/${BUILDLINK_LIBDIRS.mysql-client},g'
 SUBST_SED.paths+=    -e 's,@MYSQLINCDIR@,${BUILDLINK_DIR}/${BUILDLINK_INCDIRS.mysql-client},g'

Index: pkgsrc/devel/ExmanIDE/Makefile
diff -u pkgsrc/devel/ExmanIDE/Makefile:1.25 pkgsrc/devel/ExmanIDE/Makefile:1.26
--- pkgsrc/devel/ExmanIDE/Makefile:1.25 Tue Jul  3 05:03:07 2018
+++ pkgsrc/devel/ExmanIDE/Makefile      Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2018/07/03 05:03:07 adam Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:13 jperkin Exp $
 
 DISTNAME=      ExmanIDE-0.9.4
 PKGREVISION=   7
@@ -21,20 +21,20 @@ PYTHON_VERSIONS_INCOMPATIBLE=       34 35 36 3
 
 SUBST_CLASSES+=                mod
 SUBST_MESSAGE.mod=     Fixing deprecated module names.
-SUBST_STAGE.mod=       post-patch
+SUBST_STAGE.mod=       pre-configure
 SUBST_FILES.mod=       Profile.py SourceEditor.py StcStyle.py
 SUBST_SED.mod=         -e 's,wxPython\.lib\.PyCrust,wxPython.py,g'
 SUBST_SED.mod+=                -e 's,wxPython\.py,wx.py,g'
 
 SUBST_CLASSES+=                py
 SUBST_MESSAGE.py=      Fixing paths in a wrapper script.
-SUBST_STAGE.py=                post-patch
+SUBST_STAGE.py=                pre-configure
 SUBST_FILES.py=                ExmanIDE
 SUBST_SED.py=          -e 's,python \$$0\.pyw,${PYTHONBIN} ${PREFIX}/share/${PKGBASE}/ExmanIDE.pyw,g'
 
 SUBST_CLASSES+=                py2
 SUBST_MESSAGE.py2=     Fixing path in Python module.
-SUBST_STAGE.py2=       post-patch
+SUBST_STAGE.py2=       pre-configure
 SUBST_FILES.py2=       ExmanIDE.pyw
 SUBST_SED.py2=         -e 's,/usr/bin/env python.*$$,${PYTHONBIN},'
 

Index: pkgsrc/devel/ProjectCenter/Makefile
diff -u pkgsrc/devel/ProjectCenter/Makefile:1.51 pkgsrc/devel/ProjectCenter/Makefile:1.52
--- pkgsrc/devel/ProjectCenter/Makefile:1.51    Sat Apr 14 07:34:15 2018
+++ pkgsrc/devel/ProjectCenter/Makefile Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.51 2018/04/14 07:34:15 adam Exp $
+# $NetBSD: Makefile,v 1.52 2018/07/04 13:40:13 jperkin Exp $
 
 DISTNAME=      ProjectCenter-0.6.2
 PKGREVISION=   8
@@ -18,7 +18,7 @@ NO_CONFIGURE= yes
 MAKE_FILE=     GNUmakefile
 
 SUBST_CLASSES+=                gmake
-SUBST_STAGE.gmake=     post-patch
+SUBST_STAGE.gmake=     pre-configure
 SUBST_FILES.gmake+=    Framework/GNUmakefile.preamble
 SUBST_FILES.gmake+=    Modules/Preferences/Build/PCBuildPrefs.h
 SUBST_SED.gmake+=      -e 's|.(GMAKE)|${GMAKE:Q}|g'

Index: pkgsrc/devel/adacurses/Makefile
diff -u pkgsrc/devel/adacurses/Makefile:1.2 pkgsrc/devel/adacurses/Makefile:1.3
--- pkgsrc/devel/adacurses/Makefile:1.2 Mon Apr  2 09:30:06 2018
+++ pkgsrc/devel/adacurses/Makefile     Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2018/04/02 09:30:06 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:13 jperkin Exp $
 
 PKGNAME=       adacurses-${ACVERSION}
 CATEGORIES=    devel
@@ -28,17 +28,17 @@ PLIST_SUBST=        atic=adacurses/terminal_int
 USE_BUILTIN.ncurses=   no
 SUBST_CLASSES=         adagen pragma sample
 
-SUBST_STAGE.adagen=    post-patch
+SUBST_STAGE.adagen=    pre-configure
 SUBST_FILES.adagen=    gen/Makefile.in
 SUBST_SED.adagen=      -e '/(INSTALL_PROG)/d' -e 's|@ADAGEN_LDFLAGS@||'
 SUBST_MESSAGE.adagen=  Adjust gen Makefile
 
-SUBST_STAGE.sample=    post-patch
+SUBST_STAGE.sample=    pre-configure
 SUBST_FILES.sample=    samples/Makefile.in
 SUBST_SED.sample=      -e 's|@LIBS@|@LIBS@ -lmenu -lform -lpanel|'
 SUBST_MESSAGE.sample=  Adjust samples Makefile
 
-SUBST_STAGE.pragma=    post-patch
+SUBST_STAGE.pragma=    pre-configure
 SUBST_FILES.pragma=    gen/terminal_interface-curses.ads.m4 \
                        gen/terminal_interface-curses-menus.ads.m4 \
                        gen/terminal_interface-curses-forms.ads.m4 \

Index: pkgsrc/devel/bullet/Makefile
diff -u pkgsrc/devel/bullet/Makefile:1.8 pkgsrc/devel/bullet/Makefile:1.9
--- pkgsrc/devel/bullet/Makefile:1.8    Mon Sep 11 07:45:33 2017
+++ pkgsrc/devel/bullet/Makefile        Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2017/09/11 07:45:33 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:13 jperkin Exp $
 
 PKGNAME=       ${DISTNAME:S/-r2704//}
 DISTNAME=      bullet-2.82-r2704
@@ -22,7 +22,7 @@ CMAKE_ARGS+=  -DBUILD_SHARED_LIBS:BOOL=on
 CMAKE_ARGS+=   -DINSTALL_LIBS:BOOL=on
 
 SUBST_CLASSES+=        lcompat
-SUBST_STAGE.lcompat=   post-patch
+SUBST_STAGE.lcompat=   pre-configure
 SUBST_FILES.lcompat=   Demos/AllBulletDemos/CMakeLists.txt
 SUBST_SED.lcompat=     -e "s|{OPENGL_glu_LIBRARY}|{OPENGL_glu_LIBRARY} -lcompat|g"
 SUBST_MESSAGE.lcompat= Adding -lcompat for demos

Index: pkgsrc/devel/cpuflags/Makefile
diff -u pkgsrc/devel/cpuflags/Makefile:1.153 pkgsrc/devel/cpuflags/Makefile:1.154
--- pkgsrc/devel/cpuflags/Makefile:1.153        Thu Jan 28 19:11:30 2016
+++ pkgsrc/devel/cpuflags/Makefile      Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.153 2016/01/28 19:11:30 abs Exp $
+# $NetBSD: Makefile,v 1.154 2018/07/04 13:40:13 jperkin Exp $
 
 DISTNAME=      cpuflags-1.43
 CATEGORIES=    devel sysutils
@@ -24,7 +24,7 @@ MAKE_FLAGS+=  INSTALL_DATA_DIR=${INSTALL_
 MAKE_FLAGS+=   MANDIR=${PREFIX}/${PKGMANDIR}/man1
 
 SUBST_CLASSES+=                cpuflags
-SUBST_STAGE.cpuflags=  post-patch
+SUBST_STAGE.cpuflags=  pre-configure
 SUBST_FILES.cpuflags=  cpuflags.sh
 SUBST_SED.cpuflags=    -e s,@@SH@@,${SH:Q},
 

Index: pkgsrc/devel/cscope/Makefile
diff -u pkgsrc/devel/cscope/Makefile:1.57 pkgsrc/devel/cscope/Makefile:1.58
--- pkgsrc/devel/cscope/Makefile:1.57   Tue Aug 18 07:31:04 2015
+++ pkgsrc/devel/cscope/Makefile        Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2015/08/18 07:31:04 wiz Exp $
+# $NetBSD: Makefile,v 1.58 2018/07/04 13:40:13 jperkin Exp $
 
 DISTNAME=      cscope-15.8a
 PKGREVISION=   2
@@ -20,7 +20,7 @@ SUBST_CLASSES+=               path
 SUBST_SED.path=                -e "s,PATH=\"\\(.*\\),PATH=\"${PREFIX}/bin:\\1,"
 SUBST_FILES.path=      contrib/xcscope/cscope-indexer
 SUBST_MESSAGE.path=    Fixing path in cscope-indexer.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 
 post-install:
        ${INSTALL_SCRIPT} ${WRKSRC}/contrib/xcscope/cscope-indexer \

Index: pkgsrc/devel/distcc/Makefile.common
diff -u pkgsrc/devel/distcc/Makefile.common:1.11 pkgsrc/devel/distcc/Makefile.common:1.12
--- pkgsrc/devel/distcc/Makefile.common:1.11    Fri Apr 25 16:13:31 2014
+++ pkgsrc/devel/distcc/Makefile.common Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.11 2014/04/25 16:13:31 adam Exp $
+# $NetBSD: Makefile.common,v 1.12 2018/07/04 13:40:13 jperkin Exp $
 # used by devel/distcc-pump/Makefile
 # used by devel/distccmon-gnome/Makefile
 # used by devel/distccmon-gtk/Makefile
@@ -26,7 +26,7 @@ CONFIGURE_ARGS+=      --sysconfdir=${PKG_SYSC
 CHECK_PORTABILITY_SKIP+=       contrib/redhat/*
 
 SUBST_CLASSES+=                doc
-SUBST_STAGE.doc=       post-patch
+SUBST_STAGE.doc=       pre-configure
 SUBST_FILES.doc=       src/distcc.c src/hosts.c
 SUBST_SED.doc=         -e "s|%s/distcc/hosts|%s/hosts|g"
 SUBST_MESSAGE.doc=     Fixing paths.

Index: pkgsrc/devel/distccmon-gtk/Makefile
diff -u pkgsrc/devel/distccmon-gtk/Makefile:1.37 pkgsrc/devel/distccmon-gtk/Makefile:1.38
--- pkgsrc/devel/distccmon-gtk/Makefile:1.37    Mon Apr 16 14:34:19 2018
+++ pkgsrc/devel/distccmon-gtk/Makefile Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.37 2018/04/16 14:34:19 wiz Exp $
+# $NetBSD: Makefile,v 1.38 2018/07/04 13:40:13 jperkin Exp $
 
 PKGNAME=       ${DISTNAME:S/-/-gtk-/:S/rc1//}
 PKGREVISION=   7
@@ -10,7 +10,7 @@ USE_TOOLS+=           pkg-config
 CONFIGURE_ARGS+=       --with-gtk
 
 SUBST_CLASSES+=                gtk
-SUBST_STAGE.gtk=       post-patch
+SUBST_STAGE.gtk=       pre-configure
 SUBST_FILES.gtk=       gnome/distccmon-gnome.desktop src/mon-gnome.c
 SUBST_SED.gtk=         -e "s/distccmon-gnome/distccmon-gtk/g"
 SUBST_MESSAGE.gtk=     Renaming -gnome to -gtk.

Index: pkgsrc/devel/elfsh/Makefile
diff -u pkgsrc/devel/elfsh/Makefile:1.25 pkgsrc/devel/elfsh/Makefile:1.26
--- pkgsrc/devel/elfsh/Makefile:1.25    Tue Aug  1 16:47:37 2017
+++ pkgsrc/devel/elfsh/Makefile Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2017/08/01 16:47:37 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:13 jperkin Exp $
 #
 
 VERS=          0.51b3
@@ -19,7 +19,7 @@ LDFLAGS+=     ${BUILDLINK_LDADD.dl:Q}
 WRKSRC=                ${WRKDIR}/${PKGNAME_NOREV}
 
 SUBST_CLASSES+=                elfsh
-SUBST_STAGE.elfsh=     post-patch
+SUBST_STAGE.elfsh=     pre-configure
 SUBST_MESSAGE.elfsh=   Fixing hardcoded paths.
 SUBST_FILES.elfsh=     vm/include/elfsh.h
 SUBST_SED.elfsh=       -e '/ELFSH_SHELL/s,/bin/bash,${SH},'

Index: pkgsrc/devel/emacs-ilisp/Makefile
diff -u pkgsrc/devel/emacs-ilisp/Makefile:1.21 pkgsrc/devel/emacs-ilisp/Makefile:1.22
--- pkgsrc/devel/emacs-ilisp/Makefile:1.21      Tue Aug  1 14:58:55 2017
+++ pkgsrc/devel/emacs-ilisp/Makefile   Wed Jul  4 13:40:13 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2017/08/01 14:58:55 wiz Exp $
+# $NetBSD: Makefile,v 1.22 2018/07/04 13:40:13 jperkin Exp $
 #
 
 DISTNAME=      ilisp-20021222
@@ -18,7 +18,7 @@ BUILD_TARGET= compile
 SITELISP=      ${EMACS_LISPPREFIX}/ilisp
 
 SUBST_CLASSES+=                        string-to-int
-SUBST_STAGE.string-to-int=     post-patch
+SUBST_STAGE.string-to-int=     pre-configure
 SUBST_MESSAGE.string-to-int=   obsolete function (as of 22.1); use `string-to-number' instead
 SUBST_FILES.string-to-int+=    ilisp-acl.el
 SUBST_SED.string-to-int=       -e 's/string-to-int/string-to-number/'

Index: pkgsrc/devel/exctags/Makefile
diff -u pkgsrc/devel/exctags/Makefile:1.28 pkgsrc/devel/exctags/Makefile:1.29
--- pkgsrc/devel/exctags/Makefile:1.28  Sat Nov 14 06:01:02 2015
+++ pkgsrc/devel/exctags/Makefile       Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2015/11/14 06:01:02 richard Exp $
+# $NetBSD: Makefile,v 1.29 2018/07/04 13:40:14 jperkin Exp $
 #
 
 DISTNAME=      ctags-5.8
@@ -24,7 +24,7 @@ CPPFLAGS+=            -DETAGS="\"exetags\""
 CFLAGS+=               ${CPPFLAGS}
 
 SUBST_CLASSES+=                man
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_FILES.man=       ctags.1
 SUBST_SED.man=         -e 's|^ctags \\-|exctags \\-|'
 SUBST_SED.man+=                -e 's|fBctags|fBexctags|g'
@@ -34,7 +34,7 @@ SUBST_SED.man+=               -e 's|"etags|"exetags|g
 SUBST_SED.man+=                -e 's|/usr/local|${PREFIX}|g'
 
 SUBST_CLASSES+=                rename
-SUBST_STAGE.rename=    post-patch
+SUBST_STAGE.rename=    pre-configure
 SUBST_FILES.rename=    c.c eiffel.c general.h lregex.c lua.c main.c \
                        options.c parse.c routines.c
 SUBST_SED.rename=      -e 's|__unused__|__unused_|g'

Index: pkgsrc/devel/glib2/Makefile.common
diff -u pkgsrc/devel/glib2/Makefile.common:1.63 pkgsrc/devel/glib2/Makefile.common:1.64
--- pkgsrc/devel/glib2/Makefile.common:1.63     Mon Apr 23 08:26:50 2018
+++ pkgsrc/devel/glib2/Makefile.common  Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.63 2018/04/23 08:26:50 adam Exp $
+# $NetBSD: Makefile.common,v 1.64 2018/07/04 13:40:14 jperkin Exp $
 #
 # used by devel/glib2/Makefile
 # used by devel/gdbus-codegen/Makefile
@@ -55,7 +55,7 @@ CPPFLAGS+=            -DPKG_SYSCONFDIR="\"${PKG_SY
 
 .if ${OPSYS} == "FreeBSD"
 SUBST_CLASSES+=                thr
-SUBST_STAGE.thr=       post-patch
+SUBST_STAGE.thr=       pre-configure
 SUBST_FILES.thr=       gthread/Makefile.in
 .  if ${OS_VERSION:R} >= 5
 SUBST_SED.thr+=                -e "s|@G_THREAD_LIBS_FOR_GTHREAD@|-lpthread|g"
@@ -106,7 +106,7 @@ CONFIGURE_ARGS+=    --disable-threads
 BUILD_DEFS+=           VARBASE
 SUBST_CLASSES+=                dbusdb
 SUBST_MESSAGE.dbusdb=  Adjust dbus machine uuid path to dbus package
-SUBST_STAGE.dbusdb=    post-patch
+SUBST_STAGE.dbusdb=    pre-configure
 SUBST_FILES.dbusdb=    gio/gdbusconnection.c
 SUBST_FILES.dbusdb+=   gio/gdbusprivate.c
 SUBST_FILES.dbusdb+=   po/glib20.pot

Index: pkgsrc/devel/gnustep-make/Makefile
diff -u pkgsrc/devel/gnustep-make/Makefile:1.57 pkgsrc/devel/gnustep-make/Makefile:1.58
--- pkgsrc/devel/gnustep-make/Makefile:1.57     Sun Apr 19 04:13:26 2015
+++ pkgsrc/devel/gnustep-make/Makefile  Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2015/04/19 04:13:26 manu Exp $
+# $NetBSD: Makefile,v 1.58 2018/07/04 13:40:14 jperkin Exp $
 
 DISTNAME=      gnustep-make-2.6.2
 PKGREVISION=   2
@@ -44,7 +44,7 @@ GNUSTEP_ARCH= ${MACHINE_ARCH}
 PLIST_SUBST+=  GNUSTEP_ARCH=${GNUSTEP_ARCH}
 
 SUBST_CLASSES+=                target
-SUBST_STAGE.target=    post-patch
+SUBST_STAGE.target=    pre-configure
 SUBST_FILES.target=    target.make
 SUBST_SED.target+=     -e 's|/usr/pkg|${PREFIX}|g'
 

Index: pkgsrc/devel/gnustep-make/gnustep.mk
diff -u pkgsrc/devel/gnustep-make/gnustep.mk:1.26 pkgsrc/devel/gnustep-make/gnustep.mk:1.27
--- pkgsrc/devel/gnustep-make/gnustep.mk:1.26   Sun Dec 31 16:39:41 2017
+++ pkgsrc/devel/gnustep-make/gnustep.mk        Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-#      $NetBSD: gnustep.mk,v 1.26 2017/12/31 16:39:41 gdt Exp $
+#      $NetBSD: gnustep.mk,v 1.27 2018/07/04 13:40:14 jperkin Exp $
 
 .if !defined(GNUSTEP_MK)
 GNUSTEP_MK=            #defined
@@ -64,7 +64,7 @@ GNUSTEP_LDFLAGS=      ${GNUSTEP_LFLAGS} ${GNU
 
 .if defined(FIX_GNUSTEP_INSTALLATION_DIR)
 SUBST_CLASSES+=                                gnustep_installation_dir
-SUBST_STAGE.gnustep_installation_dir=  post-patch
+SUBST_STAGE.gnustep_installation_dir=  pre-configure
 SUBST_FILES.gnustep_installation_dir?= GNUmakefile
 SUBST_SED.gnustep_installation_dir+=   -e 's|GNUSTEP_INSTALLATION_DIR.*=.*..GNUSTEP_\(.*\)_ROOT.*|GNUSTEP_INSTALLATION_DOMAIN = \1|'
 SUBST_SED.gnustep_installation_dir+=   -e 's|\$$(GNUSTEP_INSTALLATION_DIR)/Libraries|$${DESTDIR}${GNUSTEP_LIB_DIR}/Libraries/${PKGNAME_NOREV}|g'

Index: pkgsrc/devel/gprbuild-aux/Makefile
diff -u pkgsrc/devel/gprbuild-aux/Makefile:1.10 pkgsrc/devel/gprbuild-aux/Makefile:1.11
--- pkgsrc/devel/gprbuild-aux/Makefile:1.10     Mon Apr  2 09:30:06 2018
+++ pkgsrc/devel/gprbuild-aux/Makefile  Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2018/04/02 09:30:06 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:14 jperkin Exp $
 
 DISTNAME=      gprbuild-aux-${SNAPSHOT}
 CATEGORIES=    devel
@@ -21,7 +21,7 @@ BUILD_DIRS=           ${WRKSRC}/construction
 
 SUBST_CLASSES=         lbase
 
-SUBST_STAGE.lbase=     post-patch
+SUBST_STAGE.lbase=     pre-configure
 SUBST_FILES.lbase=     share/gprconfig/compilers.xml
 SUBST_SED.lbase=       -e "s|/usr/local|${LOCALBASE}|"
 SUBST_MESSAGE.lbase=   Ensure pkgsrc localbase is used

Index: pkgsrc/devel/gps/Makefile
diff -u pkgsrc/devel/gps/Makefile:1.53 pkgsrc/devel/gps/Makefile:1.54
--- pkgsrc/devel/gps/Makefile:1.53      Mon Apr 16 14:34:19 2018
+++ pkgsrc/devel/gps/Makefile   Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2018/04/16 14:34:19 wiz Exp $
+# $NetBSD: Makefile,v 1.54 2018/07/04 13:40:14 jperkin Exp $
 
 DISTNAME=      gps-${GPS_VERSION}
 PKGREVISION=   17
@@ -33,11 +33,11 @@ WRKSRC=                     ${WRKDIR}/gps-release-ide-${GP
 CONFIGURE_ARGS+=       --disable-shared --with-gmp=${PREFIX}
 
 SUBST_CLASSES+=        coll python
-SUBST_STAGE.coll=      post-patch
+SUBST_STAGE.coll=      pre-configure
 SUBST_FILES.coll=      gnatlib/src/gnatcoll_readline.gpr.in
 SUBST_SED.coll=                -e "s|@PREFIX@|${PREFIX}|g"
 SUBST_SED.coll+=       -e "s|-rpath|${LINKER_RPATH_FLAG}|g"
-SUBST_STAGE.python=    post-patch
+SUBST_STAGE.python=    pre-configure
 SUBST_FILES.python=    share/plug-ins/gps_utils/console_process.py
 SUBST_SED.python=      -e "s|/usr/bin/python|${PYTHONBIN}|"
 

Index: pkgsrc/devel/grantlee/Makefile
diff -u pkgsrc/devel/grantlee/Makefile:1.8 pkgsrc/devel/grantlee/Makefile:1.9
--- pkgsrc/devel/grantlee/Makefile:1.8  Mon Mar 12 11:15:27 2018
+++ pkgsrc/devel/grantlee/Makefile      Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2018/03/12 11:15:27 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:14 jperkin Exp $
 #
 
 DISTNAME=      grantlee-0.5.1
@@ -15,7 +15,7 @@ USE_LANGUAGES=  c c++
 USE_CMAKE=      yes
 
 SUBST_CLASSES+=                fix-inc
-SUBST_STAGE.fix-inc=   post-patch
+SUBST_STAGE.fix-inc=   pre-configure
 SUBST_MESSAGE.fix-inc= Fixing install dir for includes
 SUBST_FILES.fix-inc+=  CMakeLists.txt
 SUBST_SED.fix-inc+=    -e 's,INCLUDE_INSTALL_DIR include,INCLUDE_INSTALL_DIR include/grantlee-qt4,'

Index: pkgsrc/devel/lcov/Makefile
diff -u pkgsrc/devel/lcov/Makefile:1.9 pkgsrc/devel/lcov/Makefile:1.10
--- pkgsrc/devel/lcov/Makefile:1.9      Mon Apr 10 01:26:26 2017
+++ pkgsrc/devel/lcov/Makefile  Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2017/04/10 01:26:26 minskim Exp $
+# $NetBSD: Makefile,v 1.10 2018/07/04 13:40:14 jperkin Exp $
 #
 
 DISTNAME=      lcov-1.13
@@ -16,7 +16,7 @@ USE_TOOLS+=           perl
 REPLACE_PERL=          bin/gendesc bin/genhtml bin/geninfo bin/genpng bin/lcov
 
 SUBST_CLASSES+=                egdir
-SUBST_STAGE.egdir=      post-patch
+SUBST_STAGE.egdir=      pre-configure
 SUBST_FILES.egdir=     bin/genhtml
 SUBST_FILES.egdir+=    bin/geninfo
 SUBST_FILES.egdir+=    bin/lcov

Index: pkgsrc/devel/lemon/Makefile
diff -u pkgsrc/devel/lemon/Makefile:1.4 pkgsrc/devel/lemon/Makefile:1.5
--- pkgsrc/devel/lemon/Makefile:1.4     Tue Apr  3 19:58:19 2018
+++ pkgsrc/devel/lemon/Makefile Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2018/04/03 19:58:19 adam Exp $
+# $NetBSD: Makefile,v 1.5 2018/07/04 13:40:14 jperkin Exp $
 
 .include "../../databases/sqlite3/Makefile.common"
 
@@ -25,7 +25,7 @@ INSTALLATION_DIRS=    bin share/lemon share
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     lemon.c
 SUBST_SED.paths+=      -e 's,"lempar.c","${PREFIX}/share/lemon/lempar.c",g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 do-build:
        cd ${WRKSRC}/tool && ${CC} ${CFLAGS} ${LDFLAGS} lemon.c -o lemon

Index: pkgsrc/devel/libgphoto2/Makefile
diff -u pkgsrc/devel/libgphoto2/Makefile:1.69 pkgsrc/devel/libgphoto2/Makefile:1.70
--- pkgsrc/devel/libgphoto2/Makefile:1.69       Sat Mar 31 22:43:01 2018
+++ pkgsrc/devel/libgphoto2/Makefile    Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.69 2018/03/31 22:43:01 wiz Exp $
+# $NetBSD: Makefile,v 1.70 2018/07/04 13:40:14 jperkin Exp $
 
 DISTNAME=      libgphoto2-2.5.8
 PKGREVISION=   3
@@ -30,7 +30,7 @@ PLIST_VARS+=  libusb
 BUILDLINK_TRANSFORM.SunOS+=    opt:-Wl,--version-script=./libgphoto2_port.ver:-Wl,-M./libgphoto2_port.ver
 
 SUBST_CLASSES.SunOS+=  mapfile
-SUBST_STAGE.mapfile=   post-patch
+SUBST_STAGE.mapfile=   pre-configure
 SUBST_FILES.mapfile=   libgphoto2_port/libgphoto2_port/libgphoto2_port.ver
 SUBST_SED.mapfile=     -e '/gpi_gphoto_port_type_map/d'
 

Index: pkgsrc/devel/libmemmgr/Makefile
diff -u pkgsrc/devel/libmemmgr/Makefile:1.18 pkgsrc/devel/libmemmgr/Makefile:1.19
--- pkgsrc/devel/libmemmgr/Makefile:1.18        Sun Dec  8 16:18:35 2013
+++ pkgsrc/devel/libmemmgr/Makefile     Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2013/12/08 16:18:35 bsiegert Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:14 jperkin Exp $
 #
 
 DISTNAME=              MemMgr-1.04
@@ -15,7 +15,7 @@ INSTALLATION_DIRS=    include lib
 USE_TOOLS+=            groff
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_MESSAGE.prefix=  Fixing absolute paths.
 SUBST_FILES.prefix=    Makefile
 SUBST_SED.prefix=      -e 's|/usr/local|${PREFIX}|'

Index: pkgsrc/devel/mico/Makefile
diff -u pkgsrc/devel/mico/Makefile:1.8 pkgsrc/devel/mico/Makefile:1.9
--- pkgsrc/devel/mico/Makefile:1.8      Wed Apr 19 11:24:37 2017
+++ pkgsrc/devel/mico/Makefile  Wed Jul  4 13:40:14 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2017/04/19 11:24:37 jperkin Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:14 jperkin Exp $
 #
 
 #
@@ -20,7 +20,7 @@ GNU_CONFIGURE=                YES
 USE_LANGUAGES=         c c++
 
 SUBST_CLASSES+=                exampledir
-SUBST_STAGE.exampledir=        post-patch
+SUBST_STAGE.exampledir=        pre-configure
 SUBST_MESSAGE.exampledir=      Fixing up examples directory path
 SUBST_FILES.exampledir=                demo/ccm/Makefile demo/Makefile demo/MakeVars
 SUBST_FILES.exampledir+=       demo/csiv2/Makefile demo/csiv2/interop/Makefile

Index: pkgsrc/devel/mono-tools/Makefile
diff -u pkgsrc/devel/mono-tools/Makefile:1.88 pkgsrc/devel/mono-tools/Makefile:1.89
--- pkgsrc/devel/mono-tools/Makefile:1.88       Tue Apr 17 22:29:37 2018
+++ pkgsrc/devel/mono-tools/Makefile    Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.88 2018/04/17 22:29:37 wiz Exp $
+# $NetBSD: Makefile,v 1.89 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=      mono-tools-3.10
 PKGREVISION=   17
@@ -20,7 +20,7 @@ MAKE_JOBS_SAFE=               no
 CONFIGURE_ARGS+=       --mandir=${PKGMANDIR}
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/devel/monodevelop/Makefile
diff -u pkgsrc/devel/monodevelop/Makefile:1.95 pkgsrc/devel/monodevelop/Makefile:1.96
--- pkgsrc/devel/monodevelop/Makefile:1.95      Mon Apr 16 14:33:48 2018
+++ pkgsrc/devel/monodevelop/Makefile   Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.95 2018/04/16 14:33:48 wiz Exp $
+# $NetBSD: Makefile,v 1.96 2018/07/04 13:40:15 jperkin Exp $
 
 MD_VERSION=    5.0.1
 DISTNAME=      monodevelop-${MD_VERSION}-0
@@ -35,13 +35,13 @@ MAKE_OVERRIDE+=     src/addins/MonoDevelop.A
 MAKE_OVERRIDE+=        src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs
 
 SUBST_CLASSES+=                        fix-gmake
-SUBST_STAGE.fix-gmake=         post-patch
+SUBST_STAGE.fix-gmake=         pre-configure
 SUBST_MESSAGE.fix-gmake=       Fixing GNU make references
 SUBST_FILES.fix-gmake=         ${MAKE_OVERRIDE}
 SUBST_SED.fix-gmake=           -e 's,MAKEPROGRAM,${MAKE_PROGRAM},'
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/devel/noweb/Makefile
diff -u pkgsrc/devel/noweb/Makefile:1.41 pkgsrc/devel/noweb/Makefile:1.42
--- pkgsrc/devel/noweb/Makefile:1.41    Wed Oct 30 02:58:19 2013
+++ pkgsrc/devel/noweb/Makefile Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.41 2013/10/30 02:58:19 minskim Exp $
+# $NetBSD: Makefile,v 1.42 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=              noweb-2.11b
 PKGREVISION=           1
@@ -25,7 +25,7 @@ SUBST_FILES.mktemp+=  src/shell/roff.mm c
 SUBST_FILES.mktemp+=   contrib/jobling/correct-refs.nw
 SUBST_FILES.mktemp+=   contrib/norman/htmlgif/pstopbm
 SUBST_SED.mktemp+=     -e 's,@MKTEMP@,${TOOLS_PATH.mktemp},g'
-SUBST_STAGE.mktemp=    post-patch
+SUBST_STAGE.mktemp=    pre-configure
 
 .if ${OPSYS} != "SunOS"
 do-configure:

Index: pkgsrc/devel/nsis/Makefile
diff -u pkgsrc/devel/nsis/Makefile:1.17 pkgsrc/devel/nsis/Makefile:1.18
--- pkgsrc/devel/nsis/Makefile:1.17     Wed Nov 25 12:49:46 2015
+++ pkgsrc/devel/nsis/Makefile  Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2015/11/25 12:49:46 jperkin Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:15 jperkin Exp $
 #
 
 DISTNAME=      nsis-${NSIS_VER}
@@ -30,7 +30,7 @@ MAKENSIS_BIN= ${PREFIX}/share/nsis/maken
 INSTALLATION_DIRS=     bin share/nsis
 
 SUBST_CLASSES+=                makensis
-SUBST_STAGE.makensis=  post-patch
+SUBST_STAGE.makensis=  pre-configure
 SUBST_FILES.makensis=  makensis.sh
 SUBST_SED.makensis=    -e s,@@SH@@,${SH:Q},
 SUBST_SED.makensis+=   -e s,@@MAKENSIS@@,${MAKENSIS_BIN:Q},

Index: pkgsrc/devel/nss/Makefile
diff -u pkgsrc/devel/nss/Makefile:1.153 pkgsrc/devel/nss/Makefile:1.154
--- pkgsrc/devel/nss/Makefile:1.153     Thu Jun  7 19:04:59 2018
+++ pkgsrc/devel/nss/Makefile   Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.153 2018/06/07 19:04:59 ryoon Exp $
+# $NetBSD: Makefile,v 1.154 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=              nss-${NSS_RELEASE:S/.0$//}
 NSS_RELEASE=           3.37.3
@@ -59,7 +59,7 @@ MAKE_ENV.SunOS+=      CC_IS_CLANG=YES
 .endif
 
 SUBST_CLASSES+=                64bit
-SUBST_STAGE.64bit=     post-patch
+SUBST_STAGE.64bit=     pre-configure
 SUBST_FILES.64bit=     nss/lib/freebl/*
 SUBST_SED.64bit=       -e 's,NSS_USE_64,_LP64,g'
 SUBST_MESSAGE.conf=    Use a generic 64bit check

Index: pkgsrc/devel/pwlib/Makefile
diff -u pkgsrc/devel/pwlib/Makefile:1.69 pkgsrc/devel/pwlib/Makefile:1.70
--- pkgsrc/devel/pwlib/Makefile:1.69    Sun Sep  3 08:53:07 2017
+++ pkgsrc/devel/pwlib/Makefile Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.69 2017/09/03 08:53:07 wiz Exp $
+# $NetBSD: Makefile,v 1.70 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=      pwlib-v1_8_3-src
 PKGNAME=       pwlib-1.8.3
@@ -38,7 +38,7 @@ SUBST_SED.paths+=     -e 's,@BSD_INSTALL_LIB
 SUBST_SED.paths+=      -e 's,@BSD_INSTALL_PROGRAM@,${INSTALL_PROGRAM},g'
 SUBST_SED.paths+=      -e 's,@PTHREAD_FLAGS@,${PTHREAD_LDFLAGS} ${PTHREAD_LIBS},g'
 SUBST_SED.paths+=      -e 's,@LIBOSSAUDIO@,${LIBOSSAUDIO},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
        mkdir ${WRKSRC}/share

Index: pkgsrc/devel/rebar/Makefile
diff -u pkgsrc/devel/rebar/Makefile:1.9 pkgsrc/devel/rebar/Makefile:1.10
--- pkgsrc/devel/rebar/Makefile:1.9     Sun Jul 30 22:32:17 2017
+++ pkgsrc/devel/rebar/Makefile Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2017/07/30 22:32:17 wiz Exp $
+# $NetBSD: Makefile,v 1.10 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=      rebar-2.6.4
 CATEGORIES=    devel
@@ -18,7 +18,7 @@ do-install:
 SUBST_CLASSES+=                shebang
 SUBST_FILES.shebang=   src/rebar_escripter.erl
 SUBST_SED.shebang+=    -e 's,/usr/bin/env escript,${PREFIX}/bin/escript,'
-SUBST_STAGE.shebang=   post-patch
+SUBST_STAGE.shebang=   pre-configure
 
 .include "../../lang/erlang/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/devel/rox-lib/Makefile
diff -u pkgsrc/devel/rox-lib/Makefile:1.25 pkgsrc/devel/rox-lib/Makefile:1.26
--- pkgsrc/devel/rox-lib/Makefile:1.25  Tue Jul  3 05:03:14 2018
+++ pkgsrc/devel/rox-lib/Makefile       Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2018/07/03 05:03:14 adam Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=      rox-lib-2.0.2
 PKGREVISION=   14
@@ -30,7 +30,7 @@ INSTALLATION_DIRS=    share/rox/ROX-Lib2
 
 SUBST_CLASSES+=                path
 SUBST_MESSAGE.path=    Fixing hardcoded paths.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      python/rox/basedir.py
 SUBST_FILES.path+=     python/rox/choices.py
 SUBST_FILES.path+=     tests/python/testbasedir.py
@@ -39,7 +39,7 @@ SUBST_SED.path=               -e 's,/usr/local,${PREF
 
 SUBST_CLASSES+=                lib
 SUBST_MESSAGE.lib=     Fixing hardcoded paths for ROX-Lib.
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 SUBST_FILES.lib=       Help/findrox.py
 SUBST_SED.lib=         -e 's,/usr/local/lib,${PREFIX}/share/rox,g'
 

Index: pkgsrc/devel/rt3/Makefile.install
diff -u pkgsrc/devel/rt3/Makefile.install:1.21 pkgsrc/devel/rt3/Makefile.install:1.22
--- pkgsrc/devel/rt3/Makefile.install:1.21      Tue May 17 10:32:07 2016
+++ pkgsrc/devel/rt3/Makefile.install   Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.install,v 1.21 2016/05/17 10:32:07 fhajny Exp $
+# $NetBSD: Makefile.install,v 1.22 2018/07/04 13:40:15 jperkin Exp $
 
 .include "dirs.mk"
 
@@ -31,12 +31,12 @@ SUBST_STAGE.prefix= pre-configure
 SUBST_CLASSES+=                etcpath
 SUBST_FILES.etcpath=   sbin/rt-setup-database.in
 SUBST_SED.etcpath=     -e 's,\$$RT::EtcPath,"${RT_SHARE_DIR}/etc",'
-SUBST_STAGE.etcpath=   post-patch
+SUBST_STAGE.etcpath=   pre-configure
 
 SUBST_CLASSES+=                path
 SUBST_FILES.path=      bin/webmux.pl.in lib/RT/Interface/CLI.pm
 SUBST_SED.path=                -e 's,/bin:/usr/bin,/bin:/usr/bin:${PREFIX}/bin,'
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 
 SUBST_CLASSES+=                hardwired
 SUBST_FILES.hardwired= share/html/NoAuth/RichText/FCKeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl \
@@ -44,7 +44,7 @@ SUBST_FILES.hardwired=        share/html/NoAuth
                        etc/upgrade/shrink_transactions_table.pl \
                        etc/upgrade/upgrade-mysql-schema.pl
 SUBST_SED.hardwired=   -e 's,/usr/bin/perl,'${PERL5}','
-SUBST_STAGE.hardwired= post-patch
+SUBST_STAGE.hardwired= pre-configure
 
 RT_CONFIG_FILES=       RT_Config.pm RT_SiteConfig.pm
 

Index: pkgsrc/devel/slib/Makefile
diff -u pkgsrc/devel/slib/Makefile:1.37 pkgsrc/devel/slib/Makefile:1.38
--- pkgsrc/devel/slib/Makefile:1.37     Thu Sep 15 14:02:08 2016
+++ pkgsrc/devel/slib/Makefile  Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.37 2016/09/15 14:02:08 wiz Exp $
+# $NetBSD: Makefile,v 1.38 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=      slib-3b5
 #
@@ -29,7 +29,7 @@ INFO_FILES=   yes
 INSTALLATION_DIRS=     ${PKGINFODIR} share/slib share/doc/slib
 
 SUBST_CLASSES+=                scmpath
-SUBST_STAGE.scmpath=   post-patch
+SUBST_STAGE.scmpath=   pre-configure
 SUBST_FILES.scmpath=   guile.init
 SUBST_SED.scmpath=     -e "s|/usr/share/slib|${PREFIX}/share/slib|"
 

Index: pkgsrc/devel/sloccount/Makefile
diff -u pkgsrc/devel/sloccount/Makefile:1.2 pkgsrc/devel/sloccount/Makefile:1.3
--- pkgsrc/devel/sloccount/Makefile:1.2 Wed Sep  6 09:03:01 2017
+++ pkgsrc/devel/sloccount/Makefile     Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2017/09/06 09:03:01 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:15 jperkin Exp $
 
 
 DISTNAME=      sloccount-2.26
@@ -50,14 +50,14 @@ REPLACE_PERL+=              sql_count
 
 SUBST_CLASSES+=                generic
 SUBST_MESSAGE.generic= Fixing path to internal generic_count binary.
-SUBST_STAGE.generic=   post-patch
+SUBST_STAGE.generic=   pre-configure
 SUBST_SED.generic=     -e 's,^generic_count,${PREFIX}/libexec/sloccount/&,g'
 SUBST_FILES.generic=   ada_count awk_count csh_count exp_count lisp_count \
                        makefile_count ruby_count sed_count sh_count tcl_count
 
 SUBST_CLASSES+=                prefix
 SUBST_MESSAGE.prefix=  Fixing path to internal binaries.
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_SED.prefix=      -e 's,@PREFIX@,${PREFIX},g'
 SUBST_FILES.prefix=    compute_all compute_sloc_lang lex_count sloccount
 

Index: pkgsrc/devel/tcllib/Makefile
diff -u pkgsrc/devel/tcllib/Makefile:1.15 pkgsrc/devel/tcllib/Makefile:1.16
--- pkgsrc/devel/tcllib/Makefile:1.15   Sun Nov  6 19:55:15 2016
+++ pkgsrc/devel/tcllib/Makefile        Wed Jul  4 13:40:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2016/11/06 19:55:15 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:15 jperkin Exp $
 
 DISTNAME=              tcllib-1.18
 CATEGORIES=            devel
@@ -16,13 +16,13 @@ NO_BUILD=           yes
 CONFIGURE_ENV+=                ac_cv_path_tclsh=${TCLSH:Q}
 
 SUBST_CLASSES+=                fix
-SUBST_STAGE.fix=       post-patch
+SUBST_STAGE.fix=       pre-configure
 SUBST_FILES.fix=       modules/doctools/mpformats/_html.tcl
 SUBST_SED.fix=         -e "s,/usr/bin/wget -q -O,${FETCH_CMD:Q} -V -o,g"
 SUBST_MESSAGE.fix=     Fixing hardcoded ftp binary.
 
 SUBST_CLASSES+=                tclsh
-SUBST_STAGE.tclsh=     post-patch
+SUBST_STAGE.tclsh=     pre-configure
 SUBST_FILES.tclsh=     modules/pki/pki.tcl apps/dtplite apps/nns apps/nnsd\
 SUBST_FILES.tclsh+=    apps/nnslog apps/page apps/pt apps/tcldocstrip
 SUBST_SED.tclsh=       -e "s,/usr/bin/env.*tclsh,${TCLSH},g"

Index: pkgsrc/devel/tclreadline/Makefile
diff -u pkgsrc/devel/tclreadline/Makefile:1.7 pkgsrc/devel/tclreadline/Makefile:1.8
--- pkgsrc/devel/tclreadline/Makefile:1.7       Tue Dec 29 04:54:38 2015
+++ pkgsrc/devel/tclreadline/Makefile   Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2015/12/29 04:54:38 dholland Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:16 jperkin Exp $
 #
 
 DISTNAME=      tclreadline-2.1.0
@@ -23,7 +23,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     ${WRKSRC}/pkgIndex.tcl.in
 SUBST_FILES.paths+=    ${WRKSRC}/tclreadlineInit.tcl.in
 SUBST_FILES.paths+=    ${WRKSRC}/tclreadlineSetup.tcl.in
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_SED.paths=       -e 's,\/usr\/local,${PREFIX},'
 SUBST_SED.paths+=      -e 's,\/usr\/locanl,${PREFIX},'
 

Index: pkgsrc/devel/ucl/Makefile
diff -u pkgsrc/devel/ucl/Makefile:1.23 pkgsrc/devel/ucl/Makefile:1.24
--- pkgsrc/devel/ucl/Makefile:1.23      Mon Oct 12 23:19:40 2015
+++ pkgsrc/devel/ucl/Makefile   Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2015/10/12 23:19:40 agc Exp $
+# $NetBSD: Makefile,v 1.24 2018/07/04 13:40:16 jperkin Exp $
 #
 
 DISTNAME=      ucl-1.03
@@ -17,7 +17,7 @@ CONFIGURE_ARGS+=      --enable-shared=yes
 
 # Avoid path to build directory in example Makefile
 SUBST_CLASSES+=                example
-SUBST_STAGE.example=   post-patch
+SUBST_STAGE.example=   pre-configure
 SUBST_FILES.example=   examples/Makefile.in
 SUBST_SED.example=     -e "s|@MAKEINFO@||g"
 

Index: pkgsrc/devel/ucpp/Makefile
diff -u pkgsrc/devel/ucpp/Makefile:1.9 pkgsrc/devel/ucpp/Makefile:1.10
--- pkgsrc/devel/ucpp/Makefile:1.9      Wed Sep  6 10:40:26 2017
+++ pkgsrc/devel/ucpp/Makefile  Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2017/09/06 10:40:26 wiz Exp $
+# $NetBSD: Makefile,v 1.10 2018/07/04 13:40:16 jperkin Exp $
 
 DISTNAME=      ucpp-1.3.2
 CATEGORIES=    devel
@@ -17,7 +17,7 @@ INSTALLATION_DIRS=    bin ${PKGMANDIR}/man1
 
 CFLAGS+=       -DSTD_MACROS=0 -DSTD_ASSERT=0 -DNO_UCPP_BUF
 SUBST_CLASSES+=        config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    config.h
 # remove /usr/local/include from default path
 SUBST_SED.config=      -e 's|"/usr/local/include", ||'

Index: pkgsrc/devel/uno/Makefile
diff -u pkgsrc/devel/uno/Makefile:1.19 pkgsrc/devel/uno/Makefile:1.20
--- pkgsrc/devel/uno/Makefile:1.19      Fri Sep 16 21:36:43 2016
+++ pkgsrc/devel/uno/Makefile   Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2016/09/16 21:36:43 wiedi Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:16 jperkin Exp $
 #
 
 DISTNAME=              uno_v213
@@ -35,7 +35,7 @@ BUILDLINK_TRANSFORM+= rm:-m32
 .endif
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    makefile
 SUBST_SED.prefix=      -e "s,/usr/bin,${PREFIX}/bin,g"
 SUBST_MESSAGE.prefix=  Fixing hardcoded paths.

Index: pkgsrc/devel/vanessa_logger/Makefile
diff -u pkgsrc/devel/vanessa_logger/Makefile:1.9 pkgsrc/devel/vanessa_logger/Makefile:1.10
--- pkgsrc/devel/vanessa_logger/Makefile:1.9    Wed Oct 31 11:19:53 2012
+++ pkgsrc/devel/vanessa_logger/Makefile        Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2012/10/31 11:19:53 asau Exp $
+# $NetBSD: Makefile,v 1.10 2018/07/04 13:40:16 jperkin Exp $
 
 DISTNAME=      vanessa_logger-0.0.8
 CATEGORIES=    devel
@@ -17,7 +17,7 @@ GNU_CONFIGURE=                yes
 .include "../../mk/compiler.mk"
 .if !empty(PKGSRC_COMPILER:Msunpro)
 SUBST_CLASSES+=                        __function__
-SUBST_STAGE.__function__=      post-patch
+SUBST_STAGE.__function__=      pre-configure
 SUBST_FILES.__function__=      libvanessa_logger/vanessa_logger.h
 SUBST_SED.__function__=                -e "s|__FUNCTION__|__FILE__|g"
 .endif

Index: pkgsrc/devel/zookeeper/Makefile
diff -u pkgsrc/devel/zookeeper/Makefile:1.5 pkgsrc/devel/zookeeper/Makefile:1.6
--- pkgsrc/devel/zookeeper/Makefile:1.5 Wed Sep  6 11:12:19 2017
+++ pkgsrc/devel/zookeeper/Makefile     Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2017/09/06 11:12:19 fhajny Exp $
+# $NetBSD: Makefile,v 1.6 2018/07/04 13:40:16 jperkin Exp $
 #
 
 .include "Makefile.common"
@@ -43,7 +43,7 @@ BUILDDIR=             ${WRKSRC}/build/${DISTNAME}
 EGDIR=                 share/examples/zookeeper
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_MESSAGE.paths=   Fixing ZooKeeper default paths
 SUBST_FILES.paths=     conf/zoo_sample.cfg
 SUBST_FILES.paths+=    src/packages/templates/conf/zookeeper-env.sh

Index: pkgsrc/devel/zzuf/Makefile
diff -u pkgsrc/devel/zzuf/Makefile:1.6 pkgsrc/devel/zzuf/Makefile:1.7
--- pkgsrc/devel/zzuf/Makefile:1.6      Mon Oct  2 13:36:32 2017
+++ pkgsrc/devel/zzuf/Makefile  Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2017/10/02 13:36:32 wiedi Exp $
+# $NetBSD: Makefile,v 1.7 2018/07/04 13:40:16 jperkin Exp $
 #
 
 DISTNAME=      zzuf-0.15
@@ -22,7 +22,7 @@ SUBST_CLASSES+=               fix-paths
 SUBST_FILES.fix-paths= doc/libzzuf.3.in
 SUBST_MESSAGE.fix-paths=Fixing hard-coded pathnames
 SUBST_SED.fix-paths=   -e 's,/usr,${PREFIX},g'
-SUBST_STAGE.fix-paths= post-patch
+SUBST_STAGE.fix-paths= pre-configure
 
 .include "../../mk/bsd.fast.prefs.mk"
 

Index: pkgsrc/editors/TeXmacs/Makefile
diff -u pkgsrc/editors/TeXmacs/Makefile:1.118 pkgsrc/editors/TeXmacs/Makefile:1.119
--- pkgsrc/editors/TeXmacs/Makefile:1.118       Tue Apr 17 22:29:37 2018
+++ pkgsrc/editors/TeXmacs/Makefile     Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.118 2018/04/17 22:29:37 wiz Exp $
+# $NetBSD: Makefile,v 1.119 2018/07/04 13:40:16 jperkin Exp $
 #
 # changelog at http://www.texmacs.org/tmweb/about/changes.en.html
 
@@ -35,7 +35,7 @@ REPLACE_PYTHON+=      plugins/sage/bin/tm_sag
 REPLACE_PYTHON+=       plugins/mathematica/bin/realpath.py
 
 SUBST_CLASSES+=                init
-SUBST_STAGE.init=      post-patch
+SUBST_STAGE.init=      pre-configure
 SUBST_FILES.init=      plugins/python/progs/init-python.scm
 SUBST_SED.init=                -e 's,@PYTHONBIN@,${PYTHONBIN},g'
 

Index: pkgsrc/editors/lpe/Makefile
diff -u pkgsrc/editors/lpe/Makefile:1.25 pkgsrc/editors/lpe/Makefile:1.26
--- pkgsrc/editors/lpe/Makefile:1.25    Wed Aug 16 20:45:36 2017
+++ pkgsrc/editors/lpe/Makefile Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2017/08/16 20:45:36 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:16 jperkin Exp $
 #
 
 DISTNAME=      lpe-1.2.6
@@ -26,7 +26,7 @@ MAKE_ENV=             EXPORT_SYMBOLS_LDFLAGS="${EXP
 CFLAGS=                        -DPREFIX="\"${PREFIX}\""
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     man/lpe.1.cs man/lpe.1.de man/lpe.1.en man/lpe.1.es
 SUBST_SED.paths=       -e 's,@PREFIX@,${PREFIX},'
 

Index: pkgsrc/editors/rox-edit/Makefile
diff -u pkgsrc/editors/rox-edit/Makefile:1.10 pkgsrc/editors/rox-edit/Makefile:1.11
--- pkgsrc/editors/rox-edit/Makefile:1.10       Sat May 17 16:10:44 2014
+++ pkgsrc/editors/rox-edit/Makefile    Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2014/05/17 16:10:44 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:16 jperkin Exp $
 #
 
 DISTNAME=      edit-2.0
@@ -27,7 +27,7 @@ INSTALLATION_DIRS=    share/rox/Edit
 
 SUBST_CLASSES+=                lib
 SUBST_MESSAGE.lib=     Fixing hardcoded paths for ROX-Lib.
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 SUBST_FILES.lib=       findrox.py
 SUBST_SED.lib=         -e 's,/usr/local/lib,${PREFIX}/share/rox,g'
 

Index: pkgsrc/editors/tomboy/Makefile
diff -u pkgsrc/editors/tomboy/Makefile:1.86 pkgsrc/editors/tomboy/Makefile:1.87
--- pkgsrc/editors/tomboy/Makefile:1.86 Tue Apr 17 22:29:38 2018
+++ pkgsrc/editors/tomboy/Makefile      Wed Jul  4 13:40:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.86 2018/04/17 22:29:38 wiz Exp $
+# $NetBSD: Makefile,v 1.87 2018/07/04 13:40:16 jperkin Exp $
 
 DISTNAME=              tomboy-1.2.1
 PKGREVISION=           59
@@ -21,7 +21,7 @@ PKGCONFIG_OVERRIDE+=  data/tomboy-addins.
 REPLACE_BASH+=         Tomboy/tomboy.in Tomboy/tomboy-panel.in
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/editors/vim-share/Makefile.common
diff -u pkgsrc/editors/vim-share/Makefile.common:1.161 pkgsrc/editors/vim-share/Makefile.common:1.162
--- pkgsrc/editors/vim-share/Makefile.common:1.161      Sun Mar  4 16:26:24 2018
+++ pkgsrc/editors/vim-share/Makefile.common    Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.161 2018/03/04 16:26:24 wiz Exp $
+# $NetBSD: Makefile.common,v 1.162 2018/07/04 13:40:17 jperkin Exp $
 
 # used by editors/vim/Makefile
 # used by editors/vim-gtk2/Makefile
@@ -60,7 +60,7 @@ ALTERNATIVES_SRC=
 
 SUBST_CLASSES+=                sysconfdir
 SUBST_FILES.sysconfdir=        feature.h
-SUBST_STAGE.sysconfdir=        post-patch
+SUBST_STAGE.sysconfdir=        pre-configure
 SUBST_VARS.sysconfdir= PKG_SYSCONFDIR
 
 post-patch:

Index: pkgsrc/emulators/dosbox/Makefile
diff -u pkgsrc/emulators/dosbox/Makefile:1.44 pkgsrc/emulators/dosbox/Makefile:1.45
--- pkgsrc/emulators/dosbox/Makefile:1.44       Sat Sep 16 03:27:20 2017
+++ pkgsrc/emulators/dosbox/Makefile    Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.44 2017/09/16 03:27:20 maya Exp $
+# $NetBSD: Makefile,v 1.45 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=      dosbox-0.74
 PKGREVISION=   10
@@ -22,7 +22,7 @@ LDFLAGS.SunOS+=               -lsocket
 INSTALLATION_DIRS=     share/doc/dosbox
 
 SUBST_CLASSES+=                fixme
-SUBST_STAGE.fixme=     post-patch
+SUBST_STAGE.fixme=     pre-configure
 SUBST_FILES.fixme=     docs/dosbox.1
 SUBST_SED.fixme=       -e s,/usr/share/,${PREFIX}/share/,g
 

Index: pkgsrc/emulators/dynagen/Makefile
diff -u pkgsrc/emulators/dynagen/Makefile:1.7 pkgsrc/emulators/dynagen/Makefile:1.8
--- pkgsrc/emulators/dynagen/Makefile:1.7       Tue Aug  1 16:47:38 2017
+++ pkgsrc/emulators/dynagen/Makefile   Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2017/08/01 16:47:38 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=      dynagen-0.11.0
 PKGREVISION=   4
@@ -18,7 +18,7 @@ REPLACE_PYTHON+= dynagen confConsole.py 
                pemubin.py pemuwrapper.py
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     dynagen
 SUBST_SED.paths=       -e "s|@SYSCONFDIR@|${PKG_SYSCONFDIR}|"
 SUBST_SED.paths+=      -e "s|@PREFIX@|${PREFIX}|"

Index: pkgsrc/emulators/dynamips/Makefile
diff -u pkgsrc/emulators/dynamips/Makefile:1.12 pkgsrc/emulators/dynamips/Makefile:1.13
--- pkgsrc/emulators/dynamips/Makefile:1.12     Wed Jan 17 20:22:36 2018
+++ pkgsrc/emulators/dynamips/Makefile  Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2018/01/17 20:22:36 markd Exp $
+# $NetBSD: Makefile,v 1.13 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=      dynamips-0.2.17
 CATEGORIES=    emulators
@@ -15,7 +15,7 @@ USE_TOOLS+=   gmake
 USE_CMAKE=     yes
 
 SUBST_CLASSES+=                libelf
-SUBST_STAGE.libelf=    post-patch
+SUBST_STAGE.libelf=    pre-configure
 SUBST_FILES.libelf=    common/dynamips.h common/rom2c.c
 SUBST_SED.libelf=      -e 's,<libelf.h>,<libelf/libelf.h>,'
 SUBST_MESSAGE.libelf=  Fix libelf header file path

Index: pkgsrc/emulators/emulationstation/Makefile
diff -u pkgsrc/emulators/emulationstation/Makefile:1.14 pkgsrc/emulators/emulationstation/Makefile:1.15
--- pkgsrc/emulators/emulationstation/Makefile:1.14     Sun Apr 29 21:31:35 2018
+++ pkgsrc/emulators/emulationstation/Makefile  Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2018/04/29 21:31:35 adam Exp $
+# $NetBSD: Makefile,v 1.15 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=      abba19584636c28cd98e3810e857f493cb63d06c
 PKGNAME=       emulationstation-2.0.0_rc1_20150210
@@ -22,19 +22,19 @@ WRKSRC=             ${WRKDIR}/EmulationStation-${DI
 INSTALLATION_DIRS=     bin share/doc/emulationstation
 
 SUBST_CLASSES+=                fceu
-SUBST_STAGE.fceu=      post-patch
+SUBST_STAGE.fceu=      pre-configure
 SUBST_MESSAGE.fceu=    Adjusting config file path to retroarch backend
 SUBST_FILES.fceu=      es-app/src/SystemData.cpp
 SUBST_SED.fceu=                -e "s|~/cores/libretro-fceumm.so|${PREFIX}/lib/libretro/fceumm_libretro.so|"
 
 SUBST_CLASSES+=                ra
-SUBST_STAGE.ra=                post-patch
+SUBST_STAGE.ra=                pre-configure
 SUBST_MESSAGE.ra=      Adjusting path to retroarch backends in documentation
 SUBST_FILES.ra=                SYSTEMS.md
 SUBST_SED.ra=          -e "s|/usr|${PREFIX}|"
 
 SUBST_CLASSES+=                etc
-SUBST_STAGE.etc=       post-patch
+SUBST_STAGE.etc=       pre-configure
 SUBST_MESSAGE.etc=     Adjusting path to global configuration files
 SUBST_FILES.etc=       es-app/src/SystemData.cpp es-core/src/ThemeData.cpp
 SUBST_FILES.etc+=      GAMELISTS.md README.md THEMES.md

Index: pkgsrc/emulators/fceu/Makefile
diff -u pkgsrc/emulators/fceu/Makefile:1.20 pkgsrc/emulators/fceu/Makefile:1.21
--- pkgsrc/emulators/fceu/Makefile:1.20 Sat Apr 25 14:20:44 2015
+++ pkgsrc/emulators/fceu/Makefile      Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2015/04/25 14:20:44 tnn Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:17 jperkin Exp $
 #
 
 DISTNAME=              fceu-0.98.13.src
@@ -17,7 +17,7 @@ USE_PKGLOCALEDIR=     yes
 GNU_CONFIGURE=         yes
 
 SUBST_CLASSES+=                dsp
-SUBST_STAGE.dsp=       post-patch
+SUBST_STAGE.dsp=       pre-configure
 SUBST_MESSAGE.dsp=     Adjusting sound device path.
 SUBST_FILES.dsp=       src/drivers/sexyal/drivers/oss.c
 SUBST_SED.dsp=         -e "s|/dev/dsp|${DEVOSSAUDIO}|"

Index: pkgsrc/emulators/gxemul/Makefile
diff -u pkgsrc/emulators/gxemul/Makefile:1.59 pkgsrc/emulators/gxemul/Makefile:1.60
--- pkgsrc/emulators/gxemul/Makefile:1.59       Thu Aug 24 22:52:55 2017
+++ pkgsrc/emulators/gxemul/Makefile    Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.59 2017/08/24 22:52:55 mrg Exp $
+# $NetBSD: Makefile,v 1.60 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=      gxemul-0.6.0.1
 PKGREVISION=   6
@@ -37,7 +37,7 @@ PKG_SUGGESTED_OPTIONS=        x11
 .if !empty(PKG_OPTIONS:Mx11)
 GLOBAL_LDFLAGS=                -L${X11BASE}/lib ${COMPILER_RPATH_FLAG}${X11BASE}/lib
 SUBST_CLASSES+=                x11
-SUBST_STAGE.x11=       post-patch
+SUBST_STAGE.x11=       pre-configure
 SUBST_FILES.x11=       configure
 SUBST_SED.x11=         -e 's|-L/usr/X11R6/lib|${GLOBAL_LDFLAGS:Q}|g'
 SUBST_SED.x11+=                -e 's|/usr/X11R6|${X11BASE}|g'

Index: pkgsrc/emulators/pearpc/Makefile
diff -u pkgsrc/emulators/pearpc/Makefile:1.20 pkgsrc/emulators/pearpc/Makefile:1.21
--- pkgsrc/emulators/pearpc/Makefile:1.20       Sat Mar 17 01:27:55 2018
+++ pkgsrc/emulators/pearpc/Makefile    Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2018/03/17 01:27:55 ryoon Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=              pearpc-0.5
 CATEGORIES=            emulators
@@ -40,7 +40,7 @@ do-install:
        ${INSTALL_DATA} ${WRKSRC}/ppccfg.example ${DESTDIR}${EGDIR}
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      ppccfg.example
 SUBST_SED.conf=                -e "s|\"nvram\"|\"/tmp/nvram\"|"
 SUBST_MESSAGE.conf=    Fixing configuration file.

Index: pkgsrc/emulators/simulavr/Makefile
diff -u pkgsrc/emulators/simulavr/Makefile:1.25 pkgsrc/emulators/simulavr/Makefile:1.26
--- pkgsrc/emulators/simulavr/Makefile:1.25     Tue Aug 18 07:31:07 2015
+++ pkgsrc/emulators/simulavr/Makefile  Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2015/08/18 07:31:07 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:17 jperkin Exp $
 #
 DISTNAME=              simulavr-1.0.0
 PKGREVISION=           3
@@ -35,7 +35,7 @@ INFO_FILES=           yes
 
 # Interim fix
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_MESSAGE.prefix=  Fix include path finding Python.h
 SUBST_FILES.prefix=    src/Makefile.in
 SUBST_VARS.prefix=     PREFIX
@@ -44,7 +44,7 @@ SUBST_VARS.prefix=    PREFIX
 # See also
 #  http://savannah.nongnu.org/bugs/?35737
 SUBST_CLASSES+=                compare2
-SUBST_STAGE.compare2=  post-patch
+SUBST_STAGE.compare2=  pre-configure
 SUBST_MESSAGE.compare2=        Convert poisoned SIG_OUTPUT_COMPARE2 to TIMER2_COMP_vect
 SUBST_FILES.compare2=  examples/atmega128_timer/main.c
 SUBST_FILES.compare2+= examples/python/example.c
@@ -58,14 +58,14 @@ SUBST_SED.compare2= -e 's/SIG_OUTPUT_COM
 # kb.c:39:8: error: attempt to use poisoned "SIG_INTERRUPT0"
 
 SUBST_CLASSES+=                uart0
-SUBST_STAGE.uart0=     post-patch
+SUBST_STAGE.uart0=     pre-configure
 SUBST_MESSAGE.uart0=   Convert poisoned SIG_UART0_RECV to USART0_RX_vect
 SUBST_FILES.uart0=     examples/atmel_key/StdDefs.h
 SUBST_SED.uart0=       -e 's/SIG_UART0_RECV/USART0_RX_vect/g'
 SUBST_SED.uart0+=      -e 's/SIG_UART0_DATA/USART0_UDRE_vect/g'
 
 SUBST_CLASSES+=                intrpt0
-SUBST_STAGE.intrpt0=   post-patch
+SUBST_STAGE.intrpt0=   pre-configure
 SUBST_MESSAGE.intrpt0= Convert poisoned SIG_INTERRUPT0 to INT0_vect
 SUBST_FILES.intrpt0=   examples/atmel_key/kb.c
 SUBST_FILES.intrpt0+=  examples/python/multicore.c

Index: pkgsrc/emulators/ski/Makefile
diff -u pkgsrc/emulators/ski/Makefile:1.25 pkgsrc/emulators/ski/Makefile:1.26
--- pkgsrc/emulators/ski/Makefile:1.25  Mon Apr 16 14:34:26 2018
+++ pkgsrc/emulators/ski/Makefile       Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2018/04/16 14:34:26 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:17 jperkin Exp $
 #
 
 DISTNAME=      ski-1.3.2
@@ -36,7 +36,7 @@ SUBST_FILES.xski-app= Makefile.am
 SUBST_SED.xski-app=    -e 's,/etc/X11/app-defaults,${PREFIX}/lib/X11/app-defaults,g'
 
 SUBST_CLASSES+=                ssx-app
-SUBST_STAGE.ssx-app=   post-patch
+SUBST_STAGE.ssx-app=   pre-configure
 SUBST_MESSAGE.ssx-app= Fixing X11 ssX.c app-default paths.
 SUBST_FILES.ssx-app=   src/ssX.c
 SUBST_SED.ssx-app=     -e 's,XSKI_RESOURCE_FILE,${PREFIX}/lib/X11/app-defaults/XSki,g'

Index: pkgsrc/emulators/spim/Makefile
diff -u pkgsrc/emulators/spim/Makefile:1.43 pkgsrc/emulators/spim/Makefile:1.44
--- pkgsrc/emulators/spim/Makefile:1.43 Wed Oct  3 12:55:18 2012
+++ pkgsrc/emulators/spim/Makefile      Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.43 2012/10/03 12:55:18 asau Exp $
+# $NetBSD: Makefile,v 1.44 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=      spim-8.0
 PKGREVISION=   1
@@ -19,7 +19,7 @@ USE_TOOLS+=           gzip flex yacc
 INSTALL_TARGET=                install
 
 SUBST_CLASSES+=                cpudir
-SUBST_STAGE.cpudir=    post-patch
+SUBST_STAGE.cpudir=    pre-configure
 SUBST_MESSAGE.cpudir=  rename CPU_DIR
 SUBST_FILES.cpudir=    spim/Makefile xspim/Imakefile
 SUBST_SED.cpudir=      -e s:CPU_DIR:CPUDIR:

Index: pkgsrc/emulators/tuxnes/Makefile
diff -u pkgsrc/emulators/tuxnes/Makefile:1.15 pkgsrc/emulators/tuxnes/Makefile:1.16
--- pkgsrc/emulators/tuxnes/Makefile:1.15       Wed Mar  7 11:57:29 2018
+++ pkgsrc/emulators/tuxnes/Makefile    Wed Jul  4 13:40:17 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2018/03/07 11:57:29 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:17 jperkin Exp $
 
 DISTNAME=              tuxnes-0.75
 PKGREVISION=           4
@@ -17,13 +17,13 @@ USE_TOOLS+=         gmake
 GNU_CONFIGURE=         yes
 
 SUBST_CLASSES+=                dsp
-SUBST_STAGE.dsp=       post-patch
+SUBST_STAGE.dsp=       pre-configure
 SUBST_MESSAGE.dsp=     Adjusting sound device path.
 SUBST_FILES.dsp=       consts.h
 SUBST_SED.dsp=         -e "s|/dev/dsp|${DEVOSSAUDIO}|"
 
 SUBST_CLASSES.SunOS+=  gld
-SUBST_STAGE.gld=       post-patch
+SUBST_STAGE.gld=       pre-configure
 SUBST_MESSAGE.gld=     Using GNU ld to create table.o
 SUBST_FILES.gld=       Makefile.in
 SUBST_SED.gld=         -e "/ld -r/s/ld/gld/"

Index: pkgsrc/emulators/xbeeb/Makefile
diff -u pkgsrc/emulators/xbeeb/Makefile:1.30 pkgsrc/emulators/xbeeb/Makefile:1.31
--- pkgsrc/emulators/xbeeb/Makefile:1.30        Tue Mar  6 15:50:44 2018
+++ pkgsrc/emulators/xbeeb/Makefile     Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2018/03/06 15:50:44 wiz Exp $
+# $NetBSD: Makefile,v 1.31 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      xbeeb-0.4.1
 PKGREVISION=   3
@@ -31,13 +31,13 @@ INSTALLATION_DIRS=  bin ${PKGMANDIR}/man1
 .if ${OSS_TYPE} != "none"
 
 SUBST_CLASSES+=                dsp
-SUBST_STAGE.dsp=       post-patch
+SUBST_STAGE.dsp=       pre-configure
 SUBST_MESSAGE.dsp=     Adjusting sound device path
 SUBST_FILES.dsp=       src/SoundOSS.c
 SUBST_SED.dsp=         -e "s|\"/dev/dsp\"|\"${DEVOSSAUDIO}\"|"
 
 SUBST_CLASSES+=                osslib
-SUBST_STAGE.osslib=    post-patch
+SUBST_STAGE.osslib=    pre-configure
 SUBST_MESSAGE.osslib=  Linking OSS library
 SUBST_FILES.osslib=    src/Imakefile
 SUBST_SED.osslib=      -e "s|\\(SYS_LIBRARIES[  ]*=.*\\)|\\1 ${LIBOSSAUDIO}|"
@@ -45,7 +45,7 @@ SUBST_SED.osslib=     -e "s|\\(SYS_LIBRARIES
 .else
 
 SUBST_CLASSES+=                nooss
-SUBST_STAGE.nooss=     post-patch
+SUBST_STAGE.nooss=     pre-configure
 SUBST_MESSAGE.nooss=   Disabling sound support: No OSS on this platform
 SUBST_FILES.nooss=     src/Config.h
 SUBST_SED.nooss=       -e "s|^\#define\\([      ]*SOUND_OSS.*\\)\$$|\#undef\\1|"
@@ -53,7 +53,7 @@ SUBST_SED.nooss=      -e "s|^\#define\\([      ]*
 .endif # OSS_TYPE
 
 SUBST_CLASSES+=                beebroot
-SUBST_STAGE.beebroot=  post-patch
+SUBST_STAGE.beebroot=  pre-configure
 SUBST_MESSAGE.beebroot=        Adjusting XBEEBROOT path
 SUBST_FILES.beebroot=  src/Config.h
 SUBST_SED.beebroot=    -e "s|^\\(\#define[      ]*XBEEBROOT[    ]*\\)[^         ].*\$$|\\1\"${PREFIX}/${XBEEBROOT}/\"|"

Index: pkgsrc/emulators/xbeeb/options.mk
diff -u pkgsrc/emulators/xbeeb/options.mk:1.3 pkgsrc/emulators/xbeeb/options.mk:1.4
--- pkgsrc/emulators/xbeeb/options.mk:1.3       Wed Mar  7 11:57:29 2018
+++ pkgsrc/emulators/xbeeb/options.mk   Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.3 2018/03/07 11:57:29 wiz Exp $
+# $NetBSD: options.mk,v 1.4 2018/07/04 13:40:18 jperkin Exp $
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -10,7 +10,7 @@ PKG_SUGGESTED_OPTIONS=
 # Unfortunately it doesn't support both at once.
 .if empty(PKG_OPTIONS:Mmitshm)
 SUBST_CLASSES+=                nomitshm
-SUBST_STAGE.nomitshm=  post-patch
+SUBST_STAGE.nomitshm=  pre-configure
 SUBST_MESSAGE.nomitshm=        Disabling MIT-SHM
 SUBST_FILES.nomitshm=  src/Config.h
 SUBST_SED.nomitshm=    -e "s|\#define  *MITSHM|\#undef MITSHM|"

Index: pkgsrc/filesystems/fuse-afpfs-ng/Makefile
diff -u pkgsrc/filesystems/fuse-afpfs-ng/Makefile:1.13 pkgsrc/filesystems/fuse-afpfs-ng/Makefile:1.14
--- pkgsrc/filesystems/fuse-afpfs-ng/Makefile:1.13      Wed Jan  1 11:52:15 2014
+++ pkgsrc/filesystems/fuse-afpfs-ng/Makefile   Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2014/01/01 11:52:15 wiz Exp $
+# $NetBSD: Makefile,v 1.14 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      afpfs-ng-0.8.1
 PKGNAME=       fuse-${DISTNAME}
@@ -21,7 +21,7 @@ REPLACE_SH+=  fuse/afpfs
 .include "../../mk/readline.buildlink3.mk"
 
 SUBST_CLASSES+=                termcap
-SUBST_STAGE.termcap=   post-patch
+SUBST_STAGE.termcap=   pre-configure
 SUBST_FILES.termcap=   configure.ac configure cmdline/Makefile.*
 .if ${TERMCAP_TYPE} == none
 SUBST_SED.termcap+=    -e 's|ncurses||'

Index: pkgsrc/filesystems/fuse-gmailfs/Makefile
diff -u pkgsrc/filesystems/fuse-gmailfs/Makefile:1.15 pkgsrc/filesystems/fuse-gmailfs/Makefile:1.16
--- pkgsrc/filesystems/fuse-gmailfs/Makefile:1.15       Tue Jul  3 05:03:16 2018
+++ pkgsrc/filesystems/fuse-gmailfs/Makefile    Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2018/07/03 05:03:16 adam Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      gmailfs-0.7.2
 PKGREVISION=   3
@@ -18,7 +18,7 @@ CONF_FILES=           ${PREFIX}/share/examples/gm
                        ${PKG_SYSCONFDIR}/gmailfs.conf
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    gmailfs.py mount.gmailfs
 SUBST_SED.config=      -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
 SUBST_SED.config+=     -e "s|@PREFIX@|${PREFIX}|g"

Index: pkgsrc/filesystems/fuse-svnfs/Makefile
diff -u pkgsrc/filesystems/fuse-svnfs/Makefile:1.39 pkgsrc/filesystems/fuse-svnfs/Makefile:1.40
--- pkgsrc/filesystems/fuse-svnfs/Makefile:1.39 Sat Apr 14 07:34:20 2018
+++ pkgsrc/filesystems/fuse-svnfs/Makefile      Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2018/04/14 07:34:20 adam Exp $
+# $NetBSD: Makefile,v 1.40 2018/07/04 13:40:18 jperkin Exp $
 #
 
 DISTNAME=      svnfs-0.4
@@ -22,7 +22,7 @@ REPLACE_PERL= svn-config.pl
 SUBST_CLASSES+=                svn
 SUBST_FILES.svn=       svn-config.pl
 SUBST_MESSAGE.svn=     Fixing subversion pathnames in ${SUBST_FILES.svn}
-SUBST_STAGE.svn=       post-patch
+SUBST_STAGE.svn=       pre-configure
 SUBST_VARS.svn=                LOCALBASE
 
 BUILDLINK_ABI_DEPENDS.subversion-base+=        subversion-base>=1.4.3nb2

Index: pkgsrc/filesystems/fuse-wikipediafs/Makefile
diff -u pkgsrc/filesystems/fuse-wikipediafs/Makefile:1.19 pkgsrc/filesystems/fuse-wikipediafs/Makefile:1.20
--- pkgsrc/filesystems/fuse-wikipediafs/Makefile:1.19   Tue Jul  3 05:03:16 2018
+++ pkgsrc/filesystems/fuse-wikipediafs/Makefile        Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2018/07/03 05:03:16 adam Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      wikipediafs-0.4
 PKGNAME=       fuse-${DISTNAME}
@@ -14,7 +14,7 @@ PYTHON_VERSIONS_INCOMPATIBLE= 34 35 36 3
 EGG_NAME=      wikipediafs-0.0.0
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    setup.py
 SUBST_SED.config+=     -e "s|/usr/share/man/man1/|${PKGMANDIR}/man1/|g"
 SUBST_MESSAGE.config=   Fixing paths.

Index: pkgsrc/finance/tclticker/Makefile
diff -u pkgsrc/finance/tclticker/Makefile:1.18 pkgsrc/finance/tclticker/Makefile:1.19
--- pkgsrc/finance/tclticker/Makefile:1.18      Thu Oct  9 14:06:32 2014
+++ pkgsrc/finance/tclticker/Makefile   Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2014/10/09 14:06:32 wiz Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:18 jperkin Exp $
 #
 
 DISTNAME=      tclticker-1.1
@@ -18,7 +18,7 @@ NO_BUILD=     yes
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths and command names.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     tclticker mailquote
 SUBST_SED.paths=       -e 's|@PREFIX@|${PREFIX}|g'
 

Index: pkgsrc/fonts/t1lib/Makefile
diff -u pkgsrc/fonts/t1lib/Makefile:1.51 pkgsrc/fonts/t1lib/Makefile:1.52
--- pkgsrc/fonts/t1lib/Makefile:1.51    Thu Oct  9 14:06:33 2014
+++ pkgsrc/fonts/t1lib/Makefile Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.51 2014/10/09 14:06:33 wiz Exp $
+# $NetBSD: Makefile,v 1.52 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      t1lib-5.1.2
 PKGREVISION=   6
@@ -38,7 +38,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     t1lib.config.sample
 SUBST_SED.paths=       -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.paths+=      -e 's,@LOCALBASE@,${LOCALBASE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
        ${CP} ${FILESDIR}/t1lib.config.sample ${WRKSRC}

Index: pkgsrc/games/0verkill/Makefile
diff -u pkgsrc/games/0verkill/Makefile:1.11 pkgsrc/games/0verkill/Makefile:1.12
--- pkgsrc/games/0verkill/Makefile:1.11 Sun Jul 30 22:37:57 2017
+++ pkgsrc/games/0verkill/Makefile      Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2017/07/30 22:37:57 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      0verkill-0.16
 PKGREVISION=   1
@@ -16,13 +16,13 @@ INSTALLATION_DIRS=  bin share/0verkill sh
 INSTALLATION_DIRS+=    share/0verkill/data share/0verkill/grx
 
 SUBST_CLASSES+=                grx
-SUBST_STAGE.grx=       post-patch
+SUBST_STAGE.grx=       pre-configure
 SUBST_MESSAGE.grx=     Fix game data paths
 SUBST_FILES.grx=       data/sprites.dat data/level1.sp data/level2.sp
 SUBST_SED.grx=         -e "s|grx/|${PREFIX}/share/0verkill/grx/|g"
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_MESSAGE.prefix=  Fix game configuration path prefix
 SUBST_FILES.prefix=    cfg.h
 SUBST_SED.prefix=      -e "s|@PREFIX@|${PREFIX}|g"

Index: pkgsrc/games/blindmine/Makefile
diff -u pkgsrc/games/blindmine/Makefile:1.29 pkgsrc/games/blindmine/Makefile:1.30
--- pkgsrc/games/blindmine/Makefile:1.29        Tue Jul  3 05:03:17 2018
+++ pkgsrc/games/blindmine/Makefile     Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2018/07/03 05:03:17 adam Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      blindmine-0.3-src
 PKGNAME=       ${DISTNAME:S/-src//}
@@ -17,7 +17,7 @@ NO_BUILD=     yes
 
 SUBST_CLASSES+=                path
 SUBST_MESSAGE.path=    Fixing paths.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      blindmine.py sdl_ui.py
 SUBST_SED.path=                -e 's,/usr/bin/env python,${PYTHONBIN},g'
 

Index: pkgsrc/games/bzflag/Makefile
diff -u pkgsrc/games/bzflag/Makefile:1.61 pkgsrc/games/bzflag/Makefile:1.62
--- pkgsrc/games/bzflag/Makefile:1.61   Sun Apr 29 21:31:36 2018
+++ pkgsrc/games/bzflag/Makefile        Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.61 2018/04/29 21:31:36 adam Exp $
+# $NetBSD: Makefile,v 1.62 2018/07/04 13:40:18 jperkin Exp $
 
 DISTNAME=      bzflag-2.4.2
 PKGREVISION=   15
@@ -21,7 +21,7 @@ USE_CURSES=   resizeterm
 
 .if ${OPSYS} !=  "Linux"
 SUBST_CLASSES+=                fixme
-SUBST_STAGE.fixme=     post-patch
+SUBST_STAGE.fixme=     pre-configure
 SUBST_FILES.fixme=     src/platform/Makefile.in
 SUBST_SED.fixme=       -e "s|@LINUX_TRUE@||g"
 SUBST_SED.fixme+=      -e "s|@LINUX_FALSE@|\#|g"

Index: pkgsrc/games/crossfire-client/Makefile.common
diff -u pkgsrc/games/crossfire-client/Makefile.common:1.6 pkgsrc/games/crossfire-client/Makefile.common:1.7
--- pkgsrc/games/crossfire-client/Makefile.common:1.6   Sat Oct  6 11:54:34 2012
+++ pkgsrc/games/crossfire-client/Makefile.common       Wed Jul  4 13:40:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.6 2012/10/06 11:54:34 asau Exp $
+# $NetBSD: Makefile.common,v 1.7 2018/07/04 13:40:18 jperkin Exp $
 # used by games/crossfire-client/Makefile
 # used by games/crossfire-client-gtk/Makefile
 # used by games/crossfire-client-gtk2/Makefile
@@ -21,7 +21,7 @@ GNU_CONFIGURE=                yes
 REPLACE_PERL+=         common/items.pl utils/deftoheader.pl
 
 SUBST_CLASSES+=                dsp
-SUBST_STAGE.dsp=       post-patch
+SUBST_STAGE.dsp=       pre-configure
 SUBST_MESSAGE.dsp=     Adjusting path to sound device.
 SUBST_FILES.dsp=       sound-src/cfsndserv.c
 SUBST_SED.dsp=         -e "s|/dev/dsp|${DEVOSSAUDIO}|"

Index: pkgsrc/games/et/Makefile
diff -u pkgsrc/games/et/Makefile:1.18 pkgsrc/games/et/Makefile:1.19
--- pkgsrc/games/et/Makefile:1.18       Wed Aug 16 20:45:37 2017
+++ pkgsrc/games/et/Makefile    Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2017/08/16 20:45:37 wiz Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:19 jperkin Exp $
 #
 
 DISTNAME=      et-linux-2.56-2.x86
@@ -28,7 +28,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     ${WRKDIR}/et ${WRKDIR}/etded
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.paths+=      -e 's,@SH@,${SH},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 pre-extract:
        ${MKDIR} ${WRKSRC}

Index: pkgsrc/games/falcons-eye/Makefile
diff -u pkgsrc/games/falcons-eye/Makefile:1.45 pkgsrc/games/falcons-eye/Makefile:1.46
--- pkgsrc/games/falcons-eye/Makefile:1.45      Tue May 17 10:32:07 2016
+++ pkgsrc/games/falcons-eye/Makefile   Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.45 2016/05/17 10:32:07 fhajny Exp $
+# $NetBSD: Makefile,v 1.46 2018/07/04 13:40:19 jperkin Exp $
 #
 
 DISTNAME=              nethack_source_331_jtp_193
@@ -33,7 +33,7 @@ LIBS.SunOS+=          -lm
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Configuring program paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     include/config.h src/fe-config.in
 SUBST_FILES.paths+=    sys/unix/nethack.sh
 SUBST_SED.paths=       -e "s,XXXPREFIXXXX,${PREFIX},g"
@@ -41,7 +41,7 @@ SUBST_SED.paths+=     -e "s,@GZIP_PROGRAM@,$
 
 SUBST_CLASSES.NetBSD+= unixconf
 SUBST_MESSAGE.unixconf=        Configuring to use NetBSD presets.
-SUBST_STAGE.unixconf=  post-patch
+SUBST_STAGE.unixconf=  pre-configure
 SUBST_FILES.unixconf=  include/unixconf.h
 SUBST_SED.unixconf=    -e 's,^\/\* \#define BSD 1 \*\/,\#define BSD 1,'
 SUBST_SED.unixconf+=   -e 's,^\#define SYSV,\/\* \#define SYSV \*\/,'

Index: pkgsrc/games/fillets-ng/Makefile
diff -u pkgsrc/games/fillets-ng/Makefile:1.35 pkgsrc/games/fillets-ng/Makefile:1.36
--- pkgsrc/games/fillets-ng/Makefile:1.35       Sat Apr 25 14:22:54 2015
+++ pkgsrc/games/fillets-ng/Makefile    Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2015/04/25 14:22:54 tnn Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:19 jperkin Exp $
 #
 
 DISTNAME=      fillets-ng-0.7.3
@@ -19,7 +19,7 @@ LDFLAGS.DragonFly=    -lX11
 LDFLAGS.SunOS+=                -lX11
 
 SUBST_CLASSES+=                man
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_FILES.man=       fillets.6
 SUBST_MESSAGE.man=     Fixing documentation path in the manual page.
 SUBST_SED.man=         "s,/usr/share/doc/fillets-ng/html/manual.html,${PREFIX}/share/doc/html/fillets-ng/manual.html,"

Index: pkgsrc/games/freeciv-share/Makefile.common
diff -u pkgsrc/games/freeciv-share/Makefile.common:1.51 pkgsrc/games/freeciv-share/Makefile.common:1.52
--- pkgsrc/games/freeciv-share/Makefile.common:1.51     Tue Jul  3 05:03:18 2018
+++ pkgsrc/games/freeciv-share/Makefile.common  Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.51 2018/07/03 05:03:18 adam Exp $
+# $NetBSD: Makefile.common,v 1.52 2018/07/04 13:40:19 jperkin Exp $
 
 # used by games/freeciv-share/Makefile
 # used by games/freeciv-client/Makefile
@@ -28,7 +28,7 @@ REPLACE_PYTHON=                       ${WRKSRC}/common/gener
 PYTHON_VERSIONS_INCOMPATIBLE=  34 35 36 37 # not yet ported as of 2.3.2
 
 SUBST_CLASSES+=                data
-SUBST_STAGE.data=      post-patch
+SUBST_STAGE.data=      pre-configure
 SUBST_FILES.data=      data/Makefile.in
 SUBST_SED.data+=       -e "s|@CLIENT_FALSE@|@MAKE_DATA_FALSE@|g"
 SUBST_SED.data+=       -e "s|@CLIENT_TRUE@|@MAKE_DATA_TRUE@|g"

Index: pkgsrc/games/gnome-games/Makefile
diff -u pkgsrc/games/gnome-games/Makefile:1.163 pkgsrc/games/gnome-games/Makefile:1.164
--- pkgsrc/games/gnome-games/Makefile:1.163     Tue Jul  3 05:03:18 2018
+++ pkgsrc/games/gnome-games/Makefile   Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.163 2018/07/03 05:03:18 adam Exp $
+# $NetBSD: Makefile,v 1.164 2018/07/04 13:40:19 jperkin Exp $
 
 DISTNAME=              gnome-games-2.32.1
 PKGREVISION=           37
@@ -52,7 +52,7 @@ PY_PATCHPLIST=                yes
 
 #!/usr/bin/env sh is pretty dumb and REPLACE_SH doesn't support fixing it
 SUBST_CLASSES+=                swell
-SUBST_STAGE.swell=     post-patch
+SUBST_STAGE.swell=     pre-configure
 SUBST_FILES.swell=     swell-foop/swell-foop.in
 SUBST_SED.swell=       's:/usr/bin/env sh:${SH}:'
 

Index: pkgsrc/games/libkdegames/Makefile
diff -u pkgsrc/games/libkdegames/Makefile:1.27 pkgsrc/games/libkdegames/Makefile:1.28
--- pkgsrc/games/libkdegames/Makefile:1.27      Sun Apr 29 21:31:41 2018
+++ pkgsrc/games/libkdegames/Makefile   Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2018/04/29 21:31:41 adam Exp $
+# $NetBSD: Makefile,v 1.28 2018/07/04 13:40:19 jperkin Exp $
 
 DISTNAME=      libkdegames-${_KDE_VERSION}
 PKGREVISION=   11
@@ -6,7 +6,7 @@ CATEGORIES=     games
 COMMENT=       library for the kdegames package
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      KDEGamesConfig.cmake.in
 SUBST_SED.path+=       -e 's;KDEGAMES_INCLUDE_DIR .*;KDEGAMES_INCLUDE_DIR "${PREFIX}/include");'
 

Index: pkgsrc/games/pioneers/Makefile
diff -u pkgsrc/games/pioneers/Makefile:1.57 pkgsrc/games/pioneers/Makefile:1.58
--- pkgsrc/games/pioneers/Makefile:1.57 Mon Apr 16 14:34:31 2018
+++ pkgsrc/games/pioneers/Makefile      Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2018/04/16 14:34:31 wiz Exp $
+# $NetBSD: Makefile,v 1.58 2018/07/04 13:40:19 jperkin Exp $
 #
 
 DISTNAME=      pioneers-0.11.3
@@ -18,7 +18,7 @@ USE_PKGLOCALEDIR=     YES
 BUILDLINK_DEPMETHOD.librsvg=   build   # generates icons
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
 SUBST_FILES.paths=     docs/*.6
 SUBST_SED.paths=       -e s,/usr/share/,${PREFIX}/share/,

Index: pkgsrc/games/powermanga/Makefile
diff -u pkgsrc/games/powermanga/Makefile:1.29 pkgsrc/games/powermanga/Makefile:1.30
--- pkgsrc/games/powermanga/Makefile:1.29       Wed Mar  7 11:57:30 2018
+++ pkgsrc/games/powermanga/Makefile    Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2018/03/07 11:57:30 wiz Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:19 jperkin Exp $
 
 DISTNAME=      powermanga-0.90
 PKGREVISION=   2
@@ -26,7 +26,7 @@ CONFIGURE_ARGS+=      --x-libraries=${PREFIX}
 .endif
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_SED.path+=       -e "s,/games/powermanga,/powermanga,g"
 SUBST_MESSAGE.path=    Fixing support file installation paths.
 SUBST_FILES.path+=     data/Makefile.in

Index: pkgsrc/games/prboom/Makefile
diff -u pkgsrc/games/prboom/Makefile:1.36 pkgsrc/games/prboom/Makefile:1.37
--- pkgsrc/games/prboom/Makefile:1.36   Sun Jan 14 17:34:00 2018
+++ pkgsrc/games/prboom/Makefile        Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.36 2018/01/14 17:34:00 rillig Exp $
+# $NetBSD: Makefile,v 1.37 2018/07/04 13:40:19 jperkin Exp $
 
 DISTNAME=      prboom-2.5.0
 PKGREVISION=   2
@@ -15,7 +15,7 @@ CONFIGURE_ARGS+=      --with-waddir=${PREFIX}
 #CONFIGURE_ARGS+=      --enable-gl
 
 SUBST_CLASSES+=                gamesdir
-SUBST_STAGE.gamesdir=  post-patch
+SUBST_STAGE.gamesdir=  pre-configure
 SUBST_MESSAGE.gamesdir=        Fixing hard-coded gamesdir
 SUBST_FILES.gamesdir=  src/Makefile.in
 SUBST_SED.gamesdir+=   -e '/^gamesdir =/ s;/games;/bin;g'

Index: pkgsrc/games/prboom-plus/Makefile
diff -u pkgsrc/games/prboom-plus/Makefile:1.3 pkgsrc/games/prboom-plus/Makefile:1.4
--- pkgsrc/games/prboom-plus/Makefile:1.3       Sun Jan 14 17:34:01 2018
+++ pkgsrc/games/prboom-plus/Makefile   Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/01/14 17:34:01 rillig Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:19 jperkin Exp $
 
 DISTNAME=      prboom-plus-2.5.1.3
 PKGREVISION=   1
@@ -14,7 +14,7 @@ GNU_CONFIGURE=                YES
 CONFIGURE_ARGS+=       --with-waddir=${PREFIX}/share/doom
 
 SUBST_CLASSES+=                gamesdir
-SUBST_STAGE.gamesdir=  post-patch
+SUBST_STAGE.gamesdir=  pre-configure
 SUBST_MESSAGE.gamesdir=        Fixing hard-coded gamesdir
 SUBST_FILES.gamesdir=  src/Makefile.in
 SUBST_SED.gamesdir+=   -e '/^gamesdir =/ s;/games;/bin;g'

Index: pkgsrc/games/pysolfc/Makefile
diff -u pkgsrc/games/pysolfc/Makefile:1.24 pkgsrc/games/pysolfc/Makefile:1.25
--- pkgsrc/games/pysolfc/Makefile:1.24  Tue Jul  3 05:03:18 2018
+++ pkgsrc/games/pysolfc/Makefile       Wed Jul  4 13:40:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2018/07/03 05:03:18 adam Exp $
+# $NetBSD: Makefile,v 1.25 2018/07/04 13:40:19 jperkin Exp $
 
 DISTNAME=      PySolFC-2.0
 PKGNAME=       ${DISTNAME:tl}
@@ -221,7 +221,7 @@ REPLACE_PYTHON+= \
        pysollib/wizardutil.py
 
 SUBST_CLASSES+=                        fix-paths
-SUBST_STAGE.fix-paths=         post-patch
+SUBST_STAGE.fix-paths=         pre-configure
 SUBST_MESSAGE.fix-paths=       Fixing absolute paths.
 SUBST_FILES.fix-paths=         pysollib/settings.py
 SUBST_SED.fix-paths=           -e s,@DATADIR@,${PREFIX}/share/PySolFC/,

Index: pkgsrc/games/quake2forge/Makefile
diff -u pkgsrc/games/quake2forge/Makefile:1.29 pkgsrc/games/quake2forge/Makefile:1.30
--- pkgsrc/games/quake2forge/Makefile:1.29      Sat Apr 25 14:23:03 2015
+++ pkgsrc/games/quake2forge/Makefile   Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2015/04/25 14:23:03 tnn Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:20 jperkin Exp $
 #
 
 DISTNAME=      quake2-0.3
@@ -25,11 +25,11 @@ post-install:
        ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${DESTDIR}${PREFIX}/share/doc/quake2forge
 
 SUBST_CLASSES+=                snd data
-SUBST_STAGE.snd=       post-patch
+SUBST_STAGE.snd=       pre-configure
 SUBST_FILES.snd=       src/snd_dma.c data/baseq2/config.cfg
 SUBST_SED.snd=         -e "s,/dev/dsp,${DEVOSSAUDIO},g"
 SUBST_MESSAGE.snd=     Fixing hardcoded audio device.
-SUBST_STAGE.data=      post-patch
+SUBST_STAGE.data=      pre-configure
 SUBST_FILES.data=      configure
 SUBST_SED.data=                -e s,PACKAGE=\'quake2\',PACKAGE=\'${PKGBASE}\',g
 SUBST_MESSAGE.data=    Fixing installation directories.

Index: pkgsrc/games/quakeforge/Makefile
diff -u pkgsrc/games/quakeforge/Makefile:1.34 pkgsrc/games/quakeforge/Makefile:1.35
--- pkgsrc/games/quakeforge/Makefile:1.34       Wed Mar  7 11:57:30 2018
+++ pkgsrc/games/quakeforge/Makefile    Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2018/03/07 11:57:30 wiz Exp $
+# $NetBSD: Makefile,v 1.35 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=              quakeforge-0.5.5
 PKGREVISION=           16
@@ -18,7 +18,7 @@ USE_TOOLS+=           bison gmake
 USE_LIBTOOL=           YES
 
 SUBST_CLASSES+=                dsp
-SUBST_STAGE.dsp=       post-patch
+SUBST_STAGE.dsp=       pre-configure
 SUBST_MESSAGE.dsp=     Adjusting sound device path.
 SUBST_FILES.dsp=       libs/audio/targets/snd_oss.c
 SUBST_SED.dsp=         -e "s|/dev/dsp|${DEVOSSAUDIO}|"

Index: pkgsrc/games/tyrquake/Makefile
diff -u pkgsrc/games/tyrquake/Makefile:1.9 pkgsrc/games/tyrquake/Makefile:1.10
--- pkgsrc/games/tyrquake/Makefile:1.9  Wed Mar  7 11:57:30 2018
+++ pkgsrc/games/tyrquake/Makefile      Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2018/03/07 11:57:30 wiz Exp $
+# $NetBSD: Makefile,v 1.10 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=      tyrquake-0.61_20140630
 PKGREVISION=   2
@@ -19,7 +19,7 @@ WRKSRC=               ${WRKDIR}/tyrquake
 LDFLAGS+=      ${LIBOSSAUDIO}
 
 SUBST_CLASSES+=                audio
-SUBST_STAGE.audio=     post-patch
+SUBST_STAGE.audio=     pre-configure
 SUBST_MESSAGE.audio=   Fixing path to the audio device.
 SUBST_FILES.audio=     common/snd_oss.c
 SUBST_SED.audio=       -e "s|/dev/dsp|${DEVOSSAUDIO}|"

Index: pkgsrc/games/xrick/Makefile
diff -u pkgsrc/games/xrick/Makefile:1.26 pkgsrc/games/xrick/Makefile:1.27
--- pkgsrc/games/xrick/Makefile:1.26    Sat Apr 25 14:23:05 2015
+++ pkgsrc/games/xrick/Makefile Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2015/04/25 14:23:05 tnn Exp $
+# $NetBSD: Makefile,v 1.27 2018/07/04 13:40:20 jperkin Exp $
 #
 
 DISTNAME=      xrick-021212
@@ -20,7 +20,7 @@ NO_SRC_ON_FTP=            ${RESTRICTED}
 USE_TOOLS+=            gmake gunzip
 
 SUBST_CLASSES+=                data
-SUBST_STAGE.data=      post-patch
+SUBST_STAGE.data=      pre-configure
 SUBST_MESSAGE.data=    Adjusting path to data.zip
 SUBST_FILES.data=      src/xrick.c
 SUBST_SED.data=                -e "s|data.zip|${PREFIX}/share/xrick/&|"

Index: pkgsrc/geography/kplex/Makefile
diff -u pkgsrc/geography/kplex/Makefile:1.3 pkgsrc/geography/kplex/Makefile:1.4
--- pkgsrc/geography/kplex/Makefile:1.3 Fri Apr 29 08:49:45 2016
+++ pkgsrc/geography/kplex/Makefile     Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2016/04/29 08:49:45 plunky Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=      kplex-1.3.2
 CATEGORIES=    geography
@@ -10,7 +10,7 @@ COMMENT=      Multitransport NMEA-0183 softwa
 LICENSE=       gnu-gpl-v3
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_MESSAGE.paths=   Fixing path to config file
 SUBST_FILES.paths=     README kplex.h kplex.conf.ex
 SUBST_SED.paths=       -e "s|/etc/kplex.conf|${PKG_SYSCONFDIR}/kplex.conf|"

Index: pkgsrc/graphics/asymptote/Makefile
diff -u pkgsrc/graphics/asymptote/Makefile:1.25 pkgsrc/graphics/asymptote/Makefile:1.26
--- pkgsrc/graphics/asymptote/Makefile:1.25     Thu Jun  8 08:47:26 2017
+++ pkgsrc/graphics/asymptote/Makefile  Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2017/06/08 08:47:26 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=      asymptote-2.41
 CATEGORIES=    graphics
@@ -38,7 +38,7 @@ CFLAGS+=              -DGC_NO_THREAD_REDIRECTS
 REPLACE_PYTHON+=       GUI/*.py
 
 SUBST_CLASSES+=                python
-SUBST_STAGE.python=    post-patch
+SUBST_STAGE.python=    pre-configure
 SUBST_FILES.python=    Makefile.in
 SUBST_MESSAGE.python=  Fixing path to python interpreter.
 SUBST_SED.python+=     -e "s|/usr/bin/env python|${PYTHONBIN:Q}|g"

Index: pkgsrc/graphics/aview/Makefile
diff -u pkgsrc/graphics/aview/Makefile:1.32 pkgsrc/graphics/aview/Makefile:1.33
--- pkgsrc/graphics/aview/Makefile:1.32 Mon Sep  8 21:24:44 2014
+++ pkgsrc/graphics/aview/Makefile      Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2014/09/08 21:24:44 wiz Exp $
+# $NetBSD: Makefile,v 1.33 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=      aview-1.3.0rc1
 PKGNAME=       aview-1.3.0.1
@@ -25,7 +25,7 @@ USE_TOOLS+=   mktemp:run
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES+=                programs
-SUBST_STAGE.programs=  post-patch
+SUBST_STAGE.programs=  pre-configure
 SUBST_MESSAGE.programs=        Filling @placeholders@.
 SUBST_FILES.programs=  Makefile.in
 .if (${MACHINE_ARCH} == "i386")

Index: pkgsrc/graphics/camlimages/Makefile
diff -u pkgsrc/graphics/camlimages/Makefile:1.105 pkgsrc/graphics/camlimages/Makefile:1.106
--- pkgsrc/graphics/camlimages/Makefile:1.105   Tue Apr 17 22:29:39 2018
+++ pkgsrc/graphics/camlimages/Makefile Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.105 2018/04/17 22:29:39 wiz Exp $
+# $NetBSD: Makefile,v 1.106 2018/07/04 13:40:20 jperkin Exp $
 
 VERSION=               4.0.1
 PKGNAME=               camlimages-${VERSION}
@@ -21,7 +21,7 @@ MAKE_JOBS_SAFE=               no
 WRKSRC=                        ${WRKDIR}/camlspotter-camlimages-v${VERSION}
 
 SUBST_CLASSES+=                omf
-SUBST_STAGE.omf=       post-patch
+SUBST_STAGE.omf=       pre-configure
 SUBST_FILES.omf=       OMakefile
 SUBST_SED.omf=         -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.omf+=                -e 's,@X11BASE@,${X11BASE},g'

Index: pkgsrc/graphics/colord/Makefile
diff -u pkgsrc/graphics/colord/Makefile:1.2 pkgsrc/graphics/colord/Makefile:1.3
--- pkgsrc/graphics/colord/Makefile:1.2 Tue Jun 26 10:10:59 2018
+++ pkgsrc/graphics/colord/Makefile     Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2018/06/26 10:10:59 jperkin Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=      colord-1.3.5
 CATEGORIES=    graphics gnome
@@ -41,7 +41,7 @@ CONF_FILES+=  ${CONF_DIR}/org.freedesktop
 
 SUBST_CLASSES+=                prefix
 SUBST_MESSAGE.prefix=  Fix prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    lib/colord/cd-icc-store.c
 SUBST_FILES.prefix+=   src/cd-main.c
 SUBST_FILES.prefix+=   client/cd-util.c

Index: pkgsrc/graphics/djview4/Makefile
diff -u pkgsrc/graphics/djview4/Makefile:1.37 pkgsrc/graphics/djview4/Makefile:1.38
--- pkgsrc/graphics/djview4/Makefile:1.37       Mon Mar 12 11:16:40 2018
+++ pkgsrc/graphics/djview4/Makefile    Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.37 2018/03/12 11:16:40 wiz Exp $
+# $NetBSD: Makefile,v 1.38 2018/07/04 13:40:20 jperkin Exp $
 #
 
 DISTNAME=      djview-4.10.6
@@ -18,7 +18,7 @@ USE_LIBTOOL=  yes
 USE_TOOLS+=    gmake pkg-config
 
 SUBST_CLASSES+=                nsdejavu
-SUBST_STAGE.nsdejavu=  post-patch
+SUBST_STAGE.nsdejavu=  pre-configure
 SUBST_MESSAGE.nsdejavu=        Fixing hardcoded paths.
 SUBST_FILES.nsdejavu=  nsdejavu/nsdejavu.c
 SUBST_SED.nsdejavu=    -e 's:/usr/local/lib:${LOCALBASE}/lib:'

Index: pkgsrc/graphics/f-spot/Makefile
diff -u pkgsrc/graphics/f-spot/Makefile:1.90 pkgsrc/graphics/f-spot/Makefile:1.91
--- pkgsrc/graphics/f-spot/Makefile:1.90        Tue Apr 17 22:29:39 2018
+++ pkgsrc/graphics/f-spot/Makefile     Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.90 2018/04/17 22:29:39 wiz Exp $
+# $NetBSD: Makefile,v 1.91 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=      f-spot-0.8.2
 PKGREVISION=   49
@@ -30,7 +30,7 @@ REPLACE_BASH+=        src/Clients/MainApp/f-spo
 REPLACE_BASH+= tools/f-spot-import
 
 SUBST_CLASSES+=                        fix-x11
-SUBST_STAGE.fix-x11=           post-patch
+SUBST_STAGE.fix-x11=           pre-configure
 SUBST_MESSAGE.fix-x11=         Fixing libX11 references
 SUBST_FILES.fix-x11=           src/Core/FSpot.Utils/FSpot.Utils.dll.config.in
 SUBST_FILES.fix-x11+=          src/Core/FSpot.Utils/FSpot.Utils.dll.config
@@ -39,7 +39,7 @@ SUBST_FILES.fix-x11+=         lib/Hyena/build/D
 SUBST_SED.fix-x11=             -e 's,libX11.so.6,${X11BASE}/lib/libX11.so,'
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/graphics/imlib2/Makefile
diff -u pkgsrc/graphics/imlib2/Makefile:1.74 pkgsrc/graphics/imlib2/Makefile:1.75
--- pkgsrc/graphics/imlib2/Makefile:1.74        Thu Jan 25 20:13:08 2018
+++ pkgsrc/graphics/imlib2/Makefile     Wed Jul  4 13:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.74 2018/01/25 20:13:08 leot Exp $
+# $NetBSD: Makefile,v 1.75 2018/07/04 13:40:20 jperkin Exp $
 
 DISTNAME=      imlib2-1.4.10
 CATEGORIES=    graphics
@@ -27,7 +27,7 @@ SHLIB_SUFFIX=         so
 .endif
 
 SUBST_CLASSES+=                shlib rpath
-SUBST_STAGE.shlib=     post-patch
+SUBST_STAGE.shlib=     pre-configure
 SUBST_MESSAGE.shlib=   Replacing shared library suffix
 SUBST_FILES.shlib+=    src/lib/image.c
 SUBST_SED.shlib+=      -e 's,"\.so",".${SHLIB_SUFFIX}",'

Index: pkgsrc/graphics/netpbm/Makefile
diff -u pkgsrc/graphics/netpbm/Makefile:1.217 pkgsrc/graphics/netpbm/Makefile:1.218
--- pkgsrc/graphics/netpbm/Makefile:1.217       Tue Feb 20 07:04:54 2018
+++ pkgsrc/graphics/netpbm/Makefile     Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.217 2018/02/20 07:04:54 dholland Exp $
+# $NetBSD: Makefile,v 1.218 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=      netpbm-10.79.04
 CATEGORIES=    graphics
@@ -43,7 +43,7 @@ WRKSRC=               ${WRKDIR}/netpbm
 WRAPPER_REORDER_CMDS+= reorder:l:rle:netpbm
 
 SUBST_CLASSES+=                rgb_txt
-SUBST_STAGE.rgb_txt=   post-patch
+SUBST_STAGE.rgb_txt=   pre-configure
 SUBST_MESSAGE.rgb_txt= Configure RGB_TXT
 SUBST_FILES.rgb_txt=   config.mk
 SUBST_SED.rgb_txt+=    -e 's,/usr/share/netpbm/rgb.txt,${PREFIX}/share/netpbm/rgb.txt,'

Index: pkgsrc/graphics/py-qrcode/Makefile
diff -u pkgsrc/graphics/py-qrcode/Makefile:1.11 pkgsrc/graphics/py-qrcode/Makefile:1.12
--- pkgsrc/graphics/py-qrcode/Makefile:1.11     Sat Sep 16 19:26:58 2017
+++ pkgsrc/graphics/py-qrcode/Makefile  Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2017/09/16 19:26:58 wiz Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=      qrcode-5.3
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
@@ -23,7 +23,7 @@ SUBST_CLASSES+=                       pkgmandir
 SUBST_FILES.pkgmandir=         setup.py
 SUBST_MESSAGE.pkgmandir=       Fixing PKGMANDIR path.
 SUBST_SED.pkgmandir=           -e "s|share/man|${PKGMANDIR}|1"
-SUBST_STAGE.pkgmandir=         post-patch
+SUBST_STAGE.pkgmandir=         pre-configure
 
 post-install:
        ${MV} ${DESTDIR}${PREFIX}/bin/qr \

Index: pkgsrc/graphics/tkpiechart/Makefile
diff -u pkgsrc/graphics/tkpiechart/Makefile:1.20 pkgsrc/graphics/tkpiechart/Makefile:1.21
--- pkgsrc/graphics/tkpiechart/Makefile:1.20    Thu Oct  9 14:06:37 2014
+++ pkgsrc/graphics/tkpiechart/Makefile Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2014/10/09 14:06:37 wiz Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=      tkpiechart-5.4
 PKGREVISION=   1
@@ -17,7 +17,7 @@ NO_BUILD=     yes
 
 SUBST_CLASSES+=                patch
 SUBST_MESSAGE.patch=   Remove version numbers for required packages.
-SUBST_STAGE.patch=     post-patch
+SUBST_STAGE.patch=     pre-configure
 SUBST_FILES.patch=     demo demo.tcl instapkg.tcl piechart.htm
 SUBST_SED.patch=       -e '/require/s/stooop 3.7/stooop/g'
 SUBST_SED.patch+=      -e '/require/s/switched 1.4/switched/g'

Index: pkgsrc/ham/chirp/Makefile
diff -u pkgsrc/ham/chirp/Makefile:1.10 pkgsrc/ham/chirp/Makefile:1.11
--- pkgsrc/ham/chirp/Makefile:1.10      Mon Apr 16 14:34:42 2018
+++ pkgsrc/ham/chirp/Makefile   Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2018/04/16 14:34:42 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=      chirp-0.4.1
 PKGREVISION=   6
@@ -18,13 +18,13 @@ DEPENDS+=       ${PYPKGPREFIX}-serial>=2
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES+=                        fix-manpaths
-SUBST_STAGE.fix-manpaths=      post-patch
+SUBST_STAGE.fix-manpaths=      pre-configure
 SUBST_MESSAGE.fix-manpaths=    Fixing man paths
 SUBST_FILES.fix-manpaths=      setup.py
 SUBST_SED.fix-manpaths=                -e 's,share/man/man1,${PKGMANDIR}/man1,g'
 
 SUBST_CLASSES+=                        fix-sharepaths
-SUBST_STAGE.fix-sharepaths=    post-patch
+SUBST_STAGE.fix-sharepaths=    pre-configure
 SUBST_MESSAGE.fix-sharepaths=  Fixing /usr/share paths
 SUBST_FILES.fix-sharepaths=    chirpw
 SUBST_FILES.fix-sharepaths+=   chirp/generic_xml.py

Index: pkgsrc/ham/fldigi/Makefile
diff -u pkgsrc/ham/fldigi/Makefile:1.102 pkgsrc/ham/fldigi/Makefile:1.103
--- pkgsrc/ham/fldigi/Makefile:1.102    Sun Apr 29 21:31:46 2018
+++ pkgsrc/ham/fldigi/Makefile  Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.102 2018/04/29 21:31:46 adam Exp $
+# $NetBSD: Makefile,v 1.103 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=      fldigi-4.0.16
 PKGREVISION=   2
@@ -26,7 +26,7 @@ SUBST_MESSAGE.asciidoc=       Replacing asciid
 SUBST_SED.asciidoc=    -e s\|/usr/share\|${PREFIX}/share\|g
 
 SUBST_CLASSES+=                brag-os
-SUBST_STAGE.brag-os=   post-patch
+SUBST_STAGE.brag-os=   pre-configure
 SUBST_FILES.brag-os=   src/misc/newinstall.cxx
 SUBST_MESSAGE.brag-os= Show OS name correctly with Brag button
 SUBST_SED.brag-os=     -e s/@@OS@@/${OPSYS}/

Index: pkgsrc/ham/gnuradio-core/Makefile.common
diff -u pkgsrc/ham/gnuradio-core/Makefile.common:1.15 pkgsrc/ham/gnuradio-core/Makefile.common:1.16
--- pkgsrc/ham/gnuradio-core/Makefile.common:1.15       Tue Jul  3 05:03:21 2018
+++ pkgsrc/ham/gnuradio-core/Makefile.common    Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.15 2018/07/03 05:03:21 adam Exp $
+# $NetBSD: Makefile.common,v 1.16 2018/07/04 13:40:21 jperkin Exp $
 # This Makefile fragment is included in the package Makefiles for
 # GNU Radio distributed packages (they all share common configure and build
 # settings).
@@ -107,7 +107,7 @@ SUBST_MESSAGE.alsa= Arrange the patched 
 SUBST_FILES.alsa+=     gr-audio/lib/CMakeLists.txt
 ## The value of ${ALSA_ENABLED} is either '#' or '' by options.mk.
 SUBST_SED.alsa=                -e 's,@@ALSA@@,${ALSA_ENABLED},'
-SUBST_STAGE.alsa=      post-patch
+SUBST_STAGE.alsa=      pre-configure
 
 SUBST_CLASSES+=                pyvers
 SUBST_FILES.pyvers=    cmake/Modules/FindSphinx.cmake

Index: pkgsrc/ham/trustedQSL/Makefile
diff -u pkgsrc/ham/trustedQSL/Makefile:1.31 pkgsrc/ham/trustedQSL/Makefile:1.32
--- pkgsrc/ham/trustedQSL/Makefile:1.31 Sun Apr 29 21:31:48 2018
+++ pkgsrc/ham/trustedQSL/Makefile      Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2018/04/29 21:31:48 adam Exp $
+# $NetBSD: Makefile,v 1.32 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=              tqsl-2.3.1
 PKGREVISION=           1
@@ -27,7 +27,7 @@ USE_CMAKE=            yes
 # remove the string $(LIB_SUFFIX), tested with NetBSD at least
 SUBST_CLASSES+=                lib-suffix
 SUBST_MESSAGE.lib-suffix= Removing $$(LIB_SUFFIX) from src/CMakeLists.txt
-SUBST_STAGE.lib-suffix= post-patch
+SUBST_STAGE.lib-suffix= pre-configure
 SUBST_FILES.lib-suffix= src/CMakeLists.txt
 SUBST_SED.lib-suffix=  -e s/\$$\(LIB_SUFFIX\)//
 

Index: pkgsrc/inputmethod/canna-canuum/Makefile
diff -u pkgsrc/inputmethod/canna-canuum/Makefile:1.15 pkgsrc/inputmethod/canna-canuum/Makefile:1.16
--- pkgsrc/inputmethod/canna-canuum/Makefile:1.15       Sun Oct 18 03:58:31 2015
+++ pkgsrc/inputmethod/canna-canuum/Makefile    Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2015/10/18 03:58:31 tsutsui Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:21 jperkin Exp $
 
 CANNA_MODULE=  canuum
 
@@ -14,7 +14,7 @@ INSTALL_MAKE_FLAGS+=  INSTUGIDFLAGS=
 
 .include "../../mk/curses.buildlink3.mk"
 SUBST_CLASSES+=                fix_curs
-SUBST_STAGE.fix_curs=  post-patch
+SUBST_STAGE.fix_curs=  pre-configure
 SUBST_MESSAGE.fix_curs=        Fixing curses
 SUBST_FILES.fix_curs+= canuum/Imakefile
 SUBST_SED.fix_curs+=   -e 's/TERMCAP_LIB = .*/TERMCAP_LIB = -l'${BUILDLINK_LIBNAME.curses}'/g'

Index: pkgsrc/lang/ccsh/Makefile
diff -u pkgsrc/lang/ccsh/Makefile:1.9 pkgsrc/lang/ccsh/Makefile:1.10
--- pkgsrc/lang/ccsh/Makefile:1.9       Thu Oct  9 14:06:37 2014
+++ pkgsrc/lang/ccsh/Makefile   Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2014/10/09 14:06:37 wiz Exp $
+# $NetBSD: Makefile,v 1.10 2018/07/04 13:40:21 jperkin Exp $
 #
 
 DISTNAME=              ccsh-0.0.4
@@ -14,7 +14,7 @@ USE_TOOLS+=           gmake
 
 SUBST_CLASSES+=                options
 SUBST_MESSAGE.options= Preventing CFLAGS from being overridden.
-SUBST_STAGE.options=   post-patch
+SUBST_STAGE.options=   pre-configure
 SUBST_FILES.options=   Makefile
 SUBST_SED.options=     -e 's,^CFLAGS =,\#CFLAGS =,g'
 

Index: pkgsrc/lang/ecl/Makefile
diff -u pkgsrc/lang/ecl/Makefile:1.23 pkgsrc/lang/ecl/Makefile:1.24
--- pkgsrc/lang/ecl/Makefile:1.23       Mon Jan  1 18:16:36 2018
+++ pkgsrc/lang/ecl/Makefile    Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2018/01/01 18:16:36 rillig Exp $
+# $NetBSD: Makefile,v 1.24 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=              ecl-16.1.2
 CATEGORIES=            lang
@@ -19,7 +19,7 @@ INFO_FILES=           yes
 CONFIGURE_ARGS+=       --enable-boehm=system --with-system-gmp
 
 SUBST_CLASSES+=                        fix-libffi-include
-SUBST_STAGE.fix-libdir=                post-patch
+SUBST_STAGE.fix-libdir=                pre-configure
 SUBST_MESSAGE.fix-libdir=      Fixing libffi layout.
 SUBST_FILES.fix-libdir=                src/c/ffi.d
 SUBST_SED.fix-libdir=          -e '/include.*<ffi/ffi.h>/s:ffi/ffi.h:ffi.h:'

Index: pkgsrc/lang/erlang/Makefile
diff -u pkgsrc/lang/erlang/Makefile:1.85 pkgsrc/lang/erlang/Makefile:1.86
--- pkgsrc/lang/erlang/Makefile:1.85    Tue Jul  3 11:01:21 2018
+++ pkgsrc/lang/erlang/Makefile Wed Jul  4 13:40:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.85 2018/07/03 11:01:21 fhajny Exp $
+# $NetBSD: Makefile,v 1.86 2018/07/04 13:40:21 jperkin Exp $
 
 DISTNAME=              otp_src_${DIST_VERSION_MAJOR}.${DIST_VERSION_MINOR}${!empty(DIST_VERSION_PATCH):?.:}${DIST_VERSION_PATCH}
 PKGNAME=               ${DISTNAME:S/otp_src_/erlang-/}
@@ -55,7 +55,7 @@ REPLACE_FILES.escript=        \
        lib/snmp/src/compile/snmpc.src
 
 SUBST_CLASSES+=                target
-SUBST_STAGE.target=    post-patch
+SUBST_STAGE.target=    pre-configure
 SUBST_FILES.target=    make/target.mk
 SUBST_SED.target=      -e "s|=.*config.guess)|= ${MACHINE_GNU_PLATFORM}|"
 SUBST_MESSAGE.target=  Fixing target name.

Index: pkgsrc/lang/ghc/Makefile
diff -u pkgsrc/lang/ghc/Makefile:1.56 pkgsrc/lang/ghc/Makefile:1.57
--- pkgsrc/lang/ghc/Makefile:1.56       Sat Jul  9 06:38:25 2016
+++ pkgsrc/lang/ghc/Makefile    Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.56 2016/07/09 06:38:25 wiz Exp $
+# $NetBSD: Makefile,v 1.57 2018/07/04 13:40:22 jperkin Exp $
 
 DISTNAME=      ghc-6.8.3
 PKGREVISION=   7
@@ -30,7 +30,7 @@ CONFIGURE_ENV+=               PerlCmd=${PERL5:Q}
 USE_TOOLS+=            gmake perl:run
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix+=   ../ghc-6.4.2/mk/bootstrap.mk
 SUBST_FILES.prefix+=   ../ghc-6.4.2/ghc/rts/package.conf.in
 SUBST_FILES.prefix+=   ../ghc-6.4.2/libraries/readline/package.conf.in

Index: pkgsrc/lang/mono2/Makefile
diff -u pkgsrc/lang/mono2/Makefile:1.28 pkgsrc/lang/mono2/Makefile:1.29
--- pkgsrc/lang/mono2/Makefile:1.28     Sat Apr 14 07:33:57 2018
+++ pkgsrc/lang/mono2/Makefile  Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2018/04/14 07:33:57 adam Exp $
+# $NetBSD: Makefile,v 1.29 2018/07/04 13:40:22 jperkin Exp $
 
 DISTNAME=      mono-2.10.9
 PKGREVISION=   23
@@ -122,19 +122,19 @@ MAKE_DIRS+=       ${PKG_SYSCONFDIR}/mono/mconf
 TEST_TARGET=   check
 
 SUBST_CLASSES+=                        fix-prefix
-SUBST_STAGE.fix-prefix=                post-patch
+SUBST_STAGE.fix-prefix=                pre-configure
 SUBST_MESSAGE.fix-prefix=      Fixing relative prefix
 SUBST_FILES.fix-prefix=                ${PKGCONFIG_OVERRIDE}
 SUBST_SED.fix-prefix=          -e 's,$${pcfiledir}/../..,\@prefix\@,g'
 
 SUBST_CLASSES+=                        fix-mcs
-SUBST_STAGE.fix-mcs=           post-patch
+SUBST_STAGE.fix-mcs=           pre-configure
 SUBST_MESSAGE.fix-mcs=         Fixing mcs default prefix
 SUBST_FILES.fix-mcs=           mcs/build/config-default.make
 SUBST_SED.fix-mcs=             -e 's,/usr/local,${PREFIX},g'
 
 SUBST_CLASSES+=                        fix-cfgdir
-SUBST_STAGE.fix-cfgdir=                post-patch
+SUBST_STAGE.fix-cfgdir=                pre-configure
 SUBST_MESSAGE.fix-cfgdir=      Fixing configuration files install dir
 SUBST_FILES.fix-cfgdir=                mcs/tools/mconfig/Makefile
 SUBST_SED.fix-cfgdir=          -e 's,$$(sysconfdir)/mono,${EGDIR},g'

Index: pkgsrc/lang/pear/Makefile
diff -u pkgsrc/lang/pear/Makefile:1.41 pkgsrc/lang/pear/Makefile:1.42
--- pkgsrc/lang/pear/Makefile:1.41      Thu Jul  6 13:34:46 2017
+++ pkgsrc/lang/pear/Makefile   Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.41 2017/07/06 13:34:46 taca Exp $
+# $NetBSD: Makefile,v 1.42 2018/07/04 13:40:22 jperkin Exp $
 #
 
 DISTNAME=      PEAR-1.10.5
@@ -53,7 +53,7 @@ DISTFILES+=           ${XMLUTIL_SRCS}
 # end of base components
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    install/go-pear.php
 SUBST_SED.config=      -e "s|@WRKSRC@|${WRKSRC}|g"
 SUBST_SED.config+=     -e "s|@PREFIX@|${PREFIX}|g"

Index: pkgsrc/lang/perl5/Makefile
diff -u pkgsrc/lang/perl5/Makefile:1.245 pkgsrc/lang/perl5/Makefile:1.246
--- pkgsrc/lang/perl5/Makefile:1.245    Fri Apr 27 09:44:27 2018
+++ pkgsrc/lang/perl5/Makefile  Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.245 2018/04/27 09:44:27 adam Exp $
+# $NetBSD: Makefile,v 1.246 2018/07/04 13:40:22 jperkin Exp $
 
 .include "license.mk"
 .include "Makefile.common"
@@ -278,7 +278,7 @@ SUBST_SED.cpprun=   -e "s/cpprun=''/cpprun
 # let's substitute what pkgsrc says instead.
 #
 SUBST_CLASSES+=                dirmode
-SUBST_STAGE.dirmode=   post-patch
+SUBST_STAGE.dirmode=   pre-configure
 SUBST_FILES.dirmode=   installhtml install_lib.pl
 SUBST_SED.dirmode=     -e "s/755/${PKGDIRMODE}/g;/umask(/d"
 

Index: pkgsrc/lang/rust/Makefile
diff -u pkgsrc/lang/rust/Makefile:1.39 pkgsrc/lang/rust/Makefile:1.40
--- pkgsrc/lang/rust/Makefile:1.39      Sun Jun 24 08:05:25 2018
+++ pkgsrc/lang/rust/Makefile   Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2018/06/24 08:05:25 ryoon Exp $
+# $NetBSD: Makefile,v 1.40 2018/07/04 13:40:22 jperkin Exp $
 
 DISTNAME=      rustc-1.27.0-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -158,7 +158,7 @@ TOOLS_PATH.md5sum=  ${PREFIX}/bin/gmd5sum
 .endif
 
 SUBST_CLASSES+=                rpath
-SUBST_STAGE.rpath=     post-patch
+SUBST_STAGE.rpath=     pre-configure
 SUBST_FILES.rpath=     src/bootstrap/bin/rustc.rs
 SUBST_VARS.rpath=      PREFIX
 

Index: pkgsrc/lang/scheme48/Makefile
diff -u pkgsrc/lang/scheme48/Makefile:1.42 pkgsrc/lang/scheme48/Makefile:1.43
--- pkgsrc/lang/scheme48/Makefile:1.42  Sat Nov 14 14:14:46 2015
+++ pkgsrc/lang/scheme48/Makefile       Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2015/11/14 14:14:46 leot Exp $
+# $NetBSD: Makefile,v 1.43 2018/07/04 13:40:22 jperkin Exp $
 
 DISTNAME=              scheme48-1.9.2
 CATEGORIES=            lang
@@ -31,7 +31,7 @@ REPLACE_FILES.scheme= build/scheme48-con
 .include "../../mk/bsd.prefs.mk"
 .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
 SUBST_CLASSES+=                pthr
-SUBST_STAGE.pthr=      post-patch
+SUBST_STAGE.pthr=      pre-configure
 SUBST_FILES.pthr=      configure
 SUBST_MESSAGE.pthr=    Hardcoding -pthread in CFLAGS and LDFLAGS
 SUBST_SED.pthr=                -e 's,pthreads_done=\"no\",pthreads_done=\"yes\"; CFLAGS=\"$$CFLAGS -pthread\"; LDFLAGS=\"$$LDFLAGS -pthread\",'

Index: pkgsrc/lang/snobol/Makefile
diff -u pkgsrc/lang/snobol/Makefile:1.32 pkgsrc/lang/snobol/Makefile:1.33
--- pkgsrc/lang/snobol/Makefile:1.32    Thu Jan 19 18:52:14 2017
+++ pkgsrc/lang/snobol/Makefile Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2017/01/19 18:52:14 agc Exp $
+# $NetBSD: Makefile,v 1.33 2018/07/04 13:40:22 jperkin Exp $
 #
 
 DISTNAME=      snobol4-1.3
@@ -20,7 +20,7 @@ LICENSE=      2-clause-bsd
 EXTRACT_ONLY=  ${DISTNAME}${EXTRACT_SUFX}
 
 SUBST_CLASSES+=                        snobol-config
-SUBST_STAGE.snobol-config=     post-patch
+SUBST_STAGE.snobol-config=     pre-configure
 SUBST_FILES.snobol-config=     Makefile
 SUBST_SED.snobol-config+=      -e s\|M4=m4\|M4=${TOOLS_PATH.m4:Q}\|
 

Index: pkgsrc/mail/OSBF-lua/Makefile
diff -u pkgsrc/mail/OSBF-lua/Makefile:1.13 pkgsrc/mail/OSBF-lua/Makefile:1.14
--- pkgsrc/mail/OSBF-lua/Makefile:1.13  Sun Oct 19 22:27:46 2014
+++ pkgsrc/mail/OSBF-lua/Makefile       Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2014/10/19 22:27:46 alnsn Exp $
+# $NetBSD: Makefile,v 1.14 2018/07/04 13:40:22 jperkin Exp $
 #
 
 DISTNAME=      osbf-lua-2.0.4
@@ -18,7 +18,7 @@ USE_TOOLS+=           gmake
 INSTALL_TARGET=        install install_spamfilter
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_MESSAGE.path=    Fixing paths in config
 SUBST_FILES.path=      config
 SUBST_FILES.path+=     spamfilter/getopt.lua

Index: pkgsrc/mail/akonadi/options.mk
diff -u pkgsrc/mail/akonadi/options.mk:1.2 pkgsrc/mail/akonadi/options.mk:1.3
--- pkgsrc/mail/akonadi/options.mk:1.2  Thu Sep 19 05:07:11 2013
+++ pkgsrc/mail/akonadi/options.mk      Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.2 2013/09/19 05:07:11 obache Exp $
+# $NetBSD: options.mk,v 1.3 2018/07/04 13:40:22 jperkin Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.akonadi
 
@@ -27,7 +27,7 @@ CMAKE_ARGS+=  -DAKONADI_BUILD_QSQLITE=off
 PKG_FAIL_RESASON+=     "Unknown MySQL version: ${_MYSQL_VERSION}"
 .  endif
 SUBST_CLASSES+=                mysql
-SUBST_STAGE.mysql=     post-patch
+SUBST_STAGE.mysql=     pre-configure
 SUBST_MESSAGE.mysql=   Fix mysqld path.
 SUBST_FILES.mysql=     server/CMakeLists.txt
 SUBST_SED.mysql=       -e "s:MYSQLD_EXECUTABLE mysqld:MYSQLD_EXECUTABLE mysqld ${PREFIX}/libexec:"

Index: pkgsrc/mail/courier-maildir/Makefile
diff -u pkgsrc/mail/courier-maildir/Makefile:1.32 pkgsrc/mail/courier-maildir/Makefile:1.33
--- pkgsrc/mail/courier-maildir/Makefile:1.32   Sat Jul  9 06:38:28 2016
+++ pkgsrc/mail/courier-maildir/Makefile        Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2016/07/09 06:38:28 wiz Exp $
+# $NetBSD: Makefile,v 1.33 2018/07/04 13:40:22 jperkin Exp $
 
 DISTNAME=      courier-${COURIER_VERSION}
 PKGNAME=       ${DISTNAME:S/-/-maildir-/}
@@ -63,7 +63,7 @@ SUBST_SED.paths+=     -e 's,@MKDIR@,${MKDIR}
 SUBST_SED.paths+=      -e 's,@RM@,${RM},g'
 SUBST_SED.paths+=      -e 's,@SH@,${SH},g'
 SUBST_SED.paths+=      -e 's,@TEST@,${TEST},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
        ${CP} ${FILESDIR}/sharedindexupdate.sh ${WRKDIR}/sharedindexupdate.sh

Index: pkgsrc/mail/courier-mta/Makefile
diff -u pkgsrc/mail/courier-mta/Makefile:1.50 pkgsrc/mail/courier-mta/Makefile:1.51
--- pkgsrc/mail/courier-mta/Makefile:1.50       Mon Jun  5 14:24:02 2017
+++ pkgsrc/mail/courier-mta/Makefile    Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.50 2017/06/05 14:24:02 ryoon Exp $
+# $NetBSD: Makefile,v 1.51 2018/07/04 13:40:22 jperkin Exp $
 
 DISTNAME=      courier-${COURIER_VERSION}
 PKGNAME=       ${DISTNAME:S/-/-mta-/}
@@ -82,7 +82,7 @@ SUBST_STAGE.perms=    pre-configure
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKDIR}/mailer.conf
 SUBST_SED.paths+=      -e "s,@PREFIX@,${PREFIX},g"
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 REPLACE_PERL+= courier/webadmin/*.pl courier/webadmin/*.pl.in webadmin/*.pl
 

Index: pkgsrc/mail/dcc/Makefile
diff -u pkgsrc/mail/dcc/Makefile:1.13 pkgsrc/mail/dcc/Makefile:1.14
--- pkgsrc/mail/dcc/Makefile:1.13       Sun May 28 11:50:07 2017
+++ pkgsrc/mail/dcc/Makefile    Wed Jul  4 13:40:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2017/05/28 11:50:07 maya Exp $
+# $NetBSD: Makefile,v 1.14 2018/07/04 13:40:22 jperkin Exp $
 
 DISTNAME=              dcc-1.3.159
 #PKGREVISION=          2
@@ -26,7 +26,7 @@ FILES_SUBST+=         DCC_FIXMAP=${PREFIX}/libe
 
 # enabling/disabling daemons is done in rc.conf
 SUBST_CLASSES+=                dae
-SUBST_STAGE.dae=       post-patch
+SUBST_STAGE.dae=       pre-configure
 SUBST_FILES.dae=       homedir/dcc_conf.in
 SUBST_SED.dae=         -e 's/^\(DCCD_ENABLE=\).*$$/\1on/'
 SUBST_SED.dae+=                -e 's/^\(GREY_ENABLE=\).*$$/\1on/'

Index: pkgsrc/mail/deliver/Makefile
diff -u pkgsrc/mail/deliver/Makefile:1.17 pkgsrc/mail/deliver/Makefile:1.18
--- pkgsrc/mail/deliver/Makefile:1.17   Mon Jan  1 18:16:37 2018
+++ pkgsrc/mail/deliver/Makefile        Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2018/01/01 18:16:37 rillig Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      deliver-2.1.14
 PKGREVISION=   3
@@ -34,7 +34,7 @@ SPECIAL_PERMS+=               bin/deliver ${SETUID_RO
 .endif
 
 SUBST_CLASSES+=                        sources
-SUBST_STAGE.sources=           post-patch
+SUBST_STAGE.sources=           pre-configure
 SUBST_MESSAGE.sources=         Fixing source code.
 SUBST_FILES.sources=           config.h deliver.8 conf/os-netbsd.h
 SUBST_SED.sources=             -e 's,@DELIVER_CONF_PREFIX@,${PKG_SYSCONFDIR},g'

Index: pkgsrc/mail/dk-milter/Makefile
diff -u pkgsrc/mail/dk-milter/Makefile:1.29 pkgsrc/mail/dk-milter/Makefile:1.30
--- pkgsrc/mail/dk-milter/Makefile:1.29 Fri Feb  2 00:20:45 2018
+++ pkgsrc/mail/dk-milter/Makefile      Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2018/02/02 00:20:45 rillig Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      dk-milter-1.0.2
 PKGREVISION=   1
@@ -18,7 +18,7 @@ USE_TOOLS+=           gm4
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES+=                libs
-SUBST_STAGE.libs=      post-patch
+SUBST_STAGE.libs=      pre-configure
 SUBST_FILES.libs=      site.config.m4.dist dk-filter/Makefile.m4 \
                        devtools/M4/header.m4
 SUBST_SED.libs=                -e 's|@SSLBASE@|${BUILDLINK_PREFIX.openssl}|g'

Index: pkgsrc/mail/dspam/Makefile
diff -u pkgsrc/mail/dspam/Makefile:1.92 pkgsrc/mail/dspam/Makefile:1.93
--- pkgsrc/mail/dspam/Makefile:1.92     Sat Apr 14 07:34:30 2018
+++ pkgsrc/mail/dspam/Makefile  Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.92 2018/04/14 07:34:30 adam Exp $
+# $NetBSD: Makefile,v 1.93 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      dspam-3.10.2
 PKGREVISION=   21
@@ -26,7 +26,7 @@ REPLACE_PERL+=                webui/cgi-bin/templates/
 PKGCONFIG_OVERRIDE+=   src/dspam.pc.in
 
 SUBST_CLASSES+=                cgi
-SUBST_STAGE.cgi=       post-patch
+SUBST_STAGE.cgi=       pre-configure
 SUBST_FILES.cgi=       webui/cgi-bin/templates/nav_performance.html
 SUBST_FILES.cgi+=      webui/cgi-bin/configure.pl.in
 SUBST_FILES.cgi+=      webui/cgi-bin/dspam.cgi webui/cgi-bin/admin.cgi

Index: pkgsrc/mail/elm-me/Makefile
diff -u pkgsrc/mail/elm-me/Makefile:1.35 pkgsrc/mail/elm-me/Makefile:1.36
--- pkgsrc/mail/elm-me/Makefile:1.35    Sat Apr  6 15:46:37 2013
+++ pkgsrc/mail/elm-me/Makefile Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2013/04/06 15:46:37 rodent Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=              elm-2.4ME+93
 PKGNAME=               elm-me-2.4.93
@@ -30,7 +30,7 @@ CONF_FILES=           ${PREFIX}/lib/elm.mimetypes
 USE_TOOLS+=    ksh
 
 SUBST_CLASSES+=                errno
-SUBST_STAGE.errno=     post-patch
+SUBST_STAGE.errno=     pre-configure
 SUBST_MESSAGE.errno=   Fixing declaration of errno.
 SUBST_FILES.errno=     */*.c
 SUBST_SED.errno=       -e 's,^extern int errno;,\#include <errno.h>,'

Index: pkgsrc/mail/exim/Makefile
diff -u pkgsrc/mail/exim/Makefile:1.160 pkgsrc/mail/exim/Makefile:1.161
--- pkgsrc/mail/exim/Makefile:1.160     Mon Apr 23 07:28:18 2018
+++ pkgsrc/mail/exim/Makefile   Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.160 2018/04/23 07:28:18 adam Exp $
+# $NetBSD: Makefile,v 1.161 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      exim-4.91
 CATEGORIES=    mail net
@@ -62,7 +62,7 @@ SUBST_FILES.exim=     scripts/exim_install
 SUBST_VARS.exim=       PKGSRC_EXIM_VERSION
 
 SUBST_CLASSES+=                cflags
-SUBST_STAGE.cflags=    post-patch
+SUBST_STAGE.cflags=    pre-configure
 SUBST_MESSAGE.cflags=  Removing hard-coded CFLAGS
 SUBST_FILES.cflags=    OS/Makefile-*
 SUBST_SED.cflags=      -e 's,^CFLAGS=.*,,'

Index: pkgsrc/mail/exim3/Makefile
diff -u pkgsrc/mail/exim3/Makefile:1.51 pkgsrc/mail/exim3/Makefile:1.52
--- pkgsrc/mail/exim3/Makefile:1.51     Thu Mar  8 15:14:54 2018
+++ pkgsrc/mail/exim3/Makefile  Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.51 2018/03/08 15:14:54 maya Exp $
+# $NetBSD: Makefile,v 1.52 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      exim-3.36
 PKGREVISION=   18
@@ -79,7 +79,7 @@ SUBST_SED.paths+=     -e 's,@GZIP_CMD@,${GZI
 SUBST_SED.paths+=      -e 's,@GZCAT@,${GZCAT},g'
 SUBST_SED.paths+=      -e 's,@PERL5@,${PERL5},g'
 SUBST_SED.paths+=      -e 's,@SH@,${SH},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 INSTALLATION_DIRS=     ${PKGMANDIR}/man8 sbin share/examples/exim
 

Index: pkgsrc/mail/gld/Makefile
diff -u pkgsrc/mail/gld/Makefile:1.32 pkgsrc/mail/gld/Makefile:1.33
--- pkgsrc/mail/gld/Makefile:1.32       Tue Aug  1 14:59:01 2017
+++ pkgsrc/mail/gld/Makefile    Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2017/08/01 14:59:01 wiz Exp $
+# $NetBSD: Makefile,v 1.33 2018/07/04 13:40:23 jperkin Exp $
 #
 
 DISTNAME=              gld-1.7
@@ -29,11 +29,11 @@ PKG_GROUPS_VARS+=   GLD_GROUP
 PKG_USERS_VARS+=       GLD_USER
 
 SUBST_CLASSES+=                gld users
-SUBST_STAGE.gld=       post-patch
+SUBST_STAGE.gld=       pre-configure
 SUBST_FILES.gld=       gld.h
 SUBST_SED.gld=         -e "s,/etc,${PKG_SYSCONFDIR},"
 SUBST_MESSAGE.gld=     Fixing harcoded paths.
-SUBST_STAGE.users=     post-patch
+SUBST_STAGE.users=     pre-configure
 SUBST_FILES.users=     gld.conf
 SUBST_SED.users+=      -e "s|^USER=nobody|USER=${GLD_USER}|"
 SUBST_SED.users+=      -e "s|^GROUP=nobody|GROUP=${GLD_GROUP}|"

Index: pkgsrc/mail/gnus/Makefile
diff -u pkgsrc/mail/gnus/Makefile:1.23 pkgsrc/mail/gnus/Makefile:1.24
--- pkgsrc/mail/gnus/Makefile:1.23      Sun Nov 23 05:59:45 2014
+++ pkgsrc/mail/gnus/Makefile   Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2014/11/23 05:59:45 mef Exp $
+# $NetBSD: Makefile,v 1.24 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      gnus-5.10.10
 PKGNAME=       ${EMACS_PKGNAME_PREFIX}${DISTNAME}
@@ -28,7 +28,7 @@ INFO_FILES=           yes
 
 SUBST_CLASSES+=                destdir
 SUBST_FILES.destdir=   etc/Makefile.in lisp/Makefile.in texi/Makefile.in
-SUBST_STAGE.destdir=   post-patch
+SUBST_STAGE.destdir=   pre-configure
 SUBST_MESSAGE.destdir= Convert install to ${DESTDIR}
 SUBST_SED.destdir=     -e  '/(etcdir)/s,\$$(etcdir),\$$(DESTDIR)/\$$(etcdir)/,'
 SUBST_SED.destdir+=    -e '/(lispdir)/s,\$$(lispdir),\$$(DESTDIR)/\$$(lispdir)/,'

Index: pkgsrc/mail/mailman/Makefile
diff -u pkgsrc/mail/mailman/Makefile:1.81 pkgsrc/mail/mailman/Makefile:1.82
--- pkgsrc/mail/mailman/Makefile:1.81   Tue Jul  3 05:03:23 2018
+++ pkgsrc/mail/mailman/Makefile        Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.81 2018/07/03 05:03:23 adam Exp $
+# $NetBSD: Makefile,v 1.82 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      mailman-2.1.25
 PKGNAME=       mailman-2.1.25
@@ -95,7 +95,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     ${WRKDIR}/mailman.conf.dist
 SUBST_SED.paths+=      -e 's,@EXECDIR@,${EXECDIR},g'
 SUBST_SED.paths+=      -e 's,@MAILMAN_DATADIR@,${MAILMAN_DATADIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 DOCFILELIST=   ACKNOWLEDGMENTS BUGS FAQ INSTALL NEWS README \
                README-I18N.en README.CONTRIB README.NETSCAPE \

Index: pkgsrc/mail/metamail/Makefile
diff -u pkgsrc/mail/metamail/Makefile:1.52 pkgsrc/mail/metamail/Makefile:1.53
--- pkgsrc/mail/metamail/Makefile:1.52  Thu Jan 19 18:52:16 2017
+++ pkgsrc/mail/metamail/Makefile       Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.52 2017/01/19 18:52:16 agc Exp $
+# $NetBSD: Makefile,v 1.53 2018/07/04 13:40:23 jperkin Exp $
 
 DISTNAME=      mm2.7
 PKGNAME=       metamail-2.7
@@ -34,11 +34,11 @@ REPLACE_CSH+=       fonts/Xmailto-hebrew fonts
 INSTALLATION_DIRS=     bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man4 ${EGDIR}
 
 SUBST_CLASSES+=                awk sys
-SUBST_STAGE.awk=       post-patch
+SUBST_STAGE.awk=       pre-configure
 SUBST_MESSAGE.awk=     Adjusting the path to awk
 SUBST_FILES.awk=       bin/sun2mime
 SUBST_SED.awk=         -e "s|/bin/nawk|${AWK}|"
-SUBST_STAGE.sys=       post-patch
+SUBST_STAGE.sys=       pre-configure
 SUBST_MESSAGE.sys=     Adjusting the path for PKG_SYSCONFDIR.
 SUBST_FILES.sys=       config.h
 SUBST_SED.sys=         -e "s|PKG_SYSCONFDIR|\"${PKG_SYSCONFDIR}\"|g"

Index: pkgsrc/mail/minimalist/Makefile
diff -u pkgsrc/mail/minimalist/Makefile:1.7 pkgsrc/mail/minimalist/Makefile:1.8
--- pkgsrc/mail/minimalist/Makefile:1.7 Sun Sep  3 08:36:55 2017
+++ pkgsrc/mail/minimalist/Makefile     Wed Jul  4 13:40:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2017/09/03 08:36:55 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:23 jperkin Exp $
 #
 
 DISTNAME=      minimalist-2.5.4-1
@@ -23,7 +23,7 @@ CONF_FILES=   ${EGDIR}/minimalist.conf ${P
 WRKSRC=                ${WRKDIR}/${DISTNAME:S/-1/.1/1}
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      minimalist.conf-sample
 SUBST_FILES.path+=     minimalist.pl
 SUBST_FILES.path+=     contrib/minimalist_request.pl

Index: pkgsrc/mail/mush/Makefile
diff -u pkgsrc/mail/mush/Makefile:1.29 pkgsrc/mail/mush/Makefile:1.30
--- pkgsrc/mail/mush/Makefile:1.29      Thu Feb 25 15:00:51 2016
+++ pkgsrc/mail/mush/Makefile   Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2016/02/25 15:00:51 jperkin Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:24 jperkin Exp $
 
 DISTNAME=      mush-7.2.5
 PKGNAME=       mush-7.2.6.b4.pl1
@@ -40,7 +40,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     config.h-dist ${PLAT_MAKEFILE}
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.paths+=      -e 's,@MANDIR@,${PREFIX}/${PKGMANDIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 pre-configure:
        ${CP} ${WRKSRC}/config.h-dist ${WRKSRC}/config.h

Index: pkgsrc/mail/neomutt/options.mk
diff -u pkgsrc/mail/neomutt/options.mk:1.11 pkgsrc/mail/neomutt/options.mk:1.12
--- pkgsrc/mail/neomutt/options.mk:1.11 Thu Dec 21 12:22:13 2017
+++ pkgsrc/mail/neomutt/options.mk      Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.11 2017/12/21 12:22:13 wiz Exp $
+# $NetBSD: options.mk,v 1.12 2018/07/04 13:40:24 jperkin Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.neomutt
 PKG_OPTIONS_REQUIRED_GROUPS=   display
@@ -63,7 +63,7 @@ LDFLAGS.SunOS+=                       ${COMPILER_RPATH_FLAG}
 .else
 SUBST_CLASSES+=                curse
 SUBST_MESSAGE.curse=   Fixing mutt to avoid ncursesw
-SUBST_STAGE.curse=     post-patch
+SUBST_STAGE.curse=     pre-configure
 SUBST_FILES.curse=     configure.ac
 SUBST_SED.curse=       -e 's,for lib in ncurses ncursesw,for lib in ncurses,'
 .endif

Index: pkgsrc/mail/opensmtpd/Makefile
diff -u pkgsrc/mail/opensmtpd/Makefile:1.10 pkgsrc/mail/opensmtpd/Makefile:1.11
--- pkgsrc/mail/opensmtpd/Makefile:1.10 Sun Sep  3 08:53:10 2017
+++ pkgsrc/mail/opensmtpd/Makefile      Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2017/09/03 08:53:10 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:24 jperkin Exp $
 
 VERSION=       5.7.3p2
 DISTNAME=      opensmtpd-${VERSION}
@@ -48,7 +48,7 @@ RCD_SCRIPTS=  opensmtpd
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKDIR}/mailer.conf
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 SUBST_CLASSES+=                        exampledir
 SUBST_STAGE.exampledir=                pre-configure

Index: pkgsrc/mail/pfqueue/Makefile
diff -u pkgsrc/mail/pfqueue/Makefile:1.14 pkgsrc/mail/pfqueue/Makefile:1.15
--- pkgsrc/mail/pfqueue/Makefile:1.14   Tue Sep  8 11:57:50 2015
+++ pkgsrc/mail/pfqueue/Makefile        Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2015/09/08 11:57:50 jperkin Exp $
+# $NetBSD: Makefile,v 1.15 2018/07/04 13:40:24 jperkin Exp $
 #
 
 DISTNAME=      pfqueue-0.5.6
@@ -32,7 +32,7 @@ SUBST_SED.make+=      -e 's,-module,,'
 
 SUBST_CLASSES+=                conf
 SUBST_MESSAGE.conf=    Fixing path to config file
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      pfqconfig.c pfqueue.conf.5
 SUBST_SED.conf=                -e 's|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g'
 

Index: pkgsrc/mail/pfqueue/options.mk
diff -u pkgsrc/mail/pfqueue/options.mk:1.1 pkgsrc/mail/pfqueue/options.mk:1.2
--- pkgsrc/mail/pfqueue/options.mk:1.1  Fri Nov 20 13:14:13 2009
+++ pkgsrc/mail/pfqueue/options.mk      Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2009/11/20 13:14:13 fhajny Exp $
+# $NetBSD: options.mk,v 1.2 2018/07/04 13:40:24 jperkin Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.pfqueue
 
@@ -34,7 +34,7 @@ PLIST.socket= yes
 .endif
 
 SUBST_CLASSES+=                backends
-SUBST_STAGE.backends=  post-patch
+SUBST_STAGE.backends=  pre-configure
 SUBST_MESSAGE.backends=        Enabling backends
 SUBST_FILES.backends=  backends/Makefile.in
 SUBST_SED.backends=    -e 's|@PFQ_BACKENDS@|${PFQ_BACKENDS:Q}|'

Index: pkgsrc/mail/postfix/Makefile
diff -u pkgsrc/mail/postfix/Makefile:1.302 pkgsrc/mail/postfix/Makefile:1.303
--- pkgsrc/mail/postfix/Makefile:1.302  Mon May 21 14:49:47 2018
+++ pkgsrc/mail/postfix/Makefile        Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.302 2018/05/21 14:49:47 taca Exp $
+# $NetBSD: Makefile,v 1.303 2018/07/04 13:40:24 jperkin Exp $
 
 .include "../../mail/postfix/Makefile.common"
 
@@ -49,7 +49,7 @@ CONF_FILES_PERMS=     # empty
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKDIR}/mailer.conf
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 INSTALLATION_DIRS+=    ${LIBEXECDIR} ${METADIR} ${SHLIBDIR} ${EXAMPLEDIR} ${DOCDIR}
 

Index: pkgsrc/mail/qmail/options.mk
diff -u pkgsrc/mail/qmail/options.mk:1.48 pkgsrc/mail/qmail/options.mk:1.49
--- pkgsrc/mail/qmail/options.mk:1.48   Mon May 28 12:57:36 2018
+++ pkgsrc/mail/qmail/options.mk        Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.48 2018/05/28 12:57:36 schmonz Exp $
+# $NetBSD: options.mk,v 1.49 2018/07/04 13:40:24 jperkin Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.qmail
 PKG_SUPPORTED_OPTIONS+=                eai sasl syncdir tls
@@ -88,7 +88,7 @@ PATCH_DIST_STRIP.${SRS_PATCH}=        -l
 PATCH_DIST_CAT.${SRS_PATCH}=   ${SED} -e 's|binm3 binm3+df|binm3 binm3+df update_tmprsadh|g' < ${SRS_PATCH}
 SUBST_CLASSES+=                        srsnetq1 srsnetq2
 SUBST_STAGE.srsnetq1=          pre-patch
-SUBST_STAGE.srsnetq2=          post-patch
+SUBST_STAGE.srsnetq2=          pre-configure
 SUBST_FILES.srsnetq1=          Makefile
 SUBST_FILES.srsnetq2=          Makefile
 SUBST_SED.srsnetq1=            -e 's|^auto_split.o env.a$$|auto_split.o|'

Index: pkgsrc/mail/qmail-run/Makefile
diff -u pkgsrc/mail/qmail-run/Makefile:1.44 pkgsrc/mail/qmail-run/Makefile:1.45
--- pkgsrc/mail/qmail-run/Makefile:1.44 Sat Aug  5 15:21:03 2017
+++ pkgsrc/mail/qmail-run/Makefile      Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.44 2017/08/05 15:21:03 schmonz Exp $
+# $NetBSD: Makefile,v 1.45 2018/07/04 13:40:24 jperkin Exp $
 #
 
 DISTNAME=              qmail-run-20170805
@@ -59,7 +59,7 @@ SUBST_SED.paths+=     -e 's,@SH@,${SH},g'
 SUBST_SED.paths+=      -e 's,@SED@,${SED},g'
 SUBST_SED.paths+=      -e 's,@PKGNAME@,${PKGNAME},g'
 SUBST_SED.paths+=      -e 's,@TRUE@,${TRUE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 .include "options.mk"
 

Index: pkgsrc/mail/spamd/Makefile
diff -u pkgsrc/mail/spamd/Makefile:1.18 pkgsrc/mail/spamd/Makefile:1.19
--- pkgsrc/mail/spamd/Makefile:1.18     Mon Sep  4 18:00:57 2017
+++ pkgsrc/mail/spamd/Makefile  Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2017/09/04 18:00:57 wiz Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:24 jperkin Exp $
 
 DISTNAME=              spamd-20060330
 PKGREVISION=           2
@@ -30,7 +30,7 @@ SPAMD_CONF=           ${PKG_SYSCONFDIR}/spamd.con
 CONF_FILES=            ${PREFIX}/share/examples/spamd/spamd.conf ${SPAMD_CONF}
 
 SUBST_CLASSES+=                fix
-SUBST_STAGE.fix=       post-patch
+SUBST_STAGE.fix=       pre-configure
 SUBST_FILES.fix=       spamd/spamd.8
 SUBST_FILES.fix+=      spamd-setup/spamd-setup.8
 SUBST_SED.fix=         -e 's,/etc/spamd.conf,${SPAMD_CONF},g'

Index: pkgsrc/mail/sympa/Makefile
diff -u pkgsrc/mail/sympa/Makefile:1.67 pkgsrc/mail/sympa/Makefile:1.68
--- pkgsrc/mail/sympa/Makefile:1.67     Fri Feb  2 00:20:45 2018
+++ pkgsrc/mail/sympa/Makefile  Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.67 2018/02/02 00:20:45 rillig Exp $
+# $NetBSD: Makefile,v 1.68 2018/07/04 13:40:24 jperkin Exp $
 
 DISTNAME=      sympa-6.2.16
 #PKGREVISION=  3
@@ -173,7 +173,7 @@ INSTALLATION_DIRS+= share/doc/sympa
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     configure
 SUBST_SED.paths=       -e "s|localstatedir/lib/sympa|localstatedir|g"
 SUBST_SED.paths+=      -e "s|prefix/static_content|prefix/sympa/static_content|g"

Index: pkgsrc/mail/up-imapproxy/Makefile
diff -u pkgsrc/mail/up-imapproxy/Makefile:1.12 pkgsrc/mail/up-imapproxy/Makefile:1.13
--- pkgsrc/mail/up-imapproxy/Makefile:1.12      Sat Mar  5 11:28:52 2016
+++ pkgsrc/mail/up-imapproxy/Makefile   Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2016/03/05 11:28:52 jperkin Exp $
+# $NetBSD: Makefile,v 1.13 2018/07/04 13:40:24 jperkin Exp $
 
 DISTNAME=      up-imapproxy-1.2.5
 PKGREVISION=   7
@@ -13,7 +13,7 @@ GNU_CONFIGURE=        YES
 RCD_SCRIPTS=   upimapproxy
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     include/imapproxy.h
 SUBST_SED.paths=       -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
 SUBST_MESSAGE.paths=   Fixing hard coded paths.

Index: pkgsrc/math/R-CGIwithR/Makefile
diff -u pkgsrc/math/R-CGIwithR/Makefile:1.20 pkgsrc/math/R-CGIwithR/Makefile:1.21
--- pkgsrc/math/R-CGIwithR/Makefile:1.20        Tue Apr 17 22:29:43 2018
+++ pkgsrc/math/R-CGIwithR/Makefile     Wed Jul  4 13:40:24 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2018/04/17 22:29:43 wiz Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:24 jperkin Exp $
 #
 
 PKGREVISION=           15
@@ -18,7 +18,7 @@ REPLACE.r.new=                ${PREFIX}/bin/R
 REPLACE_FILES.r=       inst/examples/dangerous.R inst/examples/trivial.R
 
 SUBST_CLASSES+=                        fix-paths
-SUBST_STAGE.fix-paths=         post-patch
+SUBST_STAGE.fix-paths=         pre-configure
 SUBST_MESSAGE.fix-paths=       Fixing absolute paths.
 SUBST_FILES.fix-paths=         inst/cgi-bin/R.cgi
 SUBST_SED.fix-paths=           -e 's,/usr/local,${PREFIX},g'

Index: pkgsrc/math/R-nloptr/Makefile
diff -u pkgsrc/math/R-nloptr/Makefile:1.2 pkgsrc/math/R-nloptr/Makefile:1.3
--- pkgsrc/math/R-nloptr/Makefile:1.2   Wed Mar  7 19:18:56 2018
+++ pkgsrc/math/R-nloptr/Makefile       Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2018/03/07 19:18:56 minskim Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:25 jperkin Exp $
 #
 
 CATEGORIES=    math
@@ -16,7 +16,7 @@ USE_LANGUAGES=        c c++
 USE_TOOLS+=    pkg-config
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf+=     configure
 SUBST_MESSAGE.conf=    Fixing redirection of configure.
 SUBST_SED.conf=                -e "s,<<<,<,g"

Index: pkgsrc/math/qalculate/Makefile
diff -u pkgsrc/math/qalculate/Makefile:1.47 pkgsrc/math/qalculate/Makefile:1.48
--- pkgsrc/math/qalculate/Makefile:1.47 Fri Mar 25 21:08:58 2016
+++ pkgsrc/math/qalculate/Makefile      Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.47 2016/03/25 21:08:58 joerg Exp $
+# $NetBSD: Makefile,v 1.48 2018/07/04 13:40:25 jperkin Exp $
 
 DISTNAME=      libqalculate-0.9.7
 PKGNAME=       qalculate-0.9.7
@@ -22,7 +22,7 @@ UNLIMIT_RESOURCES=    datasize
 SUBST_CLASSES+=                pthread
 SUBST_FILES.pthread=   libqalculate.pc.in
 SUBST_SED.pthread+=    -e 's,@PTHREAD_LIBS@,${PTHREAD_LDFLAGS} ${PTHREAD_LIBS},g'
-SUBST_STAGE.pthread=   post-patch
+SUBST_STAGE.pthread=   pre-configure
 
 PTHREAD_AUTO_VARS=     yes
 

Index: pkgsrc/mbone/beacon/Makefile
diff -u pkgsrc/mbone/beacon/Makefile:1.24 pkgsrc/mbone/beacon/Makefile:1.25
--- pkgsrc/mbone/beacon/Makefile:1.24   Tue Aug  1 16:47:39 2017
+++ pkgsrc/mbone/beacon/Makefile        Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2017/08/01 16:47:39 wiz Exp $
+# $NetBSD: Makefile,v 1.25 2018/07/04 13:40:25 jperkin Exp $
 #
 
 DISTNAME=      beacon-1.3
@@ -21,7 +21,7 @@ PERL5_PACKLIST=               auto/Net/Multicast/Beac
 
 SUBST_CLASSES+=                conf
 SUBST_FILES.conf=      src/beacon.in
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_SED.conf=                -e s,@prefix@/etc,${PKG_SYSCONFDIR},
 
 CONF_FILES+=   ${PREFIX}/share/examples/beacon/beacon.conf \

Index: pkgsrc/misc/ansiweather/Makefile
diff -u pkgsrc/misc/ansiweather/Makefile:1.7 pkgsrc/misc/ansiweather/Makefile:1.8
--- pkgsrc/misc/ansiweather/Makefile:1.7        Tue Feb 21 11:36:43 2017
+++ pkgsrc/misc/ansiweather/Makefile    Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2017/02/21 11:36:43 maya Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:25 jperkin Exp $
 
 DISTNAME=      ansiweather-1.10
 CATEGORIES=    misc
@@ -29,7 +29,7 @@ CONF_FILES+=  ${EGDIR}/ansiweatherrc.exam
 SUBST_CLASSES+=                config
 SUBST_FILES.config=    ansiweather
 SUBST_SED.config=      -e 's,~/.ansiweatherrc,${PKG_SYSCONFDIR}/ansiweatherrc,'
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 
 AUTO_MKDIRS=           yes
 INSTALLATION_DIRS+=    ${PKGMANDIR}/man1

Index: pkgsrc/misc/ascii/Makefile
diff -u pkgsrc/misc/ascii/Makefile:1.16 pkgsrc/misc/ascii/Makefile:1.17
--- pkgsrc/misc/ascii/Makefile:1.16     Mon Mar  7 19:59:32 2016
+++ pkgsrc/misc/ascii/Makefile  Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2016/03/07 19:59:32 nros Exp $
+# $NetBSD: Makefile,v 1.17 2018/07/04 13:40:25 jperkin Exp $
 #
 
 DISTNAME=      ascii-3.15
@@ -19,7 +19,7 @@ EGDIR=                        ${PREFIX}/share/examples/${PKGB
 SUBST_CLASSES+=                prefix
 SUBST_MESSAGE.prefix=  Install PATH to ${PREFIX}
 SUBST_FILES.prefix=    Makefile
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_SED.prefix=      -e '/PREFIX/s,/usr,${PREFIX},'
 
 post-install:

Index: pkgsrc/misc/brs/Makefile
diff -u pkgsrc/misc/brs/Makefile:1.12 pkgsrc/misc/brs/Makefile:1.13
--- pkgsrc/misc/brs/Makefile:1.12       Tue Aug  1 17:40:14 2017
+++ pkgsrc/misc/brs/Makefile    Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2017/08/01 17:40:14 wiz Exp $
+# $NetBSD: Makefile,v 1.13 2018/07/04 13:40:25 jperkin Exp $
 #
 
 DISTNAME=      brs.4.00.l1
@@ -15,7 +15,7 @@ WRKSRC=               ${WRKDIR}/bible
 BUILD_TARGET=  bible
 
 SUBST_CLASSES+=                man
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_FILES.man=       bible.1
 SUBST_SED.man=         -e s,/usr/local/lib,${PREFIX}/libdata/${PKGBASE},
 BUILDLINK_TRANSFORM+=  rm:-fwritable-strings   # gcc4 doesn't know it.

Index: pkgsrc/misc/calibre/Makefile
diff -u pkgsrc/misc/calibre/Makefile:1.206 pkgsrc/misc/calibre/Makefile:1.207
--- pkgsrc/misc/calibre/Makefile:1.206  Sun Jun 24 11:16:11 2018
+++ pkgsrc/misc/calibre/Makefile        Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.206 2018/06/24 11:16:11 wiz Exp $
+# $NetBSD: Makefile,v 1.207 2018/07/04 13:40:25 jperkin Exp $
 
 DISTNAME=      calibre-3.26.1
 PKGREVISION=   2
@@ -55,14 +55,14 @@ FIX_PYTHON_FILES+=  */*/*/*/*/*/*.py
 SUBST_CLASSES+=                prefix
 SUBST_SED.prefix=      -e "s,^QMAKE =.*,QMAKE = '${PREFIX}/qt5/bin/qmake',"
 SUBST_MESSAGE.prefix=  Fixing path to QMAKE
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    setup/build_environment.py
 
 # This one is for /usr/bin/env python (or even /usr/bin/env Python or /usr/bin/python2)
 SUBST_CLASSES+=                path
 SUBST_SED.path=                -e "s,\#! */usr/bin/env *[Pp]ython[0-9.]*,\#!${PYTHONBIN},"
 SUBST_MESSAGE.path=    Fixing path to python.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      ${FIX_PYTHON_FILES}
 
 REPLACE_BASH+=         resources/calibre-portable.sh

Index: pkgsrc/misc/rox-memo/Makefile
diff -u pkgsrc/misc/rox-memo/Makefile:1.10 pkgsrc/misc/rox-memo/Makefile:1.11
--- pkgsrc/misc/rox-memo/Makefile:1.10  Sat May 17 16:10:47 2014
+++ pkgsrc/misc/rox-memo/Makefile       Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2014/05/17 16:10:47 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:25 jperkin Exp $
 #
 
 DISTNAME=      Memo-1.9.5
@@ -27,7 +27,7 @@ INSTALLATION_DIRS=    share/rox/Memo
 
 SUBST_CLASSES+=                lib
 SUBST_MESSAGE.lib=     Fixing hardcoded paths for ROX-Lib.
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 SUBST_FILES.lib=       findrox.py
 SUBST_SED.lib=         -e 's,/usr/local/lib,${PREFIX}/share/rox,g'
 

Index: pkgsrc/misc/screen/Makefile
diff -u pkgsrc/misc/screen/Makefile:1.106 pkgsrc/misc/screen/Makefile:1.107
--- pkgsrc/misc/screen/Makefile:1.106   Thu Feb  1 13:34:33 2018
+++ pkgsrc/misc/screen/Makefile Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.106 2018/02/01 13:34:33 jperkin Exp $
+# $NetBSD: Makefile,v 1.107 2018/07/04 13:40:25 jperkin Exp $
 
 DISTNAME=      screen-4.6.2
 PKGREVISION=   1
@@ -39,7 +39,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     etc/etcscreenrc doc/screen.1
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
 SUBST_SED.paths+=      -e 's,@EXAMPLES@,${PREFIX}/share/examples/screen,g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 PLIST_VARS+=           terminfo
 

Index: pkgsrc/misc/send-pr/Makefile
diff -u pkgsrc/misc/send-pr/Makefile:1.3 pkgsrc/misc/send-pr/Makefile:1.4
--- pkgsrc/misc/send-pr/Makefile:1.3    Mon Oct  8 09:57:37 2012
+++ pkgsrc/misc/send-pr/Makefile        Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2012/10/08 09:57:37 asau Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:25 jperkin Exp $
 
 DISTNAME=      gnats-3.113.1
 PKGNAME=       send-pr-${GNATS_VERSION}
@@ -49,7 +49,7 @@ MAKE_DIRS+=           ${PKG_SYSCONFDIR}/gnats \
                        ${PKG_SYSCONFDIR}/gnats/gnats-adm
 
 SUBST_CLASSES+=                fix-paths
-SUBST_STAGE.fix-paths= post-patch
+SUBST_STAGE.fix-paths= pre-configure
 SUBST_MESSAGE.fix-paths=Fixing paths
 SUBST_FILES.fix-paths= send-pr.sh
 SUBST_SED.fix-paths=   -e 's,install-sid,${PREFIX}/bin/install-sid,'

Index: pkgsrc/misc/vimpager/Makefile
diff -u pkgsrc/misc/vimpager/Makefile:1.8 pkgsrc/misc/vimpager/Makefile:1.9
--- pkgsrc/misc/vimpager/Makefile:1.8   Sun Mar  4 16:26:51 2018
+++ pkgsrc/misc/vimpager/Makefile       Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2018/03/04 16:26:51 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:25 jperkin Exp $
 
 DISTNAME=      vimpager-1.8.9
 CATEGORIES=    misc
@@ -16,7 +16,7 @@ NO_BUILD=     yes
 USE_TOOLS+=    sh:run bash:run
 
 SUBST_CLASSES+=                vimpager
-SUBST_STAGE.vimpager=  post-patch
+SUBST_STAGE.vimpager=  pre-configure
 SUBST_FILES.vimpager=  vimpager
 SUBST_SED.vimpager=    -e 's,/usr/local/etc/,${PKG_SYSCONFDIR}/,g'
 

Index: pkgsrc/misc/zyGrib/Makefile
diff -u pkgsrc/misc/zyGrib/Makefile:1.49 pkgsrc/misc/zyGrib/Makefile:1.50
--- pkgsrc/misc/zyGrib/Makefile:1.49    Mon Mar 12 11:17:10 2018
+++ pkgsrc/misc/zyGrib/Makefile Wed Jul  4 13:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.49 2018/03/12 11:17:10 wiz Exp $
+# $NetBSD: Makefile,v 1.50 2018/07/04 13:40:25 jperkin Exp $
 #
 
 DISTNAME=      zyGrib-7.0.0
@@ -21,7 +21,7 @@ USE_TOOLS+=   make
 CONFIGURE_ENV+=        QTDIR=${QTDIR}
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_MESSAGE.paths=   Fixing shared data paths.
 SUBST_FILES.paths=     util/Util.h
 SUBST_VARS.paths=      PREFIX

Index: pkgsrc/multimedia/avidemux/Makefile
diff -u pkgsrc/multimedia/avidemux/Makefile:1.104 pkgsrc/multimedia/avidemux/Makefile:1.105
--- pkgsrc/multimedia/avidemux/Makefile:1.104   Mon Apr 16 14:34:55 2018
+++ pkgsrc/multimedia/avidemux/Makefile Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.104 2018/04/16 14:34:55 wiz Exp $
+# $NetBSD: Makefile,v 1.105 2018/07/04 13:40:26 jperkin Exp $
 #
 
 DISTNAME=      avidemux_2.5.4
@@ -33,7 +33,7 @@ LIBS+=                        ${LIBOSSAUDIO}
 CFLAGS+=               -D__STDC_CONSTANT_MACROS
 
 SUBST_CLASSES=         audio
-SUBST_STAGE.audio=     post-patch
+SUBST_STAGE.audio=     pre-configure
 SUBST_FILES.audio=     plugins/ADM_audioDevices/Oss/ADM_deviceoss.cpp
 SUBST_SED.audio=       -e "s|\\/dev\\/dsp|${DEVOSSAUDIO}|g"
 SUBST_MESSAGE.audio=   Fixing hardcoded audio device.

Index: pkgsrc/multimedia/dvdrip/Makefile
diff -u pkgsrc/multimedia/dvdrip/Makefile:1.61 pkgsrc/multimedia/dvdrip/Makefile:1.62
--- pkgsrc/multimedia/dvdrip/Makefile:1.61      Tue Aug  1 14:59:02 2017
+++ pkgsrc/multimedia/dvdrip/Makefile   Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.61 2017/08/01 14:59:02 wiz Exp $
+# $NetBSD: Makefile,v 1.62 2018/07/04 13:40:26 jperkin Exp $
 
 DISTNAME=      dvdrip-0.98.11
 PKGREVISION=   7
@@ -38,7 +38,7 @@ MAKE_JOBS_SAFE=               no
 PERL5_PACKLIST= auto/Video/DVDRip/.packlist
 
 SUBST_CLASSES+=                fping
-SUBST_STAGE.fping=     post-patch
+SUBST_STAGE.fping=     pre-configure
 SUBST_FILES.fping+=    lib/Video/DVDRip/Cluster/Master.pm
 SUBST_SED.fping=       -e "s|/usr/sbin|${PREFIX}/sbin|g"
 SUBST_MESSAGE.fping=   Fixing hardcoded path.

Index: pkgsrc/multimedia/ffmpeg010/Makefile.common
diff -u pkgsrc/multimedia/ffmpeg010/Makefile.common:1.12 pkgsrc/multimedia/ffmpeg010/Makefile.common:1.13
--- pkgsrc/multimedia/ffmpeg010/Makefile.common:1.12    Thu Jan 25 14:15:25 2018
+++ pkgsrc/multimedia/ffmpeg010/Makefile.common Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.12 2018/01/25 14:15:25 jperkin Exp $
+# $NetBSD: Makefile.common,v 1.13 2018/07/04 13:40:26 jperkin Exp $
 # used by multimedia/ffmpeg010/Makefile
 
 DISTNAME=      ffmpeg-${DISTVERSION:S/-//g}
@@ -33,7 +33,7 @@ REPLACE_PERL+=        doc/texi2pod.pl
 REPLACE_SH+=   configure version.sh
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      ffserver.c
 SUBST_SED.conf=                -e 's,/etc/ffserver.conf,${PKG_SYSCONFDIR}/ffserver.conf,g'
 SUBST_MESSAGE.conf=    Fixing configuration path.

Index: pkgsrc/multimedia/ffmpeg1/Makefile.common
diff -u pkgsrc/multimedia/ffmpeg1/Makefile.common:1.7 pkgsrc/multimedia/ffmpeg1/Makefile.common:1.8
--- pkgsrc/multimedia/ffmpeg1/Makefile.common:1.7       Thu Jan 25 14:15:25 2018
+++ pkgsrc/multimedia/ffmpeg1/Makefile.common   Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.7 2018/01/25 14:15:25 jperkin Exp $
+# $NetBSD: Makefile.common,v 1.8 2018/07/04 13:40:26 jperkin Exp $
 # used by multimedia/ffplay1/Makefile
 # used by multimedia/ffmpeg1/Makefile
 
@@ -66,7 +66,7 @@ REPLACE_PERL+=        doc/texi2pod.pl
 REPLACE_SH+=   configure version.sh
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      ffserver.c
 SUBST_SED.conf=                -e 's,/etc/ffserver.conf,${PKG_SYSCONFDIR}/ffserver.conf,g'
 SUBST_MESSAGE.conf=    Fixing configuration path.

Index: pkgsrc/multimedia/ffmpeg2/Makefile.common
diff -u pkgsrc/multimedia/ffmpeg2/Makefile.common:1.55 pkgsrc/multimedia/ffmpeg2/Makefile.common:1.56
--- pkgsrc/multimedia/ffmpeg2/Makefile.common:1.55      Sun Feb 25 20:35:44 2018
+++ pkgsrc/multimedia/ffmpeg2/Makefile.common   Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.55 2018/02/25 20:35:44 adam Exp $
+# $NetBSD: Makefile.common,v 1.56 2018/07/04 13:40:26 jperkin Exp $
 # used by multimedia/ffmpeg2/Makefile
 # used by multimedia/ffplay2/Makefile
 
@@ -76,7 +76,7 @@ REPLACE_PERL+=        doc/texi2pod.pl
 REPLACE_SH+=   configure version.sh
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      ffserver.c
 SUBST_SED.conf=                -e 's,/etc/ffserver.conf,${PKG_SYSCONFDIR}/ffserver.conf,g'
 SUBST_MESSAGE.conf=    Fixing configuration path.

Index: pkgsrc/multimedia/libmp4v2/Makefile
diff -u pkgsrc/multimedia/libmp4v2/Makefile:1.21 pkgsrc/multimedia/libmp4v2/Makefile:1.22
--- pkgsrc/multimedia/libmp4v2/Makefile:1.21    Mon Feb  5 18:37:21 2018
+++ pkgsrc/multimedia/libmp4v2/Makefile Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2018/02/05 18:37:21 jperkin Exp $
+# $NetBSD: Makefile,v 1.22 2018/07/04 13:40:26 jperkin Exp $
 
 DISTNAME=              mpeg4ip-1.6.1
 PKGNAME=               libmp4v2-1.6.1
@@ -29,7 +29,7 @@ BUILD_DIRS=           . lib/mp4v2/util
 
 # lowercase min,max cannot be used as macros, conflicts with libstdc++6
 SUBST_CLASSES+=                minmax
-SUBST_STAGE.minmax=    post-patch
+SUBST_STAGE.minmax=    pre-configure
 SUBST_FILES.minmax=    common/video/iso-mpeg4/src/*
 SUBST_SED.minmax=      -e 's,min *(,MIN(,g' -e 's,max *(,MAX(,g'
 SUBST_MESSAGE.minmax=  replace lowercase min,max with uppercase

Index: pkgsrc/multimedia/mediatomb/Makefile
diff -u pkgsrc/multimedia/mediatomb/Makefile:1.59 pkgsrc/multimedia/mediatomb/Makefile:1.60
--- pkgsrc/multimedia/mediatomb/Makefile:1.59   Sun Apr 29 21:31:57 2018
+++ pkgsrc/multimedia/mediatomb/Makefile        Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.59 2018/04/29 21:31:57 adam Exp $
+# $NetBSD: Makefile,v 1.60 2018/07/04 13:40:26 jperkin Exp $
 
 DISTNAME=      mediatomb-0.12.1
 PKGREVISION=   38
@@ -39,7 +39,7 @@ MEDIATOMB_HOME=               ${PKG_HOME.${MEDIATOMB_
 SUBST_CLASSES+=                config
 SUBST_FILES.config=    config.xml mediatomb.desktop
 SUBST_VARS.config=     MEDIATOMB_HOME PREFIX OPSYS
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 
 INSTALLATION_DIRS+=    share/applications share/examples/mediatomb
 

Index: pkgsrc/multimedia/mplayer-plugin/Makefile
diff -u pkgsrc/multimedia/mplayer-plugin/Makefile:1.45 pkgsrc/multimedia/mplayer-plugin/Makefile:1.46
--- pkgsrc/multimedia/mplayer-plugin/Makefile:1.45      Mon Apr 16 14:34:57 2018
+++ pkgsrc/multimedia/mplayer-plugin/Makefile   Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.45 2018/04/16 14:34:57 wiz Exp $
+# $NetBSD: Makefile,v 1.46 2018/07/04 13:40:26 jperkin Exp $
 #
 
 DISTNAME=              mplayerplug-in-3.55
@@ -26,7 +26,7 @@ CONFIGURE_ARGS+=      --disable-gtk1
 CONFIGURE_ENV+=                ac_cv_path_GECKO_XPIDL=${BUILDLINK_PREFIX.xulrunner192}/lib/xulrunner192/xpidl
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      Source/plugin-setup.cpp
 SUBST_SED.conf=                -e "s|/etc/|${PKG_SYSCONFDIR}/|g"
 SUBST_MESSAGE.conf=    Fixing harcoded paths.

Index: pkgsrc/multimedia/sickbeard/Makefile
diff -u pkgsrc/multimedia/sickbeard/Makefile:1.4 pkgsrc/multimedia/sickbeard/Makefile:1.5
--- pkgsrc/multimedia/sickbeard/Makefile:1.4    Tue Jul  3 05:03:26 2018
+++ pkgsrc/multimedia/sickbeard/Makefile        Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2018/07/03 05:03:26 adam Exp $
+# $NetBSD: Makefile,v 1.5 2018/07/04 13:40:26 jperkin Exp $
 
 DISTNAME=      sickbeard-507
 PKGREVISION=   3
@@ -43,7 +43,7 @@ SUBST_FILES.paths=    sickbeard.sh
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.paths+=      -e 's,@SH@,${SH},g'
 SUBST_SED.paths+=      -e 's,@VARBASE@,${VARBASE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
        ${CP} ${FILESDIR}/sickbeard.sh ${WRKSRC}/sickbeard.sh

Index: pkgsrc/multimedia/xine-lib/Makefile
diff -u pkgsrc/multimedia/xine-lib/Makefile:1.147 pkgsrc/multimedia/xine-lib/Makefile:1.148
--- pkgsrc/multimedia/xine-lib/Makefile:1.147   Mon Mar 12 11:15:41 2018
+++ pkgsrc/multimedia/xine-lib/Makefile Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.147 2018/03/12 11:15:41 wiz Exp $
+# $NetBSD: Makefile,v 1.148 2018/07/04 13:40:26 jperkin Exp $
 
 PKGREVISION= 11
 .include "Makefile.common"
@@ -16,7 +16,7 @@ CONFIGURE_ARGS+=      --disable-mlib
 BUILDLINK_API_DEPENDS.vcdimager+= vcdimager>=0.7.20nb1
 
 SUBST_CLASSES+=                oss
-SUBST_STAGE.oss=       post-patch
+SUBST_STAGE.oss=       pre-configure
 SUBST_FILES.oss=       src/audio_out/audio_oss_out.c
 SUBST_SED.oss=         -e "s,/dev/dsp,${DEVOSSAUDIO},g"
 .if ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD"
@@ -25,7 +25,7 @@ SUBST_SED.oss+=               -e "s,\"dsp\",\"audio\"
 SUBST_MESSAGE.oss=     Fixing hardcoded audio device.
 
 SUBST_CLASSES+=                w32path
-SUBST_STAGE.w32path=   post-patch
+SUBST_STAGE.w32path=   pre-configure
 SUBST_FILES.w32path=   src/libw32dll/common.c
 SUBST_SED.w32path=     -e "s,@W32PATH@,${PREFIX}/lib/win32,"
 SUBST_MESSAGE.w32path= Fixing win32 dll path.

Index: pkgsrc/net/DarwinStreamingServer/Makefile
diff -u pkgsrc/net/DarwinStreamingServer/Makefile:1.21 pkgsrc/net/DarwinStreamingServer/Makefile:1.22
--- pkgsrc/net/DarwinStreamingServer/Makefile:1.21      Mon Aug  7 07:42:34 2017
+++ pkgsrc/net/DarwinStreamingServer/Makefile   Wed Jul  4 13:40:26 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2017/08/07 07:42:34 jlam Exp $
+# $NetBSD: Makefile,v 1.22 2018/07/04 13:40:26 jperkin Exp $
 
 DISTNAME=      DarwinStreamingSrvr5.5.5-Source
 PKGNAME=       DarwinStreamingServer-5.5.5
@@ -77,7 +77,7 @@ CONF_FILES+=  share/examples/streaming/re
 CONF_FILES+=   share/examples/streaming/streamingserver.xml-POSIX ${PKG_SYSCONFDIR}/streamingserver.xml
 
 SUBST_CLASSES+=                makefile
-SUBST_STAGE.makefile=  post-patch
+SUBST_STAGE.makefile=  pre-configure
 SUBST_MESSAGE.makefile=        Fixing Makefiles
 SUBST_FILES.makefile+= APIModules/QTSSDemoAuthorizationModule.bproj/Makefile.POSIX
 SUBST_FILES.makefile+= APIModules/QTSSHomeDirectoryModule/Makefile.POSIX
@@ -104,7 +104,7 @@ SUBST_FILES.makefile+=      qtpasswd.tproj/Ma
 SUBST_SED.makefile+=   -e "s|-O[023]||"
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_MESSAGE.path=    Fixing paths
 SUBST_FILES.path+=     defaultPaths.h
 SUBST_FILES.path+=     WebAdmin/src/streamingadminserver.pl
@@ -118,7 +118,7 @@ SUBST_SED.path+=    -e "s|/var/streaming/pl
 SUBST_SED.path+=       -e "s|/var/streaming/logs|${VARBASE}/log/streaming|"
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_MESSAGE.conf=    Fixing configuration file
 SUBST_FILES.conf+=     WebAdmin/streamingadminserver.conf
 SUBST_SED.conf+=       -e "s|/Library/QuickTimeStreaming/AdminHtml|${PREFIX}/share/streaming/AdminHtml|"

Index: pkgsrc/net/ORBit/hacks.mk
diff -u pkgsrc/net/ORBit/hacks.mk:1.2 pkgsrc/net/ORBit/hacks.mk:1.3
--- pkgsrc/net/ORBit/hacks.mk:1.2       Sun May 14 21:10:01 2006
+++ pkgsrc/net/ORBit/hacks.mk   Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: hacks.mk,v 1.2 2006/05/14 21:10:01 schwarz Exp $
+# $NetBSD: hacks.mk,v 1.3 2018/07/04 13:40:27 jperkin Exp $
 
 .if !defined(ORBIT_HACKS_MK)
 ORBIT_HACKS_MK=        # defined
@@ -14,7 +14,7 @@ _SOCKLEN_T_TYPEDEFD!= ${GREP} -c '^typed
 PKG_HACKS+=            socklen_t-already-typedefd-in-pthread.h
 SUBST_CLASSES+=                socklen_t
 SUBST_FILES.socklen_t= configure
-SUBST_STAGE.socklen_t= post-patch
+SUBST_STAGE.socklen_t= pre-configure
 SUBST_SED.socklen_t=   -e 's/^\#define\ socklen_t\ size_t$$//'
 # remark: \ before # needed to prevent make from interpreting
 #         remainder of line as a comment

Index: pkgsrc/net/aget/Makefile
diff -u pkgsrc/net/aget/Makefile:1.15 pkgsrc/net/aget/Makefile:1.16
--- pkgsrc/net/aget/Makefile:1.15       Thu Feb 25 16:20:50 2016
+++ pkgsrc/net/aget/Makefile    Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2016/02/25 16:20:50 jperkin Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:27 jperkin Exp $
 #
 
 DISTNAME=      aget-0.4
@@ -14,7 +14,7 @@ NO_CONFIGURE= yes
 
 SUBST_CLASSES+=                options
 SUBST_MESSAGE.options= Fixing build options.
-SUBST_STAGE.options=   post-patch
+SUBST_STAGE.options=   pre-configure
 SUBST_FILES.options=   Makefile Makefile.Solaris
 SUBST_SED.options=     -e 's,CFLAGS =,\#CFLAGS =,'
 SUBST_SED.options+=    -e 's,LDFLAGS =,\#LDFLAGS =,'

Index: pkgsrc/net/aiccu/Makefile
diff -u pkgsrc/net/aiccu/Makefile:1.17 pkgsrc/net/aiccu/Makefile:1.18
--- pkgsrc/net/aiccu/Makefile:1.17      Tue Apr 17 22:29:44 2018
+++ pkgsrc/net/aiccu/Makefile   Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2018/04/17 22:29:44 wiz Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:27 jperkin Exp $
 
 DISTNAME=              aiccu_20070115
 PKGNAME=               ${DISTNAME:S/_/-/:S/.//g}
@@ -15,7 +15,7 @@ USE_FEATURES+=                inet6
 CHECK_PORTABILITY_SKIP+=debian/*
 
 SUBST_CLASSES+=                sysconfdir
-SUBST_STAGE.sysconfdir=        post-patch
+SUBST_STAGE.sysconfdir=        pre-configure
 SUBST_FILES.sysconfdir=        common/aiccu.h
 SUBST_SED.sysconfdir=  -e 's,/etc/aiccu.conf,${PKG_SYSCONFDIR}/aiccu.conf,'
 

Index: pkgsrc/net/apollo/Makefile
diff -u pkgsrc/net/apollo/Makefile:1.3 pkgsrc/net/apollo/Makefile:1.4
--- pkgsrc/net/apollo/Makefile:1.3      Mon Aug  7 17:56:13 2017
+++ pkgsrc/net/apollo/Makefile  Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2017/08/07 17:56:13 jlam Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:27 jperkin Exp $
 #
 
 APOLLOVERS=    1.4
@@ -30,7 +30,7 @@ SUBST_CLASSES+=               home
 SUBST_FILES.home=      ${WRKSRC}/bin/apollo
 SUBST_SED.home=                -e 's,@APOLLO_HOME@,${PREFIX},'
 SUBST_SED.home+=       -e 's,@JAVA_HOME@,${PKG_JAVA_HOME},'
-SUBST_STAGE.home=      post-patch
+SUBST_STAGE.home=      pre-configure
 
 do-install:
        ${INSTALL_SCRIPT} ${WRKSRC}/bin/apollo ${DESTDIR}${PREFIX}/bin

Index: pkgsrc/net/arpwatch/Makefile
diff -u pkgsrc/net/arpwatch/Makefile:1.35 pkgsrc/net/arpwatch/Makefile:1.36
--- pkgsrc/net/arpwatch/Makefile:1.35   Wed Feb  6 19:30:55 2013
+++ pkgsrc/net/arpwatch/Makefile        Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2013/02/06 19:30:55 jperkin Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:27 jperkin Exp $
 #
 
 DISTNAME=      arpwatch-2.1a15
@@ -21,7 +21,7 @@ PLIST_SUBST+= VARBASE=${VARBASE:Q}
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     arpsnmp.8 arpwatch.8
 SUBST_SED.paths=       -e 's,/usr/operator/arpwatch,${VARBASE}/db/arpwatch,g'
 

Index: pkgsrc/net/chrony/Makefile
diff -u pkgsrc/net/chrony/Makefile:1.34 pkgsrc/net/chrony/Makefile:1.35
--- pkgsrc/net/chrony/Makefile:1.34     Tue Jan  3 18:00:19 2017
+++ pkgsrc/net/chrony/Makefile  Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2017/01/03 18:00:19 roy Exp $
+# $NetBSD: Makefile,v 1.35 2018/07/04 13:40:27 jperkin Exp $
 
 DISTNAME=      chrony-1.31.1
 PKGREVISION=   4
@@ -29,7 +29,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     ${EGFILES:S/^/examples\//} conf.c
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
 SUBST_SED.paths+=      -e 's,@VARBASE@,${VARBASE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-install:
        set -e; for file in ${EGFILES}; do                      \

Index: pkgsrc/net/coilmq/Makefile
diff -u pkgsrc/net/coilmq/Makefile:1.12 pkgsrc/net/coilmq/Makefile:1.13
--- pkgsrc/net/coilmq/Makefile:1.12     Tue Jul  3 05:03:27 2018
+++ pkgsrc/net/coilmq/Makefile  Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2018/07/03 05:03:27 adam Exp $
+# $NetBSD: Makefile,v 1.13 2018/07/04 13:40:27 jperkin Exp $
 
 DISTNAME=      CoilMQ-0.6.1
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
@@ -22,7 +22,7 @@ REPLACE_PYTHON+=      distribute_setup.py coi
 PKG_SYSCONFSUBDIR=     coilmq
 
 SUBST_CLASSES+=                cfg
-SUBST_STAGE.cfg=       post-patch
+SUBST_STAGE.cfg=       pre-configure
 SUBST_FILES.cfg=       coilmq/config/__init__.py
 SUBST_SED.cfg=         -e 's,/path/to/config.cfg,${PKG_SYSCONFDIR}/defaults.cfg,'
 

Index: pkgsrc/net/dctc/Makefile
diff -u pkgsrc/net/dctc/Makefile:1.56 pkgsrc/net/dctc/Makefile:1.57
--- pkgsrc/net/dctc/Makefile:1.56       Tue Aug  1 17:40:14 2017
+++ pkgsrc/net/dctc/Makefile    Wed Jul  4 13:40:27 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.56 2017/08/01 17:40:14 wiz Exp $
+# $NetBSD: Makefile,v 1.57 2018/07/04 13:40:27 jperkin Exp $
 
 DISTNAME=      dctc-0.85.9
 PKGREVISION=   13
@@ -23,7 +23,7 @@ CPPFLAGS+=            -I${BDBBASE}/include/${BDB_T
 BUILDLINK_TRANSFORM+=  l:db4:${BDB_TYPE}
 
 SUBST_CLASSES+=                inethack
-SUBST_STAGE.inethack=  post-patch
+SUBST_STAGE.inethack=  pre-configure
 SUBST_FILES.inethack=  src/dc_manage.c src/dc_manage_master.c
 SUBST_FILES.inethack+= src/main.c src/main_master.c src/var.h
 SUBST_SED.inethack+=   -e 's,\(G_.*LOCK.*(\)inet_ntoa,\1my_inet_ntoa,g'

Index: pkgsrc/net/ddclient/Makefile
diff -u pkgsrc/net/ddclient/Makefile:1.40 pkgsrc/net/ddclient/Makefile:1.41
--- pkgsrc/net/ddclient/Makefile:1.40   Sat Jul  9 06:38:41 2016
+++ pkgsrc/net/ddclient/Makefile        Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.40 2016/07/09 06:38:41 wiz Exp $
+# $NetBSD: Makefile,v 1.41 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=      ddclient-3.8.3
 PKGREVISION=   1
@@ -33,7 +33,7 @@ INSTALLATION_DIRS=    sbin share/doc/ddclie
 SUBST_CLASSES+=                config
 SUBST_MESSAGE.config=  Adjust variables: PKG_SYSCONFDIR VARBASE PERL5 (in patch-aa)
 SUBST_FILES.config+=   ddclient
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_VARS.config=     PKG_SYSCONFDIR VARBASE PERL5
 
 NO_CONFIGURE=          yes

Index: pkgsrc/net/dgd/Makefile
diff -u pkgsrc/net/dgd/Makefile:1.19 pkgsrc/net/dgd/Makefile:1.20
--- pkgsrc/net/dgd/Makefile:1.19        Thu Oct  9 14:06:44 2014
+++ pkgsrc/net/dgd/Makefile     Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2014/10/09 14:06:44 wiz Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=      dgd-1.2p4
 PKGNAME=       dgd-1.2.0.4
@@ -18,7 +18,7 @@ BUILD_DIRS=           src
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths and command names.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     mud.dgd
 SUBST_SED.paths=       -e 's,/home/dworkin/,${PREFIX}/libdata/,g'
 

Index: pkgsrc/net/ez-ipupdate/Makefile
diff -u pkgsrc/net/ez-ipupdate/Makefile:1.8 pkgsrc/net/ez-ipupdate/Makefile:1.9
--- pkgsrc/net/ez-ipupdate/Makefile:1.8 Tue Aug  1 16:47:42 2017
+++ pkgsrc/net/ez-ipupdate/Makefile     Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2017/08/01 16:47:42 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=              ez-ipupdate-3.0.11b7
 PKGREVISION=           1
@@ -15,7 +15,7 @@ EGDIR=                        ${PREFIX}/share/examples/ez-ipu
 RCD_SCRIPTS=           ez-ipupdate
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_MESSAGE.path=    Correcting paths in example scripts.
 SUBST_FILES.path=      example-*.conf example.conf
 SUBST_SED.path=                -e "s|/usr/local|${PREFIX}|g"

Index: pkgsrc/net/freeradius2/Makefile
diff -u pkgsrc/net/freeradius2/Makefile:1.46 pkgsrc/net/freeradius2/Makefile:1.47
--- pkgsrc/net/freeradius2/Makefile:1.46        Sun Jan 28 20:10:58 2018
+++ pkgsrc/net/freeradius2/Makefile     Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.46 2018/01/28 20:10:58 wiz Exp $
+# $NetBSD: Makefile,v 1.47 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=      freeradius-server-${RADVER}
 PKGNAME=       ${DISTNAME:S/-server//}
@@ -70,14 +70,14 @@ REPLACE_PERL=               src/modules/rlm_counter/r
 REPLACE_PERL+=         scripts/radsqlrelay
 
 SUBST_CLASSES+=                make
-SUBST_STAGE.make=      post-patch
+SUBST_STAGE.make=      pre-configure
 SUBST_FILES.make=      src/modules/rlm_sql/drivers/rlm_sql_postgresql/Makefile.in
 SUBST_SED.make+=       -e "s|RLM_SQL_LIBS      =|RLM_SQL_LIBS  = \
                        -L${PREFIX}/lib|g"
 SUBST_MESSAGE.make=    Fixing Makefiles.
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    raddb/radiusd.conf.in
 SUBST_SED.config=      -e "s|@@RADIUS_USER@@|${RADIUS_USER}|g"
 SUBST_SED.config+=     -e "s|@@RADIUS_GROUP@@|${RADIUS_GROUP}|g"

Index: pkgsrc/net/hf6to4/Makefile
diff -u pkgsrc/net/hf6to4/Makefile:1.16 pkgsrc/net/hf6to4/Makefile:1.17
--- pkgsrc/net/hf6to4/Makefile:1.16     Tue Oct 23 17:18:27 2012
+++ pkgsrc/net/hf6to4/Makefile  Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2012/10/23 17:18:27 asau Exp $
+# $NetBSD: Makefile,v 1.17 2018/07/04 13:40:28 jperkin Exp $
 #
 
 DISTNAME=              hf6to4-1.3
@@ -31,7 +31,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     hf6to4
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
 SUBST_SED.paths+=      -e 's,@SH@,${SH},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
        ${CP} ${FILESDIR}/hf6to4 ${WRKSRC}/hf6to4

Index: pkgsrc/net/irrd/Makefile
diff -u pkgsrc/net/irrd/Makefile:1.52 pkgsrc/net/irrd/Makefile:1.53
--- pkgsrc/net/irrd/Makefile:1.52       Sat Jul  9 06:38:42 2016
+++ pkgsrc/net/irrd/Makefile    Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.52 2016/07/09 06:38:42 wiz Exp $
+# $NetBSD: Makefile,v 1.53 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=              irrd2.3.9
 PKGNAME=               irrd-2.3.9
@@ -65,7 +65,7 @@ SUBST_CLASSES+=               confpaths
 SUBST_FILES.confpaths= ../samples/irrd.conf.sample
 SUBST_SED.confpaths=   -e 's,/var/spool/irr_database,'${VARBASE}'/irrd/db,'
 SUBST_SED.confpaths+=  -e 's,/var/log/irrd,'${VARBASE}'/irrd/log/irrd.log,'
-SUBST_STAGE.confpaths= post-patch
+SUBST_STAGE.confpaths= pre-configure
 
 post-install:
        ${INSTALL_DATA} ${WRKSRC}/../samples/irrd.conf.sample ${DESTDIR}${EGDIR}/irrd.conf

Index: pkgsrc/net/jftpgw/Makefile
diff -u pkgsrc/net/jftpgw/Makefile:1.13 pkgsrc/net/jftpgw/Makefile:1.14
--- pkgsrc/net/jftpgw/Makefile:1.13     Tue Oct 23 17:18:30 2012
+++ pkgsrc/net/jftpgw/Makefile  Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2012/10/23 17:18:30 asau Exp $
+# $NetBSD: Makefile,v 1.14 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=          jftpgw-0.13.5
 #PKGREVISION=      1
@@ -20,7 +20,7 @@ EGDIR=                        ${PREFIX}/share/examples/jftpgw
 CONF_FILES=            ${EGDIR}/jftpgw.conf ${PKG_SYSCONFDIR}/jftpgw.conf
 
 SUBST_CLASSES+=                log
-SUBST_STAGE.log=       post-patch
+SUBST_STAGE.log=       pre-configure
 SUBST_FILES.log=       active.c bindport.c cache.c cmds.c config.c \
                        ftpread.c fw_auth_cmds.c jftpgw.c log.c log.h \
                        login.c openport.c passive.c states.c std_cmds.c \

Index: pkgsrc/net/knot/Makefile
diff -u pkgsrc/net/knot/Makefile:1.39 pkgsrc/net/knot/Makefile:1.40
--- pkgsrc/net/knot/Makefile:1.39       Tue Apr 17 22:29:45 2018
+++ pkgsrc/net/knot/Makefile    Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2018/04/17 22:29:45 wiz Exp $
+# $NetBSD: Makefile,v 1.40 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=      knot-2.5.7
 PKGREVISION=   1
@@ -50,7 +50,7 @@ PKG_SYSCONFSUBDIR=    knot
 
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKSRC}/samples/Makefile.in
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_SED.paths=       -e 's,@EGDIR@,${EGDIR},'
 
 CONF_FILES=    ${EGDIR}/knot.sample.conf \

Index: pkgsrc/net/libnipper/Makefile
diff -u pkgsrc/net/libnipper/Makefile:1.5 pkgsrc/net/libnipper/Makefile:1.6
--- pkgsrc/net/libnipper/Makefile:1.5   Wed Aug 16 20:45:43 2017
+++ pkgsrc/net/libnipper/Makefile       Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2017/08/16 20:45:43 wiz Exp $
+# $NetBSD: Makefile,v 1.6 2018/07/04 13:40:28 jperkin Exp $
 #
 
 DISTNAME=      libnipper-0.12.1
@@ -17,7 +17,7 @@ CONF_FILES+=  ${PREFIX}/share/examples/ni
                ${PKG_SYSCONFDIR}/nipper.conf
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    CMakeLists.txt libnipper.cpp nipper.cpp
 SUBST_SED.config=      -e "s|@@PREFIX@@|${PREFIX}|g"
 SUBST_SED.config+=     -e "s|@@PKGMANDIR@@|${PKGMANDIR}|g"

Index: pkgsrc/net/libquic/Makefile
diff -u pkgsrc/net/libquic/Makefile:1.5 pkgsrc/net/libquic/Makefile:1.6
--- pkgsrc/net/libquic/Makefile:1.5     Tue Jun 12 17:50:25 2018
+++ pkgsrc/net/libquic/Makefile Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2018/06/12 17:50:25 bsiegert Exp $
+# $NetBSD: Makefile,v 1.6 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=      libquic-0.0.3
 PKGREVISION=   2
@@ -13,7 +13,7 @@ LICENSE=      modified-bsd
 BUILD_DEPENDS+=                go-[0-9]*:../../lang/go
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.link=      post-patch
+SUBST_STAGE.link=      pre-configure
 SUBST_MESSAGE.link=    Fix paths
 SUBST_FILES.link=      src/base/base_paths_posix.cc
 SUBST_SED.link=                -e 's|@PREFIX@|'${PREFIX}'|'

Index: pkgsrc/net/mono-nat/Makefile
diff -u pkgsrc/net/mono-nat/Makefile:1.23 pkgsrc/net/mono-nat/Makefile:1.24
--- pkgsrc/net/mono-nat/Makefile:1.23   Sat Apr 14 07:34:00 2018
+++ pkgsrc/net/mono-nat/Makefile        Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2018/04/14 07:34:00 adam Exp $
+# $NetBSD: Makefile,v 1.24 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=      mono-nat-1.0.2
 PKGREVISION=   19
@@ -14,7 +14,7 @@ MAKE_JOBS_SAFE=       no
 USE_TOOLS+=    gmake pkg-config
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure Mono.Nat/Makefile.in
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/net/monotorrent/Makefile
diff -u pkgsrc/net/monotorrent/Makefile:1.25 pkgsrc/net/monotorrent/Makefile:1.26
--- pkgsrc/net/monotorrent/Makefile:1.25        Sat Apr 14 07:34:00 2018
+++ pkgsrc/net/monotorrent/Makefile     Wed Jul  4 13:40:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2018/04/14 07:34:00 adam Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:28 jperkin Exp $
 
 DISTNAME=      monotorrent-0.72
 PKGREVISION=   19
@@ -15,7 +15,7 @@ USE_TOOLS+=   gmake bsdtar pkg-config
 EXTRACT_USING= bsdtar
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure MonoTorrent/Makefile.in
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/net/monsoon/Makefile
diff -u pkgsrc/net/monsoon/Makefile:1.68 pkgsrc/net/monsoon/Makefile:1.69
--- pkgsrc/net/monsoon/Makefile:1.68    Mon Apr 16 14:35:02 2018
+++ pkgsrc/net/monsoon/Makefile Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.68 2018/04/16 14:35:02 wiz Exp $
+# $NetBSD: Makefile,v 1.69 2018/07/04 13:40:29 jperkin Exp $
 
 DISTNAME=      monsoon-0.20
 PKGREVISION=   62
@@ -15,7 +15,7 @@ USE_TOOLS+=   gmake gtar intltool perl pkg
 EXTRACT_USING= gtar
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure Monsoon/Makefile.in
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/net/mrtg/Makefile
diff -u pkgsrc/net/mrtg/Makefile:1.124 pkgsrc/net/mrtg/Makefile:1.125
--- pkgsrc/net/mrtg/Makefile:1.124      Mon Mar 12 11:17:21 2018
+++ pkgsrc/net/mrtg/Makefile    Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.124 2018/03/12 11:17:21 wiz Exp $
+# $NetBSD: Makefile,v 1.125 2018/07/04 13:40:29 jperkin Exp $
 
 DISTNAME=      mrtg-2.17.4
 PKGREVISION=   11
@@ -27,7 +27,7 @@ CONF_FILES=   ${EGDIR}/mrtg.conf ${PKG_SYS
 .include "options.mk"
 
 SUBST_CLASSES+=                files
-SUBST_STAGE.files=     post-patch
+SUBST_STAGE.files=     pre-configure
 SUBST_FILES.files=     ../mrtg.conf.example ../netstat2mrtg    \
                        ../sys2mrtg ../envstat2mrtg
 SUBST_SED.files=       -e "s|@PREFIX@|${PREFIX}|g"

Index: pkgsrc/net/nagios-plugin-radius/Makefile
diff -u pkgsrc/net/nagios-plugin-radius/Makefile:1.17 pkgsrc/net/nagios-plugin-radius/Makefile:1.18
--- pkgsrc/net/nagios-plugin-radius/Makefile:1.17       Tue Jul  4 19:48:19 2017
+++ pkgsrc/net/nagios-plugin-radius/Makefile    Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2017/07/04 19:48:19 jperkin Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:29 jperkin Exp $
 #
 
 PKGNAME=       nagios-plugin-radius-${PLUGINSVERSION}
@@ -21,7 +21,7 @@ BUILD_DEFS+=  PKG_SYSCONFBASE
 BINARY_TARGET= check_radius
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    plugins/check_radius.c
 SUBST_SED.config=      -e "s|@SYSCONFDIR@|${PKG_SYSCONFBASE}|g"
 SUBST_MESSAGE.config=  Fixing configuration file path.

Index: pkgsrc/net/ndiff/Makefile
diff -u pkgsrc/net/ndiff/Makefile:1.1 pkgsrc/net/ndiff/Makefile:1.2
--- pkgsrc/net/ndiff/Makefile:1.1       Sat Apr 14 13:04:33 2018
+++ pkgsrc/net/ndiff/Makefile   Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2018/04/14 13:04:33 adam Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:29 jperkin Exp $
 
 .include "../../net/nmap/Makefile.common"
 
@@ -13,7 +13,7 @@ EXTRACT_ELEMENTS=     ${DISTNAME}/ndiff
 PYTHON_VERSIONS_ACCEPTED=      27
 
 SUBST_CLASSES+=                setup
-SUBST_STAGE.setup=     post-patch
+SUBST_STAGE.setup=     pre-configure
 SUBST_MESSAGE.setup=   Fixing setup.
 SUBST_FILES.setup=     setup.py
 SUBST_SED.setup=       -e 's,share/man,${PKGMANDIR},g'

Index: pkgsrc/net/nipper/Makefile
diff -u pkgsrc/net/nipper/Makefile:1.6 pkgsrc/net/nipper/Makefile:1.7
--- pkgsrc/net/nipper/Makefile:1.6      Wed Aug 16 20:45:43 2017
+++ pkgsrc/net/nipper/Makefile  Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2017/08/16 20:45:43 wiz Exp $
+# $NetBSD: Makefile,v 1.7 2018/07/04 13:40:29 jperkin Exp $
 #
 
 DISTNAME=      nipper-cli-0.12.0
@@ -15,7 +15,7 @@ USE_LANGUAGES=        c++ c
 USE_CMAKE=     yes
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    CMakeLists.txt nipper.cpp
 SUBST_SED.config=      -e "s|@@PREFIX@@|${PREFIX}|g"
 SUBST_SED.config+=     -e "s|@@PKGMANDIR@@|${PKGMANDIR}|g"

Index: pkgsrc/net/ocsinventory-agent/Makefile
diff -u pkgsrc/net/ocsinventory-agent/Makefile:1.16 pkgsrc/net/ocsinventory-agent/Makefile:1.17
--- pkgsrc/net/ocsinventory-agent/Makefile:1.16 Wed Jun 28 08:27:44 2017
+++ pkgsrc/net/ocsinventory-agent/Makefile      Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2017/06/28 08:27:44 jperkin Exp $
+# $NetBSD: Makefile,v 1.17 2018/07/04 13:40:29 jperkin Exp $
 #
 VERS=                  1.1.2.1
 PKGREVISION=           9
@@ -41,13 +41,13 @@ REPLACE_PERL+=      ocsinventory-agent
 REPLACE_PERL+= postinst.pl
 
 SUBST_CLASSES+=                        sysconfdir path varbase apachevers
-SUBST_STAGE.sysconfdir=                post-patch
+SUBST_STAGE.sysconfdir=                pre-configure
 SUBST_FILES.sysconfdir=                lib/Ocsinventory/Agent/Config.pm
 SUBST_FILES.sysconfdir+=       postinst.pl
 SUBST_SED.sysconfdir=          -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
 SUBST_MESSAGE.sysconfdir=      Fixing hardcoded install directory path.
 
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      lib/Ocsinventory/Agent/Common.pm
 SUBST_SED.path=                -e "s|/usr/local/bin|${PREFIX}/bin|g"
 SUBST_SED.path+=       -e "s|/usr/local/sbin|${PREFIX}/sbin|g"

Index: pkgsrc/net/oinkmaster/Makefile
diff -u pkgsrc/net/oinkmaster/Makefile:1.25 pkgsrc/net/oinkmaster/Makefile:1.26
--- pkgsrc/net/oinkmaster/Makefile:1.25 Sat Jul  9 06:38:44 2016
+++ pkgsrc/net/oinkmaster/Makefile      Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2016/07/09 06:38:44 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:29 jperkin Exp $
 
 DISTNAME=      oinkmaster-2.0
 PKGREVISION=   5
@@ -28,7 +28,7 @@ REPLACE_PERL+=        ${WRKSRC}/oinkmaster.pl
 PKG_SYSCONFSUBDIR=     snort
 
 SUBST_CLASSES+=                pub
-SUBST_STAGE.pub=       post-patch
+SUBST_STAGE.pub=       pre-configure
 SUBST_FILES.pub=       oinkmaster.pl oinkmaster.conf oinkmaster.1
 SUBST_SED.pub=         -e "s|/usr/local/etc|${PKG_SYSCONFDIR}|g"
 SUBST_SED.pub+=                -e "s|/usr/local|${PREFIX}|g"

Index: pkgsrc/net/p5-RPC-XML/Makefile
diff -u pkgsrc/net/p5-RPC-XML/Makefile:1.24 pkgsrc/net/p5-RPC-XML/Makefile:1.25
--- pkgsrc/net/p5-RPC-XML/Makefile:1.24 Mon Jun  5 14:24:24 2017
+++ pkgsrc/net/p5-RPC-XML/Makefile      Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2017/06/05 14:24:24 ryoon Exp $
+# $NetBSD: Makefile,v 1.25 2018/07/04 13:40:29 jperkin Exp $
 
 DISTNAME=      RPC-XML-0.80
 PKGNAME=       p5-${DISTNAME}
@@ -29,7 +29,7 @@ USE_TOOLS+=           gmake
 USE_LANGUAGES=         # empty
 
 SUBST_CLASSES+=                usebase
-SUBST_STAGE.usebase=   post-patch
+SUBST_STAGE.usebase=   pre-configure
 SUBST_FILES.usebase=   lib/RPC/XML.pm
 SUBST_SED.usebase=     -e "s|^use base 'RPC::XML::|use parent -norequire, 'RPC::XML::|g"
 

Index: pkgsrc/net/pconsole/Makefile
diff -u pkgsrc/net/pconsole/Makefile:1.11 pkgsrc/net/pconsole/Makefile:1.12
--- pkgsrc/net/pconsole/Makefile:1.11   Mon Jul  3 11:55:30 2017
+++ pkgsrc/net/pconsole/Makefile        Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2017/07/03 11:55:30 wiedi Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:29 jperkin Exp $
 #
 
 DISTNAME=      pconsole-1.0
@@ -18,7 +18,7 @@ USE_TOOLS+=   ksh:run
 REPLACE_KSH=   pconsole.sh.in
 
 SUBST_CLASSES=         path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      pconsole.sh.in
 SUBST_VARS.path=       PREFIX X11BASE
 

Index: pkgsrc/net/poptop/Makefile
diff -u pkgsrc/net/poptop/Makefile:1.21 pkgsrc/net/poptop/Makefile:1.22
--- pkgsrc/net/poptop/Makefile:1.21     Tue Oct 23 17:18:59 2012
+++ pkgsrc/net/poptop/Makefile  Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2012/10/23 17:18:59 asau Exp $
+# $NetBSD: Makefile,v 1.22 2018/07/04 13:40:29 jperkin Exp $
 
 DISTNAME=      pptpd-1.3.4
 PKGNAME=       ${DISTNAME:S/pptpd/poptop/}
@@ -16,12 +16,12 @@ GNU_CONFIGURE=              yes
 CONFIGURE_ARGS+=       --with-libwrap
 
 SUBST_CLASSES+=                sysconf
-SUBST_STAGE.sysconf=   post-patch
+SUBST_STAGE.sysconf=   pre-configure
 SUBST_FILES.sysconf=   defaults.h pptpd.8 pptpd.conf.5
 SUBST_SED.sysconf=     -e s,@@PKGSYSCONFDIR@@,${PKG_SYSCONFDIR},
 
 SUBST_CLASSES+=                logwtmp
-SUBST_STAGE.logwtmp=   post-patch
+SUBST_STAGE.logwtmp=   pre-configure
 SUBST_FILES.logwtmp=   pptpctrl.c
 SUBST_SED.logwtmp=     -e s,@@PREFIX@@,${PREFIX},
 

Index: pkgsrc/net/pptp/Makefile
diff -u pkgsrc/net/pptp/Makefile:1.17 pkgsrc/net/pptp/Makefile:1.18
--- pkgsrc/net/pptp/Makefile:1.17       Tue Oct 23 17:19:00 2012
+++ pkgsrc/net/pptp/Makefile    Wed Jul  4 13:40:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2012/10/23 17:19:00 asau Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:29 jperkin Exp $
 
 DISTNAME=      pptp-1.7.1
 PKGREVISION=   1
@@ -39,7 +39,7 @@ MAKE_FLAGS+=  PPPD=/usr/sbin/pppd
 
 SUBST_CLASSES+=                pptp
 SUBST_MESSAGE.pptp=    "Fixing hardcoded paths."
-SUBST_STAGE.pptp=      post-patch
+SUBST_STAGE.pptp=      pre-configure
 SUBST_FILES.pptp=      pptp.8
 SUBST_SED.pptp=                -e 's,/usr,${PREFIX},g'
 

Index: pkgsrc/net/proxytunnel/Makefile
diff -u pkgsrc/net/proxytunnel/Makefile:1.7 pkgsrc/net/proxytunnel/Makefile:1.8
--- pkgsrc/net/proxytunnel/Makefile:1.7 Sat Mar  5 11:29:11 2016
+++ pkgsrc/net/proxytunnel/Makefile     Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2016/03/05 11:29:11 jperkin Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:30 jperkin Exp $
 #
 
 DISTNAME=      proxytunnel-1.9.0
@@ -18,7 +18,7 @@ BUILD_TARGET= proxytunnel
 INSTALLATION_DIRS+=    ${PKGMANDIR}/man1 bin
 
 SUBST_CLASSES+=                        fix-paths
-SUBST_STAGE.fix-paths=         post-patch
+SUBST_STAGE.fix-paths=         pre-configure
 SUBST_MESSAGE.fix-paths=       Fixing absolute paths.
 SUBST_FILES.fix-paths=         proxytunnel.1
 SUBST_SED.fix-paths=           -e 's,/usr,${PREFIX},g'

Index: pkgsrc/net/publicfile-run/Makefile
diff -u pkgsrc/net/publicfile-run/Makefile:1.2 pkgsrc/net/publicfile-run/Makefile:1.3
--- pkgsrc/net/publicfile-run/Makefile:1.2      Wed Nov 25 12:52:12 2015
+++ pkgsrc/net/publicfile-run/Makefile  Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2015/11/25 12:52:12 jperkin Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=              publicfile-run-20150109
 CATEGORIES=            net
@@ -30,7 +30,7 @@ FILES_SUBST+=         PKGNAME=${PKGNAME:Q}
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Substituting paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     libexec-pubftpd
 SUBST_VARS.paths=      PREFIX
 

Index: pkgsrc/net/py-pcap/Makefile
diff -u pkgsrc/net/py-pcap/Makefile:1.11 pkgsrc/net/py-pcap/Makefile:1.12
--- pkgsrc/net/py-pcap/Makefile:1.11    Tue Jul  3 05:03:29 2018
+++ pkgsrc/net/py-pcap/Makefile Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2018/07/03 05:03:29 adam Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      pypcap-1.1
 PKGNAME=       ${PYPKGPREFIX}-pcap-1.1
@@ -16,12 +16,12 @@ BUILD_DEPENDS+=             ${PYPKGPREFIX}-pyrex-[0
 SUBST_CLASSES+=                python
 SUBST_FILES.python=    Makefile
 SUBST_SED.python+=     -e 's,@PYTHON@,${PYTHONBIN},g'
-SUBST_STAGE.python=    post-patch
+SUBST_STAGE.python=    pre-configure
 
 SUBST_CLASSES+=                prefix
 SUBST_FILES.prefix=    Makefile
 SUBST_SED.prefix=      -e "s|@PREFIX@|${PREFIX}|g"
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 
 PYDISTUTILSPKG=                        yes
 PYTHON_VERSIONS_INCOMPATIBLE=  34 35 36 37 # py-pyrex

Index: pkgsrc/net/pygopherd/Makefile
diff -u pkgsrc/net/pygopherd/Makefile:1.31 pkgsrc/net/pygopherd/Makefile:1.32
--- pkgsrc/net/pygopherd/Makefile:1.31  Tue Jul  3 05:03:29 2018
+++ pkgsrc/net/pygopherd/Makefile       Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2018/07/03 05:03:29 adam Exp $
+# $NetBSD: Makefile,v 1.32 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      pygopherd_2.0.16
 PKGREVISION=   4
@@ -42,7 +42,7 @@ REPLACE_PYTHON+=      pygopherd/initializatio
 REPLACE_PYTHON+=       pygopherd/testutil.py
 
 SUBST_CLASSES+=                man
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_FILES.man=       setup.py
 SUBST_FILES.man+=      bin/pygopherd
 SUBST_FILES.man+=      conf/pygopherd.conf

Index: pkgsrc/net/rinetd/Makefile
diff -u pkgsrc/net/rinetd/Makefile:1.17 pkgsrc/net/rinetd/Makefile:1.18
--- pkgsrc/net/rinetd/Makefile:1.17     Sun May 21 06:49:09 2017
+++ pkgsrc/net/rinetd/Makefile  Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2017/05/21 06:49:09 jlam Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:30 jperkin Exp $
 #
 
 DISTNAME=              rinetd
@@ -24,7 +24,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     rinetd.8
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 LDFLAGS.SunOS+=                -lsocket -lnsl
 

Index: pkgsrc/net/rsync/Makefile
diff -u pkgsrc/net/rsync/Makefile:1.108 pkgsrc/net/rsync/Makefile:1.109
--- pkgsrc/net/rsync/Makefile:1.108     Mon Jan 29 11:32:59 2018
+++ pkgsrc/net/rsync/Makefile   Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.108 2018/01/29 11:32:59 adam Exp $
+# $NetBSD: Makefile,v 1.109 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      rsync-3.1.3
 CATEGORIES=    net
@@ -28,7 +28,7 @@ SMF_NAME=             rsyncd
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     rsync.1 rsyncd.conf.5
 SUBST_SED.paths=       -e 's|/etc/rsyncd|${PKG_SYSCONFDIR}/rsyncd|g'
 SUBST_SED.paths+=      -e 's|/usr/bin/rsync|${PREFIX}/bin/rsync|g'

Index: pkgsrc/net/ruby-stompserver/Makefile
diff -u pkgsrc/net/ruby-stompserver/Makefile:1.8 pkgsrc/net/ruby-stompserver/Makefile:1.9
--- pkgsrc/net/ruby-stompserver/Makefile:1.8    Thu Oct  8 14:05:55 2015
+++ pkgsrc/net/ruby-stompserver/Makefile        Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2015/10/08 14:05:55 taca Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      drizztbsd-stompserver-1c7a275
 PKGNAME=       ${RUBY_PKGPREFIX}-stompserver-1.0.0
@@ -75,7 +75,7 @@ OWN_DIRS_PERMS+=      ${ST_ROOT}/${STOMPSERVE
                        ${STOMPSERVER_USER} ${STOMPSERVER_GROUP} 0700
 
 SUBST_CLASSES+=                cfg
-SUBST_STAGE.cfg=       post-patch
+SUBST_STAGE.cfg=       pre-configure
 SUBST_FILES.cfg=       config/stompserver.conf
 SUBST_SED.cfg=         -e 's,@STOMPSERVER_WRKDIR@,${STOMPSERVER_WRKDIR},g'
 SUBST_SED.cfg+=                -e 's,@STOMPSERVER_LOGDIR@,${STOMPSERVER_LOGDIR},g'

Index: pkgsrc/net/samba/Makefile
diff -u pkgsrc/net/samba/Makefile:1.268 pkgsrc/net/samba/Makefile:1.269
--- pkgsrc/net/samba/Makefile:1.268     Tue Apr 17 22:29:46 2018
+++ pkgsrc/net/samba/Makefile   Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.268 2018/04/17 22:29:46 wiz Exp $
+# $NetBSD: Makefile,v 1.269 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      samba-${VERSION}
 CATEGORIES=    net
@@ -104,7 +104,7 @@ RCD_SCRIPTS+=       samba nmbd smbd ${WINBINDD
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing paths.
 SUBST_FILES.paths=     ${WRKDIR}/adduser.sh ${WRKDIR}/deluser.sh
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_VARS.paths+=     AWK CAT MKTEMP RM PWD_MKDB SH
 
 SUBST_CLASSES+=                def-cfg

Index: pkgsrc/net/samba4/Makefile
diff -u pkgsrc/net/samba4/Makefile:1.44 pkgsrc/net/samba4/Makefile:1.45
--- pkgsrc/net/samba4/Makefile:1.44     Tue Jul  3 05:03:29 2018
+++ pkgsrc/net/samba4/Makefile  Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.44 2018/07/03 05:03:29 adam Exp $
+# $NetBSD: Makefile,v 1.45 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      samba-${VERSION}
 PKGREVISION=   7
@@ -149,7 +149,7 @@ SUBST_CLASSES+=             paths
 SUBST_MESSAGE.paths=   Fixing paths.
 SUBST_FILES.paths=     ${WRKDIR}/adduser.sh ${WRKDIR}/deluser.sh
 SUBST_FILES.paths+=    source3/script/findsmb.in source4/heimdal_build/roken.h
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_SED.paths+=      -e 's,@PERL@,${PERL5},g'
 SUBST_VARS.paths=      AWK CAT MKTEMP RM PWD_MKDB SH PERL PKG_SYSCONFBASE
 

Index: pkgsrc/net/scapy/Makefile
diff -u pkgsrc/net/scapy/Makefile:1.23 pkgsrc/net/scapy/Makefile:1.24
--- pkgsrc/net/scapy/Makefile:1.23      Tue Jul  3 05:03:29 2018
+++ pkgsrc/net/scapy/Makefile   Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2018/07/03 05:03:29 adam Exp $
+# $NetBSD: Makefile,v 1.24 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      scapy-2.3.2
 CATEGORIES=    net
@@ -26,7 +26,7 @@ CONF_FILES=   ${PREFIX}/share/examples/sca
                ${PKG_SYSCONFDIR}/ethertypes
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    scapy/data.py setup.py
 SUBST_SED.config=      -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
 SUBST_SED.config+=     -e "s|share/man|${PKGMANDIR}|g"

Index: pkgsrc/net/sipsak/Makefile
diff -u pkgsrc/net/sipsak/Makefile:1.15 pkgsrc/net/sipsak/Makefile:1.16
--- pkgsrc/net/sipsak/Makefile:1.15     Sat Apr 29 10:21:54 2017
+++ pkgsrc/net/sipsak/Makefile  Wed Jul  4 13:40:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2017/04/29 10:21:54 schwarz Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:30 jperkin Exp $
 
 DISTNAME=      sipsak-0.9.6-1
 PKGNAME=       ${DISTNAME:S/-1//}
@@ -18,7 +18,7 @@ USE_TOOLS+=   gmake
 
 # get rid of inline
 SUBST_CLASSES+=        inline
-SUBST_STAGE.inline=    post-patch
+SUBST_STAGE.inline=    pre-configure
 SUBST_FILES.inline=    header_f.h header_f.c
 SUBST_SED.inline=      -e 's/^inline //g'
 

Index: pkgsrc/net/smokeping/Makefile
diff -u pkgsrc/net/smokeping/Makefile:1.38 pkgsrc/net/smokeping/Makefile:1.39
--- pkgsrc/net/smokeping/Makefile:1.38  Mon Sep  4 18:08:26 2017
+++ pkgsrc/net/smokeping/Makefile       Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2017/09/04 18:08:26 wiz Exp $
+# $NetBSD: Makefile,v 1.39 2018/07/04 13:40:31 jperkin Exp $
 
 DISTNAME=      smokeping-2.6.7
 PKGREVISION=   6
@@ -48,7 +48,7 @@ REPLACE_PERL+=                bin/smokeinfo bin/tSmoke
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES+=                files
-SUBST_STAGE.files=     post-patch
+SUBST_STAGE.files=     pre-configure
 SUBST_FILES.files=     etc/config.dist.in bin/smokeping \
                        bin/smokeping_cgi bin/tSmoke \
                        htdocs/Makefile.in smokeping.conf
@@ -60,7 +60,7 @@ SUBST_SED.files+=     -e "s|@SPDIR@|${SPDIR}
 SUBST_MESSAGE.files=   Fixing configuration files.
 
 SUBST_CLASSES+=                libs
-SUBST_STAGE.libs=      post-patch
+SUBST_STAGE.libs=      pre-configure
 SUBST_FILES.libs=      bin/smokeping_cgi bin/smokeping bin/smokeinfo bin/tSmoke
 SUBST_SED.libs=        -e "s|FindBin::Bin/../lib|FindBin::Bin/../lib/smokeping|g"
 SUBST_MESSAGE.libs=    Fixing library path

Index: pkgsrc/net/snort/Makefile
diff -u pkgsrc/net/snort/Makefile:1.58 pkgsrc/net/snort/Makefile:1.59
--- pkgsrc/net/snort/Makefile:1.58      Tue Apr 17 22:29:46 2018
+++ pkgsrc/net/snort/Makefile   Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.58 2018/04/17 22:29:46 wiz Exp $
+# $NetBSD: Makefile,v 1.59 2018/07/04 13:40:31 jperkin Exp $
 #
 
 DISTNAME=              snort-2.9.9.0
@@ -65,7 +65,7 @@ CONF_FILES+=          ${EGDIR}/rules/white_list.
                        ${PKG_SYSCONFDIR}/rules/white_list.rules
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     etc/snort.conf src/snort.c
 SUBST_SED.paths=       -e "s|/usr/local|${PREFIX}|g"
 SUBST_SED.paths+=      -e "s|../rules|rules|g"

Index: pkgsrc/net/socat/Makefile
diff -u pkgsrc/net/socat/Makefile:1.39 pkgsrc/net/socat/Makefile:1.40
--- pkgsrc/net/socat/Makefile:1.39      Sat Nov 11 19:43:06 2017
+++ pkgsrc/net/socat/Makefile   Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2017/11/11 19:43:06 maya Exp $
+# $NetBSD: Makefile,v 1.40 2018/07/04 13:40:31 jperkin Exp $
 
 DISTNAME=      socat-1.7.3.2
 PKGREVISION=   1
@@ -32,7 +32,7 @@ CONFIGURE_ENV+=               ac_cv_ispeed_offset=9
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     doc/socat.1
 SUBST_SED.paths=       -e 's,/usr/,${PREFIX}/,g'
 

Index: pkgsrc/net/sysmon/Makefile
diff -u pkgsrc/net/sysmon/Makefile:1.9 pkgsrc/net/sysmon/Makefile:1.10
--- pkgsrc/net/sysmon/Makefile:1.9      Sun Feb 11 15:53:45 2018
+++ pkgsrc/net/sysmon/Makefile  Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2018/02/11 15:53:45 wiz Exp $
+# $NetBSD: Makefile,v 1.10 2018/07/04 13:40:31 jperkin Exp $
 
 DISTNAME=              sysmon-0.93
 CATEGORIES=            net
@@ -23,7 +23,7 @@ CONF_FILES=           ${EGDIR}/sysmon.conf.dist \
 
 SUBST_CLASSES+=         paths
 SUBST_FILES.paths=      ${WRKSRC}/autoconf/Makefile.in
-SUBST_STAGE.paths=      post-patch
+SUBST_STAGE.paths=      pre-configure
 SUBST_SED.paths=        -e 's,@destdir@,${DESTDIR},g'
 
 INSTALLATION_DIRS=      share/examples/sysmon

Index: pkgsrc/net/twittering-mode/Makefile
diff -u pkgsrc/net/twittering-mode/Makefile:1.1 pkgsrc/net/twittering-mode/Makefile:1.2
--- pkgsrc/net/twittering-mode/Makefile:1.1     Fri Jun 14 13:41:46 2013
+++ pkgsrc/net/twittering-mode/Makefile Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/06/14 13:41:46 mef Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:31 jperkin Exp $
 
 DISTNAME=      twittering-mode-3.0.0
 CATEGORIES=    net
@@ -17,7 +17,7 @@ USE_LANGUAGES=        # none
 # to tell a user the version number by this command (mef@).
 SUBST_CLASSES+=                version
 SUBST_MESSAGE.version= Replace version string 'HEAD' by ${PKGVERSION}
-SUBST_STAGE.version=   post-patch
+SUBST_STAGE.version=   pre-configure
 SUBST_FILES.version=   twittering-mode.el
 SUBST_SED.version=     -e '/defconst/s,HEAD,${PKGVERSION},'
 

Index: pkgsrc/net/ucspi-tcp/options.mk
diff -u pkgsrc/net/ucspi-tcp/options.mk:1.5 pkgsrc/net/ucspi-tcp/options.mk:1.6
--- pkgsrc/net/ucspi-tcp/options.mk:1.5 Wed Jan  4 02:14:12 2017
+++ pkgsrc/net/ucspi-tcp/options.mk     Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.5 2017/01/04 02:14:12 schmonz Exp $
+# $NetBSD: options.mk,v 1.6 2018/07/04 13:40:31 jperkin Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.ucspi-tcp
 PKG_SUPPORTED_OPTIONS+=        inet6 ucspi-tcp-nodefaultrbl
@@ -15,7 +15,7 @@ PATCH_DIST_STRIP.${IPV6_PATCH}=       -p1
 PLIST.inet6=                   yes
 
 SUBST_CLASSES+=                hier
-SUBST_STAGE.hier=      post-patch
+SUBST_STAGE.hier=      pre-configure
 SUBST_MESSAGE.hier=    Fixing manpage path.
 SUBST_FILES.hier=      hier.c
 SUBST_SED.hier=                -e 's,man,${PKGMANDIR},'

Index: pkgsrc/net/vpnc/Makefile
diff -u pkgsrc/net/vpnc/Makefile:1.42 pkgsrc/net/vpnc/Makefile:1.43
--- pkgsrc/net/vpnc/Makefile:1.42       Wed Sep  6 09:03:03 2017
+++ pkgsrc/net/vpnc/Makefile    Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2017/09/06 09:03:03 wiz Exp $
+# $NetBSD: Makefile,v 1.43 2018/07/04 13:40:31 jperkin Exp $
 #
 
 DISTNAME=              vpnc-0.5.3
@@ -21,7 +21,7 @@ OWN_DIRS=             ${PKG_SYSCONFDIR}/vpnc
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   fixing pathnames
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     config.c vpnc-script.in makeman.pl pcf2vpnc
 SUBST_FILES.paths+=    vpnc.8.template vpnc-disconnect
 SUBST_SED.paths=       -e 's|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g'

Index: pkgsrc/net/vpnc/options.mk
diff -u pkgsrc/net/vpnc/options.mk:1.3 pkgsrc/net/vpnc/options.mk:1.4
--- pkgsrc/net/vpnc/options.mk:1.3      Wed Feb 15 13:02:31 2012
+++ pkgsrc/net/vpnc/options.mk  Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.3 2012/02/15 13:02:31 obache Exp $
+# $NetBSD: options.mk,v 1.4 2018/07/04 13:40:31 jperkin Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.openvpnc
 PKG_SUPPORTED_OPTIONS= openssl         # off by default
@@ -10,7 +10,7 @@ PKG_SUGGESTED_OPTIONS=
 .include "../../security/openssl/buildlink3.mk"
 SUBST_CLASSES+=                openssl
 SUBST_MESSAGE.openssl= adding openssl option
-SUBST_STAGE.openssl=   post-patch
+SUBST_STAGE.openssl=   pre-configure
 SUBST_FILES.openssl=   Makefile
 SUBST_SED.openssl=     -e 's/^.OPENSSL_GPL_VIOLATION/OPENSSL_GPL_VIOLATION/'
 SUBST_SED.openssl+=    -e 's/^.OPENSSLLIBS/OPENSSLLIBS/'

Index: pkgsrc/net/vsftpd/Makefile
diff -u pkgsrc/net/vsftpd/Makefile:1.44 pkgsrc/net/vsftpd/Makefile:1.45
--- pkgsrc/net/vsftpd/Makefile:1.44     Fri Feb  9 16:46:42 2018
+++ pkgsrc/net/vsftpd/Makefile  Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.44 2018/02/09 16:46:42 triaxx Exp $
+# $NetBSD: Makefile,v 1.45 2018/07/04 13:40:31 jperkin Exp $
 
 DISTNAME=      vsftpd-3.0.3
 CATEGORIES=    net
@@ -32,7 +32,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     vsftpd.8 vsftpd.conf.5 vsftpd.conf
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
 SUBST_SED.paths+=      -e 's,@VARBASE@,${VARBASE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 MAKE_ENV+=             LIBS=${LIBS:Q}
 

Index: pkgsrc/net/xymon/Makefile
diff -u pkgsrc/net/xymon/Makefile:1.53 pkgsrc/net/xymon/Makefile:1.54
--- pkgsrc/net/xymon/Makefile:1.53      Mon Apr 16 14:35:04 2018
+++ pkgsrc/net/xymon/Makefile   Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2018/04/16 14:35:04 wiz Exp $
+# $NetBSD: Makefile,v 1.54 2018/07/04 13:40:31 jperkin Exp $
 #
 
 DISTNAME=              xymon-4.3.28
@@ -125,7 +125,7 @@ CONFIGURE_ENV+=             MANROOT=${PREFIX}/${PKG
 SUBST_CLASSES+=                bashpath
 SUBST_FILES.bashpath=  xymond/xymonreports.sh.DIST
 SUBST_SED.bashpath=    -e 's,/bin/bash,'${BASH:Q}','
-SUBST_STAGE.bashpath=  post-patch
+SUBST_STAGE.bashpath=  pre-configure
 
 USE_TOOLS+=    awk:run         cat:run         cp:run
 USE_TOOLS+=    cut:run         date:run        egrep:run

Index: pkgsrc/net/zenmap/Makefile
diff -u pkgsrc/net/zenmap/Makefile:1.1 pkgsrc/net/zenmap/Makefile:1.2
--- pkgsrc/net/zenmap/Makefile:1.1      Sat Apr 14 13:04:33 2018
+++ pkgsrc/net/zenmap/Makefile  Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2018/04/14 13:04:33 adam Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:31 jperkin Exp $
 
 .include "../../net/nmap/Makefile.common"
 
@@ -19,7 +19,7 @@ DEPENDS+=     ${PYPKGPREFIX}-sqlite3-[0-9]*:
 PYSETUPARGS+=          vanilla
 
 SUBST_CLASSES+=                setup
-SUBST_STAGE.setup=     post-patch
+SUBST_STAGE.setup=     pre-configure
 SUBST_MESSAGE.setup=   Fixing setup.
 SUBST_FILES.setup=     setup.py
 SUBST_SED.setup=       -e 's,\(self.create_uninstaller\),\#\1,g'

Index: pkgsrc/parallel/ganglia-monitor-core/Makefile
diff -u pkgsrc/parallel/ganglia-monitor-core/Makefile:1.59 pkgsrc/parallel/ganglia-monitor-core/Makefile:1.60
--- pkgsrc/parallel/ganglia-monitor-core/Makefile:1.59  Thu Jun 28 01:05:01 2018
+++ pkgsrc/parallel/ganglia-monitor-core/Makefile       Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.59 2018/06/28 01:05:01 bacon Exp $
+# $NetBSD: Makefile,v 1.60 2018/07/04 13:40:31 jperkin Exp $
 #
 
 DISTNAME=              ganglia-3.7.2
@@ -76,14 +76,14 @@ SUBST_VARS.paths+=  GANGLIA_VARBASE
 ## gmond.conf.5 and gmond.conf.html can be generated from conf.pod, but
 ## doing so requires perl installed in the build stage.
 SUBST_CLASSES+=                etcdir
-SUBST_STAGE.etcdir=    post-patch
+SUBST_STAGE.etcdir=    pre-configure
 SUBST_FILES.etcdir=    ${WRKSRC}/README \
                        ${WRKSRC}/mans/gmetad.1 \
                        ${WRKSRC}/mans/gmond.1
 SUBST_SED.etcdir=      -e "s|/etc/ganglia/\(gm.*d\.conf\)|${PREFIX}/etc/\1|g"
 
 SUBST_CLASSES+=                        linux_init
-SUBST_STAGE.linux_init=                post-patch
+SUBST_STAGE.linux_init=                pre-configure
 SUBST_FILES.linux_init=                gmond/gmond.init
 SUBST_FILES.linux_init+=       gmetad/gmetad.init
 SUBST_SED.linux_init=          -e 's|/usr/sbin|${PREFIX}/sbin|g'
@@ -92,7 +92,7 @@ SUBST_SED.linux_init+=                -e 's|/etc/gangl
 SUBST_SED.linux_init+=         -e 's|/var/lock/subsys|${PREFIX}&|g'
 
 SUBST_CLASSES+=                systemd
-SUBST_STAGE.systemd=   post-patch
+SUBST_STAGE.systemd=   pre-configure
 SUBST_FILES.systemd=   gmond/gmond.service gmetad/gmetad.service
 SUBST_SED.systemd=     -e 's|@runstatedir@|${PREFIX}/var/run|g'
 SUBST_SED.systemd+=    -e 's|@sbindir@|${PREFIX}/sbin|g'

Index: pkgsrc/parallel/gridscheduler/Makefile
diff -u pkgsrc/parallel/gridscheduler/Makefile:1.22 pkgsrc/parallel/gridscheduler/Makefile:1.23
--- pkgsrc/parallel/gridscheduler/Makefile:1.22 Mon Jan  1 18:16:38 2018
+++ pkgsrc/parallel/gridscheduler/Makefile      Wed Jul  4 13:40:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2018/01/01 18:16:38 rillig Exp $
+# $NetBSD: Makefile,v 1.23 2018/07/04 13:40:31 jperkin Exp $
 
 PKGNAME=       gridscheduler-2011.11.1
 PKGREVISION=   2
@@ -113,7 +113,7 @@ post-patch:
        ${ECHO} "BERKELEYDBBASE=${BUILDLINK_PREFIX.db4}" ) > ${WRKSRC}/source/distinst.private
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     source/dist/util/arch_variables
 SUBST_SED.paths=       -e 's;@rcd_dir@;${RCD_SCRIPTS_DIR};'
 

Index: pkgsrc/parallel/sge/Makefile
diff -u pkgsrc/parallel/sge/Makefile:1.65 pkgsrc/parallel/sge/Makefile:1.66
--- pkgsrc/parallel/sge/Makefile:1.65   Mon Oct  3 11:48:31 2016
+++ pkgsrc/parallel/sge/Makefile        Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.65 2016/10/03 11:48:31 wiz Exp $
+# $NetBSD: Makefile,v 1.66 2018/07/04 13:40:32 jperkin Exp $
 
 DISTNAME=              sge-8.1.6
 PKGREVISION=           5
@@ -123,7 +123,7 @@ post-patch:
        rm ${WRKSRC}/source/dist/util/*.orig
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     source/dist/util/arch_variables
 SUBST_SED.paths=       -e 's;@rcd_dir@;${RCD_SCRIPTS_DIR};'
 

Index: pkgsrc/parallel/slurm-wlm/Makefile
diff -u pkgsrc/parallel/slurm-wlm/Makefile:1.3 pkgsrc/parallel/slurm-wlm/Makefile:1.4
--- pkgsrc/parallel/slurm-wlm/Makefile:1.3      Sun Apr 29 21:32:01 2018
+++ pkgsrc/parallel/slurm-wlm/Makefile  Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/04/29 21:32:01 adam Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:32 jperkin Exp $
 
 DISTNAME=      slurm-17.11.5
 PKGNAME=       slurm-wlm-17.11.5
@@ -50,7 +50,7 @@ PKG_SHELL.slurm=      ${NOLOGIN}
 RCD_SCRIPTS+=          slurmd slurmctld
 
 SUBST_CLASSES+=                linuxinit
-SUBST_STAGE.linuxinit= post-patch
+SUBST_STAGE.linuxinit= pre-configure
 SUBST_FILES.linuxinit= etc/init.d.slurm.in
 SUBST_SED.linuxinit=   -e 's|^exec_prefix=|&${PREFIX}|'
 SUBST_SED.linuxinit+=  -e 's|^prefix=|&${PREFIX}|'
@@ -61,7 +61,7 @@ SUBST_SED.linuxinit+= -e 's|@sysconfdir@
 
 # Configure flag to disable gtk does not work, so set an impossible requirement
 SUBST_CLASSES+=                gtk
-SUBST_STAGE.gtk=       post-patch
+SUBST_STAGE.gtk=       pre-configure
 SUBST_SED.gtk=         -e 's|min_gtk_version=.*|min_gtk_version=2000.0.0|'
 SUBST_FILES.gtk=       configure
 

Index: pkgsrc/pkgtools/dfdisk/Makefile
diff -u pkgsrc/pkgtools/dfdisk/Makefile:1.16 pkgsrc/pkgtools/dfdisk/Makefile:1.17
--- pkgsrc/pkgtools/dfdisk/Makefile:1.16        Mon Mar  3 03:42:05 2014
+++ pkgsrc/pkgtools/dfdisk/Makefile     Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2014/03/03 03:42:05 obache Exp $
+# $NetBSD: Makefile,v 1.17 2018/07/04 13:40:32 jperkin Exp $
 #
 
 PKGNAME=       dfdisk-1.0
@@ -33,7 +33,7 @@ SUBST_SED.paths+=     -e 's,@PKGVERSION@,${P
 SUBST_SED.paths+=      -e 's,@PKGBASE@,${PKGBASE},g'
 SUBST_SED.paths+=      -e 's,@FTP@,${FTP},g'
 SUBST_SED.paths+=      -e 's,@SH@,${SH},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
 .for f in dfdisk.sh dfdisk.1 dfdisk.conf

Index: pkgsrc/pkgtools/libkver/Makefile
diff -u pkgsrc/pkgtools/libkver/Makefile:1.38 pkgsrc/pkgtools/libkver/Makefile:1.39
--- pkgsrc/pkgtools/libkver/Makefile:1.38       Sat Jan 27 19:07:46 2018
+++ pkgsrc/pkgtools/libkver/Makefile    Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2018/01/27 19:07:46 rillig Exp $
+# $NetBSD: Makefile,v 1.39 2018/07/04 13:40:32 jperkin Exp $
 
 PKGNAME=               libkver-${VERSION}
 CATEGORIES=            pkgtools
@@ -34,7 +34,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     kver/kver.sh kver/kver.8 lib/kver.3
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.paths+=      -e 's,@SH@,${SH},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 INSTALLATION_DIRS+=    sbin ${PKGMANDIR}/man8 ${PKGMANDIR}/cat8
 INSTALLATION_DIRS+=    lib ${PKGMANDIR}/man3 ${PKGMANDIR}/cat3

Index: pkgsrc/pkgtools/pbulk/Makefile
diff -u pkgsrc/pkgtools/pbulk/Makefile:1.81 pkgsrc/pkgtools/pbulk/Makefile:1.82
--- pkgsrc/pkgtools/pbulk/Makefile:1.81 Sun Dec 18 22:59:35 2016
+++ pkgsrc/pkgtools/pbulk/Makefile      Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.81 2016/12/18 22:59:35 joerg Exp $
+# $NetBSD: Makefile,v 1.82 2018/07/04 13:40:32 jperkin Exp $
 
 PKGNAME=       pbulk-0.65
 COMMENT=       Modular bulk build framework
@@ -21,7 +21,7 @@ TARGET_MAKE=  $${prefix}/bin/bmake
 NEATO=         ${PREFIX}/bin/neato
 
 SUBST_CLASSES+=                tools
-SUBST_STAGE.tools=     post-patch
+SUBST_STAGE.tools=     pre-configure
 SUBST_MESSAGE.tools=   Fixing references to tools
 SUBST_FILES.tools=     pbulk.conf scripts/build scripts/build-client-start \
        scripts/bulkbuild scripts/bulkbuild-rebuild scripts/bulkbuild-restart \

Index: pkgsrc/pkgtools/pkg/Makefile
diff -u pkgsrc/pkgtools/pkg/Makefile:1.22 pkgsrc/pkgtools/pkg/Makefile:1.23
--- pkgsrc/pkgtools/pkg/Makefile:1.22   Sat Jan 27 19:07:47 2018
+++ pkgsrc/pkgtools/pkg/Makefile        Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2018/01/27 19:07:47 rillig Exp $
+# $NetBSD: Makefile,v 1.23 2018/07/04 13:40:32 jperkin Exp $
 
 DISTNAME=      pkg-1.9.99.4
 PKGREVISION=   1
@@ -80,7 +80,7 @@ SUBST_SED.portsdir=   -e "s|/usr/ports|${P
 SUBST_MESSAGE.portsdir=        Correct reference to FreeBSD portsdir.
 
 SUBST_CLASSES+=                config
-SUBST_STAGE.config=    post-patch
+SUBST_STAGE.config=    pre-configure
 SUBST_FILES.config=    libpkg/pkg_config.c
 SUBST_SED.config=      -e "s|/usr/ports|${PKG.portsdir}|g" \
                        -e "s|/var/db/pkg|${PKGNG_DBDIR}|g" \
@@ -88,7 +88,7 @@ SUBST_SED.config=     -e "s|/usr/ports|${PKG
 SUBST_MESSAGE.config=  Update pkg(8) defaults.
 
 SUBST_CLASSES+=                vuxml
-SUBST_STAGE.vuxml=     post-patch
+SUBST_STAGE.vuxml=     pre-configure
 SUBST_FILES.vuxml=     libpkg/pkg_audit.c
 SUBST_SED.vuxml=       -e "s|https://vuxml.FreeBSD.org/freebsd|http://muscles.dragonflybsd.org/pkgsrc-vuxml/reports|"
 SUBST_MESSAGE.vuxml=   Direct audit reports to Pkgsrc vuxml

Index: pkgsrc/pkgtools/pkg_filecheck/Makefile
diff -u pkgsrc/pkgtools/pkg_filecheck/Makefile:1.43 pkgsrc/pkgtools/pkg_filecheck/Makefile:1.44
--- pkgsrc/pkgtools/pkg_filecheck/Makefile:1.43 Sat Jan 27 19:07:47 2018
+++ pkgsrc/pkgtools/pkg_filecheck/Makefile      Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.43 2018/01/27 19:07:47 rillig Exp $
+# $NetBSD: Makefile,v 1.44 2018/07/04 13:40:32 jperkin Exp $
 #
 
 PKGNAME=       pkg_filecheck-0.4
@@ -31,7 +31,7 @@ SUBST_SED.paths+=     -e 's,@PREFIX@,${PREFI
 SUBST_SED.paths+=      -e 's,@PERL5@,${PERL5},g'
 SUBST_SED.paths+=      -e 's,@PKG_DBDIR@,${PKG_DBDIR},g'
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
 .for f in builddb.pl builddb.1 pkg_filecheck.conf pkg_filecheck.conf.5 \

Index: pkgsrc/pkgtools/pkg_notify/Makefile
diff -u pkgsrc/pkgtools/pkg_notify/Makefile:1.25 pkgsrc/pkgtools/pkg_notify/Makefile:1.26
--- pkgsrc/pkgtools/pkg_notify/Makefile:1.25    Mon Oct 10 07:42:53 2016
+++ pkgsrc/pkgtools/pkg_notify/Makefile Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2016/10/10 07:42:53 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:32 jperkin Exp $
 
 PKGNAME=       pkg_notify-0.4.6
 CATEGORIES=    pkgtools
@@ -22,7 +22,7 @@ CONF_FILES=           ${EGDIR}/${PKGBASE}.list \
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES+=                        pkg_notify
-SUBST_STAGE.pkg_notify=                post-patch
+SUBST_STAGE.pkg_notify=                pre-configure
 SUBST_FILES.pkg_notify=                pkg_notify
 SUBST_FILES.pkg_notify+=       pkg_notify.1
 SUBST_SED.pkg_notify=          -e 's|@PKGSRCDIR@|${PKGSRCDIR}|'

Index: pkgsrc/pkgtools/pkgclean/Makefile
diff -u pkgsrc/pkgtools/pkgclean/Makefile:1.19 pkgsrc/pkgtools/pkgclean/Makefile:1.20
--- pkgsrc/pkgtools/pkgclean/Makefile:1.19      Thu Oct  9 14:06:50 2014
+++ pkgsrc/pkgtools/pkgclean/Makefile   Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2014/10/09 14:06:50 wiz Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:32 jperkin Exp $
 
 PKGNAME=       pkgclean-20051116
 CATEGORIES=    pkgtools
@@ -20,7 +20,7 @@ do-install:
        ${INSTALL_MAN} ${WRKSRC}/pkgclean.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/pkgclean.1
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      pkgclean.sh pkgclean.1
 SUBST_SED.path+=       -e 's,@SH@,${SH},g'
 SUBST_SED.path+=       -e 's,@PKGSRCDIR@,${PKGSRCDIR},g'

Index: pkgsrc/pkgtools/pkgfind/Makefile
diff -u pkgsrc/pkgtools/pkgfind/Makefile:1.27 pkgsrc/pkgtools/pkgfind/Makefile:1.28
--- pkgsrc/pkgtools/pkgfind/Makefile:1.27       Thu Oct  9 14:06:50 2014
+++ pkgsrc/pkgtools/pkgfind/Makefile    Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2014/10/09 14:06:50 wiz Exp $
+# $NetBSD: Makefile,v 1.28 2018/07/04 13:40:32 jperkin Exp $
 
 PKGNAME=       pkgfind-20111022
 CATEGORIES=    pkgtools
@@ -23,7 +23,7 @@ do-install:
        ${INSTALL_MAN} ${WRKSRC}/pkgfind.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/pkgfind.1
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      pkgfind.c pkgfind.1
 SUBST_SED.path=                -e "s,/usr/pkgsrc,${PKGSRCDIR},g"
 SUBST_MESSAGE.path=    Adjusting pkgsrc directory.

Index: pkgsrc/print/apsfilter/Makefile
diff -u pkgsrc/print/apsfilter/Makefile:1.34 pkgsrc/print/apsfilter/Makefile:1.35
--- pkgsrc/print/apsfilter/Makefile:1.34        Tue Oct  3 15:12:42 2017
+++ pkgsrc/print/apsfilter/Makefile     Wed Jul  4 13:40:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2017/10/03 15:12:42 wiz Exp $
+# $NetBSD: Makefile,v 1.35 2018/07/04 13:40:32 jperkin Exp $
 
 DISTNAME=      apsfilter-7.2.8
 PKGREVISION=   1
@@ -33,7 +33,7 @@ CONF_FILES=   ${PREFIX}/share/apsfilter/te
                ${PKG_SYSCONFDIR}/apsfilterrc
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    bin/apsfilter.in SETUP.in tools/prtmgmt
 SUBST_SED.prefix=      -e 's,/usr/local,${LOCALBASE},g'
 SUBST_SED.prefix+=     -e 's,/usr/X11R6,${X11BASE},g'

Index: pkgsrc/print/cups-base/Makefile
diff -u pkgsrc/print/cups-base/Makefile:1.11 pkgsrc/print/cups-base/Makefile:1.12
--- pkgsrc/print/cups-base/Makefile:1.11        Fri Jun 22 14:12:45 2018
+++ pkgsrc/print/cups-base/Makefile     Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2018/06/22 14:12:45 bouyer Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:33 jperkin Exp $
 
 .include "../../print/cups/Makefile.common"
 PKGREVISION=1
@@ -115,20 +115,20 @@ OWN_DIRS_PERMS+=  ${CUPS_CACHE}/rss ${REA
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKDIR}/cups.pam
 SUBST_SED.paths+=      -e 's,@LOCALBASE@,${LOCALBASE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 SUBST_CLASSES+=                rpathfix
 SUBST_FILES.rpathfix=  cups-config.in
 SUBST_MESSAGE.rpathfix=        Adding rpath to cups-config.
 SUBST_SED.rpathfix=    -e 's|@EXPORT_LDFLAGS@|${COMPILER_RPATH_FLAG}${PREFIX}/lib|g'
-SUBST_STAGE.rpathfix=  post-patch
+SUBST_STAGE.rpathfix=  pre-configure
 
 .if !empty(OPSYS:MNetBSD) && !empty(MACHINE_ARCH:Mpowerpc)
 SUBST_CLASSES+=                piefix
 SUBST_FILES.piefix=    Makedefs.in
 SUBST_MESSAGE.piefix=  Removing PIE flags
 SUBST_SED.piefix=      -e 's|@PIEFLAGS@||g'
-SUBST_STAGE.piefix=    post-patch
+SUBST_STAGE.piefix=    pre-configure
 .endif
 
 INSTALLATION_DIRS=     ${DOCDIR} ${EGDIR} ${MIMEDIR}

Index: pkgsrc/print/cups15/Makefile
diff -u pkgsrc/print/cups15/Makefile:1.20 pkgsrc/print/cups15/Makefile:1.21
--- pkgsrc/print/cups15/Makefile:1.20   Sun Aug 20 23:55:54 2017
+++ pkgsrc/print/cups15/Makefile        Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2017/08/20 23:55:54 jlam Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:33 jperkin Exp $
 #
 # The CUPS author is very good about taking back changes into the main
 # CUPS distribution.  The correct place to send patches or bug-fixes is:
@@ -143,20 +143,20 @@ OWN_DIRS_PERMS+=  ${CUPS_CACHE}/rss ${REA
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKDIR}/cups.pam
 SUBST_SED.paths+=      -e 's,@LOCALBASE@,${LOCALBASE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 SUBST_CLASSES+=                rpathfix
 SUBST_FILES.rpathfix=  cups-config.in
 SUBST_MESSAGE.rpathfix=        Adding rpath to cups-config.
 SUBST_SED.rpathfix=    -e 's|@EXPORT_LDFLAGS@|${COMPILER_RPATH_FLAG}${PREFIX}/lib|g'
-SUBST_STAGE.rpathfix=  post-patch
+SUBST_STAGE.rpathfix=  pre-configure
 
 .if !empty(OPSYS:MNetBSD) && !empty(MACHINE_ARCH:Mpowerpc)
 SUBST_CLASSES+=                piefix
 SUBST_FILES.piefix=    Makedefs.in
 SUBST_MESSAGE.piefix=  Removing PIE flags
 SUBST_SED.piefix=      -e 's|@PIEFLAGS@||g'
-SUBST_STAGE.piefix=    post-patch
+SUBST_STAGE.piefix=    pre-configure
 .endif
 
 INSTALLATION_DIRS=     ${DOCDIR} ${EGDIR} ${MIMEDIR}

Index: pkgsrc/print/foo2zjs/Makefile
diff -u pkgsrc/print/foo2zjs/Makefile:1.4 pkgsrc/print/foo2zjs/Makefile:1.5
--- pkgsrc/print/foo2zjs/Makefile:1.4   Tue Jul 28 16:42:03 2015
+++ pkgsrc/print/foo2zjs/Makefile       Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2015/07/28 16:42:03 rumko Exp $
+# $NetBSD: Makefile,v 1.5 2018/07/04 13:40:33 jperkin Exp $
 #
 
 DISTNAME=      foo2zjs
@@ -25,7 +25,7 @@ SUBST_FILES.paths=    Makefile icc2ps/Makef
 SUBST_SED.paths=       -e "s,@PREFIX@,${DESTDIR}${PREFIX},"
 SUBST_SED.paths+=      -e "s,@PKGMANDIR@,${DESTDIR}${PREFIX}/${PKGMANDIR},"
 SUBST_SED.paths+=      -e "s,@RUNPREFIX@,${PREFIX},"
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 do-build:
        cd ${WRKSRC} && ${GMAKE} ${PROGS}

Index: pkgsrc/print/indexinfo/Makefile
diff -u pkgsrc/print/indexinfo/Makefile:1.1 pkgsrc/print/indexinfo/Makefile:1.2
--- pkgsrc/print/indexinfo/Makefile:1.1 Mon Dec  5 19:54:15 2016
+++ pkgsrc/print/indexinfo/Makefile     Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2016/12/05 19:54:15 marino Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:33 jperkin Exp $
 
 PKGNAME=       indexinfo-0.2.6
 CATEGORIES=    print
@@ -17,7 +17,7 @@ pre-install:
 
 .if ${OPSYS} != "FreeBSD" && ${OPSYS} != "DragonFly"
 SUBST_CLASSES+=                reallocf
-SUBST_STAGE.reallocf=  post-patch
+SUBST_STAGE.reallocf=  pre-configure
 SUBST_FILES.reallocf=  indexinfo.c
 SUBST_SED.reallocf=    -e "s|reallocf|realloc|"
 SUBST_MESSAGE.reallocf=        Replace reallocf with realloc on ${OPSYS}

Index: pkgsrc/print/pdfmod/Makefile
diff -u pkgsrc/print/pdfmod/Makefile:1.20 pkgsrc/print/pdfmod/Makefile:1.21
--- pkgsrc/print/pdfmod/Makefile:1.20   Mon Apr 16 14:35:06 2018
+++ pkgsrc/print/pdfmod/Makefile        Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2018/04/16 14:35:06 wiz Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:33 jperkin Exp $
 
 DISTNAME=      pdfmod-0.9.1
 PKGREVISION=   20
@@ -20,7 +20,7 @@ REPLACE_SH=           icon-theme-installer
 INSTALLATION_DIRS+=    lib/pdfmod
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/print/py-cups/Makefile
diff -u pkgsrc/print/py-cups/Makefile:1.37 pkgsrc/print/py-cups/Makefile:1.38
--- pkgsrc/print/py-cups/Makefile:1.37  Tue Apr 17 22:29:49 2018
+++ pkgsrc/print/py-cups/Makefile       Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.37 2018/04/17 22:29:49 wiz Exp $
+# $NetBSD: Makefile,v 1.38 2018/07/04 13:40:33 jperkin Exp $
 
 DISTNAME=      pycups-1.9.73
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:S/^py//}
@@ -19,7 +19,7 @@ SUBST_CLASSES+=               paths
 SUBST_MESSAGE.paths=   Fix cups paths.
 SUBST_FILES.paths=     cupsconnection.c
 SUBST_SED.paths=       -e 's:"/usr/share/cups":"${BUILDLINK_PREFIX.cups-base}/share/cups/", "/usr/share/cups":'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 .include "../../lang/python/distutils.mk"
 .include "../../print/cups-base/buildlink3.mk"

Index: pkgsrc/print/xpdf/Makefile
diff -u pkgsrc/print/xpdf/Makefile:1.85 pkgsrc/print/xpdf/Makefile:1.86
--- pkgsrc/print/xpdf/Makefile:1.85     Sat Apr 21 13:38:06 2018
+++ pkgsrc/print/xpdf/Makefile  Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.85 2018/04/21 13:38:06 wiz Exp $
+# $NetBSD: Makefile,v 1.86 2018/07/04 13:40:33 jperkin Exp $
 
 DISTNAME=      xpdf-3.04
 CATEGORIES=    print
@@ -40,7 +40,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths+=    doc/sample-xpdfrc doc/xpdf.1 doc/xpdfrc.5
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 OWN_DIRS=              share/xpdf
 

Index: pkgsrc/print/xpdf-korean/Makefile
diff -u pkgsrc/print/xpdf-korean/Makefile:1.27 pkgsrc/print/xpdf-korean/Makefile:1.28
--- pkgsrc/print/xpdf-korean/Makefile:1.27      Sat Apr 21 13:38:06 2018
+++ pkgsrc/print/xpdf-korean/Makefile   Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2018/04/21 13:38:06 wiz Exp $
+# $NetBSD: Makefile,v 1.28 2018/07/04 13:40:33 jperkin Exp $
 
 DISTNAME=      xpdf-korean-2011-sep-02
 PKGNAME=       xpdf-korean-20110902
@@ -22,7 +22,7 @@ INSTALLATION_DIRS+=   share/xpdf/korean/CM
 
 SUBST_CLASSES+=                xpdfrc
 SUBST_MESSAGE.xpdfrc=  Adjusting xpdfrc wedge.
-SUBST_STAGE.xpdfrc=    post-patch
+SUBST_STAGE.xpdfrc=    pre-configure
 SUBST_FILES.xpdfrc=    add-to-xpdfrc
 SUBST_SED.xpdfrc+=     -e 's,/usr/\.\.\.\.,'${PREFIX}'/share/fonts/X11/TTF,' \
                        -e 's:/usr/local:'${PREFIX}':g' \

Index: pkgsrc/security/base/Makefile
diff -u pkgsrc/security/base/Makefile:1.42 pkgsrc/security/base/Makefile:1.43
--- pkgsrc/security/base/Makefile:1.42  Wed Feb 21 12:25:23 2018
+++ pkgsrc/security/base/Makefile       Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2018/02/21 12:25:23 wiz Exp $
+# $NetBSD: Makefile,v 1.43 2018/07/04 13:40:33 jperkin Exp $
 
 DISTNAME=      base-1.4.3.1
 PKGREVISION=   12
@@ -58,7 +58,7 @@ CONF_FILES_PERMS=     ${EGDIR}/base_conf.php
 BUILD_DEFS+=           APACHE_USER APACHE_GROUP
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      base.conf base_conf.php.dist
 SUBST_SED.conf=                -e "s|@BASE_DIR@|${BASE_DIR}|g"
 SUBST_SED.conf+=       -e "s|@DBTYPE@|${DBTYPE}|g"

Index: pkgsrc/security/chkrootkit/Makefile
diff -u pkgsrc/security/chkrootkit/Makefile:1.24 pkgsrc/security/chkrootkit/Makefile:1.25
--- pkgsrc/security/chkrootkit/Makefile:1.24    Wed Apr 29 15:55:47 2015
+++ pkgsrc/security/chkrootkit/Makefile Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2015/04/29 15:55:47 christos Exp $
+# $NetBSD: Makefile,v 1.25 2018/07/04 13:40:33 jperkin Exp $
 #
 
 DISTNAME=              chkrootkit-0.50
@@ -19,7 +19,7 @@ PROGRAMS=     chkdirs chklastlog chkproc chk
 DOCDIR=                ${PREFIX}/share/doc/chkrootkit
 
 SUBST_CLASSES+=                helper
-SUBST_STAGE.helper=    post-patch
+SUBST_STAGE.helper=    pre-configure
 SUBST_FILES.helper=    chkrootkit
 SUBST_SED.helper=      -e "s|./chklastlog|${PREFIX}/bin/chklastlog|g"
 SUBST_SED.helper+=     -e "s|./chkproc|${PREFIX}/bin/chkproc|g"

Index: pkgsrc/security/dropbear/Makefile
diff -u pkgsrc/security/dropbear/Makefile:1.34 pkgsrc/security/dropbear/Makefile:1.35
--- pkgsrc/security/dropbear/Makefile:1.34      Thu Nov  9 19:00:25 2017
+++ pkgsrc/security/dropbear/Makefile   Wed Jul  4 13:40:33 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2017/11/09 19:00:25 snj Exp $
+# $NetBSD: Makefile,v 1.35 2018/07/04 13:40:33 jperkin Exp $
 
 DISTNAME=      dropbear-2017.75
 CATEGORIES=    security
@@ -25,7 +25,7 @@ PKG_SUPPORTED_OPTIONS=        pam
 CONFIGURE_ARGS+=       --enable-pam
 SUBST_CLASSES+=                pam
 SUBST_MESSAGE.pam=     Enabling PAM in options.h
-SUBST_STAGE.pam=       post-patch
+SUBST_STAGE.pam=       pre-configure
 SUBST_FILES.pam=       options.h
 SUBST_SED.pam=         -e "s/ENABLE_SVR_PASSWORD_AUTH/ENABLE_SVR_PAM_AUTH/"
 .endif

Index: pkgsrc/security/duo-unix/Makefile
diff -u pkgsrc/security/duo-unix/Makefile:1.1 pkgsrc/security/duo-unix/Makefile:1.2
--- pkgsrc/security/duo-unix/Makefile:1.1       Fri Feb 16 07:20:56 2018
+++ pkgsrc/security/duo-unix/Makefile   Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2018/02/16 07:20:56 fhajny Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:34 jperkin Exp $
 #
 
 DISTNAME=      duo_unix-1.10.1
@@ -32,7 +32,7 @@ CONF_FILES_PERMS+=    share/examples/duo-un
 SPECIAL_PERMS+=                sbin/login_duo ${SETUID_ROOT_PERMS}
 
 SUBST_CLASSES+=                man
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_MESSAGE.man=     Fixing sysconfdir references
 SUBST_FILES.man=       login_duo/login_duo.8 pam_duo/pam_duo.8
 SUBST_SED.man=         -e 's,/etc/duo,${PKG_SYSCONFDIR},g'

Index: pkgsrc/security/easy-rsa/Makefile
diff -u pkgsrc/security/easy-rsa/Makefile:1.6 pkgsrc/security/easy-rsa/Makefile:1.7
--- pkgsrc/security/easy-rsa/Makefile:1.6       Sun Jun 24 07:31:09 2018
+++ pkgsrc/security/easy-rsa/Makefile   Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2018/06/24 07:31:09 adam Exp $
+# $NetBSD: Makefile,v 1.7 2018/07/04 13:40:34 jperkin Exp $
 
 DISTNAME=      EasyRSA-3.0.4
 PKGNAME=       ${DISTNAME:S/EasyRSA/easy-rsa/}
@@ -29,7 +29,7 @@ REQD_FILES+=          ${EGDIR}/${f} ${PKG_SYSCON
 .endfor
 
 SUBST_CLASSES+=                sysconf
-SUBST_STAGE.sysconf=   post-patch
+SUBST_STAGE.sysconf=   pre-configure
 SUBST_FILES.sysconf=   easyrsa vars.example
 SUBST_SED.sysconf=     -e "s|@SYSCONFDIR@|${PKG_SYSCONFDIR}|"
 

Index: pkgsrc/security/gpgme/Makefile
diff -u pkgsrc/security/gpgme/Makefile:1.88 pkgsrc/security/gpgme/Makefile:1.89
--- pkgsrc/security/gpgme/Makefile:1.88 Wed Jul  4 12:46:29 2018
+++ pkgsrc/security/gpgme/Makefile      Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.88 2018/07/04 12:46:29 adam Exp $
+# $NetBSD: Makefile,v 1.89 2018/07/04 13:40:34 jperkin Exp $
 
 DISTNAME=      gpgme-1.11.1
 CATEGORIES=    security
@@ -21,7 +21,7 @@ SUBST_CLASSES+=               pthread
 SUBST_FILES.pthread=   src/gpgme-config.in
 SUBST_SED.pthread+=    -e 's,@PTHREAD_LIBS@,${PTHREAD_LDFLAGS} ${PTHREAD_LIBS},g'
 SUBST_SED.pthread+=    -e 's,@PTHREAD_CFLAGS@,${PTHREAD_CFLAGS},g'
-SUBST_STAGE.pthread=   post-patch
+SUBST_STAGE.pthread=   pre-configure
 
 CPPFLAGS.Darwin=       -D_POSIX_C_SOURCE=200809L
 LIBS.SunOS+=           -lnsl -lsocket

Index: pkgsrc/security/ike-scan/Makefile
diff -u pkgsrc/security/ike-scan/Makefile:1.20 pkgsrc/security/ike-scan/Makefile:1.21
--- pkgsrc/security/ike-scan/Makefile:1.20      Wed Aug 16 20:45:44 2017
+++ pkgsrc/security/ike-scan/Makefile   Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2017/08/16 20:45:44 wiz Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:34 jperkin Exp $
 
 DISTNAME=      ike-scan-1.9
 PKGREVISION=   5
@@ -13,7 +13,7 @@ GNU_CONFIGURE=                yes
 CONFIGURE_ARGS+=       --with-openssl=${BUILDLINK_PREFIX.openssl}
 
 SUBST_CLASSES+=                man
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_FILES.man=       ike-scan.1
 SUBST_SED.man=         -e "s|/usr/local|${PREFIX}|g"
 SUBST_MESSAGE.man=     Fixing man pages.

Index: pkgsrc/security/libprelude/Makefile.common
diff -u pkgsrc/security/libprelude/Makefile.common:1.12 pkgsrc/security/libprelude/Makefile.common:1.13
--- pkgsrc/security/libprelude/Makefile.common:1.12     Tue Sep 12 06:14:08 2017
+++ pkgsrc/security/libprelude/Makefile.common  Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.12 2017/09/12 06:14:08 dholland Exp $
+# $NetBSD: Makefile.common,v 1.13 2018/07/04 13:40:34 jperkin Exp $
 #
 # used by security/libprelude/Makefile
 # used by security/libprelude-lua/Makefile
@@ -50,7 +50,7 @@ MAKE_DIRS=            ${PKG_SYSCONFDIR}/default ${
 MAKE_DIRS_PERMS+=      ${PKG_SYSCONFDIR}/profile ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0711
 
 SUBST_CLASSES+=                make
-SUBST_STAGE.make=      post-patch
+SUBST_STAGE.make=      pre-configure
 SUBST_FILES.make=      Makefile.in
 SUBST_SED.make=                -e 's,@EGDIR@,${EGDIR},g'
 

Index: pkgsrc/security/nikto/Makefile
diff -u pkgsrc/security/nikto/Makefile:1.27 pkgsrc/security/nikto/Makefile:1.28
--- pkgsrc/security/nikto/Makefile:1.27 Sun Sep  3 08:36:59 2017
+++ pkgsrc/security/nikto/Makefile      Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2017/09/03 08:36:59 wiz Exp $
+# $NetBSD: Makefile,v 1.28 2018/07/04 13:40:34 jperkin Exp $
 
 DISTNAME=      nikto-2.1.5
 PKGREVISION=   2
@@ -17,20 +17,20 @@ NO_BUILD=   yes
 AUTO_MKDIRS=   yes
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      nikto.pl docs/nikto.1
 SUBST_SED.conf=                -e "s|/etc/nikto\.conf|${PKG_SYSCONFDIR}/nikto.conf|g"
 SUBST_SED.conf+=       -e "s|/etc/nikto\\\&\.conf|${PKG_SYSCONFDIR}/nikto\\\\\\&.conf|g"
 SUBST_MESSAGE.conf=    Fixing path to nikto.conf
 
 SUBST_CLASSES+=                execdir
-SUBST_STAGE.execdir=   post-patch
+SUBST_STAGE.execdir=   pre-configure
 SUBST_FILES.execdir=   nikto.conf
 SUBST_SED.execdir=     -e "s|^\# EXECDIR=/opt/nikto|EXECDIR=${PREFIX}/libdata/nikto|g"
 SUBST_MESSAGE.execdir= Fixing path to EXECDIR
 
 SUBST_CLASSES+=                manual
-SUBST_STAGE.manual=    post-patch
+SUBST_STAGE.manual=    pre-configure
 SUBST_FILES.manual=    docs/nikto.1
 SUBST_SED.manual=      -e "s|/usr/local/bin/nikto|nikto|g"
 SUBST_MESSAGE.manual=  Fixing path to nikto

Index: pkgsrc/security/opendnssec/Makefile
diff -u pkgsrc/security/opendnssec/Makefile:1.70 pkgsrc/security/opendnssec/Makefile:1.71
--- pkgsrc/security/opendnssec/Makefile:1.70    Sat Apr 14 07:34:39 2018
+++ pkgsrc/security/opendnssec/Makefile Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2018/04/14 07:34:39 adam Exp $
+# $NetBSD: Makefile,v 1.71 2018/07/04 13:40:34 jperkin Exp $
 #
 
 DISTNAME=      opendnssec-1.4.13
@@ -50,7 +50,7 @@ PKG_SYSCONFSUBDIR=    opendnssec
 
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKSRC}/conf/Makefile.in
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_SED.paths=       -e 's,@EGDIR@,${EGDIR},'
 
 CXXFLAGS.NetBSD+=      -D_NETBSD_SOURCE

Index: pkgsrc/security/openvas-server/Makefile
diff -u pkgsrc/security/openvas-server/Makefile:1.15 pkgsrc/security/openvas-server/Makefile:1.16
--- pkgsrc/security/openvas-server/Makefile:1.15        Tue Apr 17 22:29:50 2018
+++ pkgsrc/security/openvas-server/Makefile     Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2018/04/17 22:29:50 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:34 jperkin Exp $
 #
 
 DISTNAME=      openvas-server-2.0.0
@@ -18,7 +18,7 @@ USE_TOOLS+=   pkg-config gettext:run
 RCD_SCRIPTS=   openvasd
 
 SUBST_CLASSES+=                user
-SUBST_STAGE.user=      post-patch
+SUBST_STAGE.user=      pre-configure
 SUBST_FILES.user=      openvas-adduser.in openvas-mkcert-client.in
 SUBST_FILES.user+=     openvas-mkcert.in openvas-rmuser.in
 SUBST_SED.user=                -e "s|/usr/bin/gettext|${BUILDLINK_PREFIX.gettext}/bin/gettext|g"

Index: pkgsrc/security/p5-Crypt-GPG/Makefile
diff -u pkgsrc/security/p5-Crypt-GPG/Makefile:1.15 pkgsrc/security/p5-Crypt-GPG/Makefile:1.16
--- pkgsrc/security/p5-Crypt-GPG/Makefile:1.15  Mon Jun  5 14:24:29 2017
+++ pkgsrc/security/p5-Crypt-GPG/Makefile       Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2017/06/05 14:24:29 ryoon Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:34 jperkin Exp $
 #
 
 DISTNAME=              Crypt-GPG-1.64
@@ -21,7 +21,7 @@ DEPENDS+=             p5-TimeDate-[0-9]*:../../time
 SUBST_CLASSES+=                local
 SUBST_FILES.local=     GPG.pm
 SUBST_SED.local=       -e s,/usr/local,${PREFIX},
-SUBST_STAGE.local=     post-patch
+SUBST_STAGE.local=     pre-configure
 
 USE_LANGUAGES=         # empty
 PERL5_PACKLIST=                auto/Crypt/GPG/.packlist

Index: pkgsrc/security/p5-pcsc/Makefile
diff -u pkgsrc/security/p5-pcsc/Makefile:1.20 pkgsrc/security/p5-pcsc/Makefile:1.21
--- pkgsrc/security/p5-pcsc/Makefile:1.20       Mon Jun  5 14:24:35 2017
+++ pkgsrc/security/p5-pcsc/Makefile    Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2017/06/05 14:24:35 ryoon Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:34 jperkin Exp $
 
 DISTNAME=      pcsc-perl-1.4.14
 PKGNAME=       p5-${DISTNAME:S/-perl//}
@@ -15,7 +15,7 @@ PERL5_MODULE_TYPE=    MakeMaker
 LICENSE=               gnu-gpl-v2
 
 SUBST_CLASSES+=                perl
-SUBST_STAGE.perl=      post-patch
+SUBST_STAGE.perl=      pre-configure
 SUBST_FILES.perl=      Card/t/test.t examples/test_iso_error.pl examples/gsm_directory.pl t/test.t test/multiple_readers.pl test/single_reader.pl
 SUBST_SED.perl=                -e 's,/usr/bin/perl,${PERL5},'
 

Index: pkgsrc/security/pam-tacplus/Makefile
diff -u pkgsrc/security/pam-tacplus/Makefile:1.7 pkgsrc/security/pam-tacplus/Makefile:1.8
--- pkgsrc/security/pam-tacplus/Makefile:1.7    Tue Oct 23 18:16:49 2012
+++ pkgsrc/security/pam-tacplus/Makefile        Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2012/10/23 18:16:49 asau Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:34 jperkin Exp $
 #
 
 DISTNAME=      pam_tacplus-1.3.6
@@ -17,7 +17,7 @@ EGDIR=                ${PREFIX}/share/examples/pam_tac
 GNU_CONFIGURE=yes
 
 SUBST_CLASSES+=                egdir
-SUBST_STAGE.egdir=     post-patch
+SUBST_STAGE.egdir=     pre-configure
 SUBST_FILES.egdir=     Makefile.in
 SUBST_SED.egdir=       -e "s,@EGDIR@,${EGDIR},"
 

Index: pkgsrc/security/password-store/Makefile
diff -u pkgsrc/security/password-store/Makefile:1.7 pkgsrc/security/password-store/Makefile:1.8
--- pkgsrc/security/password-store/Makefile:1.7 Thu Jun 14 16:08:39 2018
+++ pkgsrc/security/password-store/Makefile     Wed Jul  4 13:40:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2018/06/14 16:08:39 leot Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:34 jperkin Exp $
 
 DISTNAME=      password-store-1.7.2
 CATEGORIES=    security
@@ -26,7 +26,7 @@ REPLACE_BASH+=        src/password-store.sh
 REPLACE_BASH+= tests/*.sh
 
 SUBST_CLASSES+=                fixsh
-SUBST_STAGE.fixsh=     post-patch
+SUBST_STAGE.fixsh=     pre-configure
 SUBST_MESSAGE.fixsh=   Fixing shell script
 SUBST_FILES.fixsh=     src/password-store.sh
 SUBST_SED.fixsh+=      -e 's,GETOPT="getopt",GETOPT="${PREFIX}/bin/getopt",'

Index: pkgsrc/security/pcsc-tools/Makefile
diff -u pkgsrc/security/pcsc-tools/Makefile:1.17 pkgsrc/security/pcsc-tools/Makefile:1.18
--- pkgsrc/security/pcsc-tools/Makefile:1.17    Thu Feb 16 14:47:56 2017
+++ pkgsrc/security/pcsc-tools/Makefile Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2017/02/16 14:47:56 gdt Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:35 jperkin Exp $
 
 DISTNAME=      pcsc-tools-1.4.27
 CATEGORIES=    security
@@ -19,7 +19,7 @@ DESTDIR_VARNAME=      # empty
 INSTALL_ENV+=          DESTDIR=${DESTDIR}${PREFIX:Q}
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    ATR_analysis ./ATR_analysis.1p
 SUBST_SED.prefix=      -e 's,/usr/local/pcsc,${PREFIX}/share/pcsc,'
 

Index: pkgsrc/security/pks/Makefile
diff -u pkgsrc/security/pks/Makefile:1.34 pkgsrc/security/pks/Makefile:1.35
--- pkgsrc/security/pks/Makefile:1.34   Sun Sep  3 08:36:59 2017
+++ pkgsrc/security/pks/Makefile        Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2017/09/03 08:36:59 wiz Exp $
+# $NetBSD: Makefile,v 1.35 2018/07/04 13:40:35 jperkin Exp $
 
 DISTNAME=      pks-0.9.4
 PKGREVISION=   5
@@ -57,7 +57,7 @@ CONFIGURE_ARGS+=      --sysconfdir=${EGDIR:Q}
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     pks-commands.html
 SUBST_SED.paths=       -e "s|localhost|${PKS_SERVER}|g"
 

Index: pkgsrc/security/prelude-lml/Makefile
diff -u pkgsrc/security/prelude-lml/Makefile:1.41 pkgsrc/security/prelude-lml/Makefile:1.42
--- pkgsrc/security/prelude-lml/Makefile:1.41   Tue Apr 17 22:29:50 2018
+++ pkgsrc/security/prelude-lml/Makefile        Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.41 2018/04/17 22:29:50 wiz Exp $
+# $NetBSD: Makefile,v 1.42 2018/07/04 13:40:35 jperkin Exp $
 #
 
 DISTNAME=              prelude-lml-0.9.15
@@ -49,13 +49,13 @@ FILES_SUBST+=       PRELUDE_USER=${PRELUDE_USE
 FILES_SUBST+=  PRELUDE_GROUP=${PRELUDE_GROUP:Q}
 
 SUBST_CLASSES+=                code
-SUBST_STAGE.code=      post-patch
+SUBST_STAGE.code=      pre-configure
 SUBST_FILES.code=      run-prelude-lml.c
 SUBST_SED.code=                -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.code+=       -e 's,@PRELUDE_USER@,${PRELUDE_USER},g'
 
 SUBST_CLASSES+=                make
-SUBST_STAGE.make=      post-patch
+SUBST_STAGE.make=      pre-configure
 SUBST_FILES.make=      Makefile.in
 SUBST_SED.make=                -e 's,@EGDIR@,${EGDIR},g'
 

Index: pkgsrc/security/prelude-manager/Makefile
diff -u pkgsrc/security/prelude-manager/Makefile:1.46 pkgsrc/security/prelude-manager/Makefile:1.47
--- pkgsrc/security/prelude-manager/Makefile:1.46       Tue Apr 17 22:29:50 2018
+++ pkgsrc/security/prelude-manager/Makefile    Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.46 2018/04/17 22:29:50 wiz Exp $
+# $NetBSD: Makefile,v 1.47 2018/07/04 13:40:35 jperkin Exp $
 #
 
 DISTNAME=              prelude-manager-0.9.15
@@ -48,7 +48,7 @@ FILES_SUBST+=         PRELUDE_USER=${PRELUDE_US
 FILES_SUBST+=          PRELUDE_GROUP=${PRELUDE_USER:Q}
 
 SUBST_CLASSES+=                code
-SUBST_STAGE.code=      post-patch
+SUBST_STAGE.code=      pre-configure
 SUBST_FILES.code=      run-prelude-manager.c
 SUBST_SED.code=                -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.code+=       -e 's,@PRELUDE_USER@,${PRELUDE_USER},g'

Index: pkgsrc/security/prelude-pflogger/Makefile
diff -u pkgsrc/security/prelude-pflogger/Makefile:1.18 pkgsrc/security/prelude-pflogger/Makefile:1.19
--- pkgsrc/security/prelude-pflogger/Makefile:1.18      Tue Apr 17 22:29:51 2018
+++ pkgsrc/security/prelude-pflogger/Makefile   Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2018/04/17 22:29:51 wiz Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:35 jperkin Exp $
 #
 
 DISTNAME=      prelude-pflogger-0.9.0-rc2
@@ -43,13 +43,13 @@ MESSAGE_SUBST+=     PRELUDE_USER=${PRELUDE_U
 MESSAGE_SUBST+=        PRELUDE_GROUP=${PRELUDE_GROUP:Q}
 
 SUBST_CLASSES+=                code
-SUBST_STAGE.code=      post-patch
+SUBST_STAGE.code=      pre-configure
 SUBST_FILES.code=      run-prelude-pflogger.c
 SUBST_SED.code=                -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.code+=       -e 's,@PRELUDE_USER@,${PRELUDE_USER},g'
 
 SUBST_CLASSES+=         make
-SUBST_STAGE.make=       post-patch
+SUBST_STAGE.make=       pre-configure
 SUBST_FILES.make=       Makefile.am
 SUBST_SED.make=         -e 's,@EGDIR@,${EGDIR},g'
 

Index: pkgsrc/security/py-prewikka/Makefile
diff -u pkgsrc/security/py-prewikka/Makefile:1.47 pkgsrc/security/py-prewikka/Makefile:1.48
--- pkgsrc/security/py-prewikka/Makefile:1.47   Tue Jul  3 05:03:32 2018
+++ pkgsrc/security/py-prewikka/Makefile        Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.47 2018/07/03 05:03:32 adam Exp $
+# $NetBSD: Makefile,v 1.48 2018/07/04 13:40:35 jperkin Exp $
 
 DISTNAME=              prewikka-${VERSION}
 PKGNAME=               ${PYPKGPREFIX}-prewikka-${VERSION}
@@ -42,7 +42,7 @@ PKG_GROUPS_VARS+=     PREWIKKA_GROUP
 PKG_USERS_VARS+=       PREWIKKA_USER
 
 SUBST_CLASSES+=                code
-SUBST_STAGE.code=      post-patch
+SUBST_STAGE.code=      pre-configure
 SUBST_FILES.code=      runPrewikka.c
 SUBST_SED.code=                -e 's,@PREFIX@,${PREFIX},g'
 SUBST_SED.code+=       -e 's,@PREWIKKA_USER@,${PREWIKKA_USER},g'

Index: pkgsrc/security/py-requests-kerberos/Makefile
diff -u pkgsrc/security/py-requests-kerberos/Makefile:1.3 pkgsrc/security/py-requests-kerberos/Makefile:1.4
--- pkgsrc/security/py-requests-kerberos/Makefile:1.3   Wed May  2 10:59:49 2018
+++ pkgsrc/security/py-requests-kerberos/Makefile       Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/05/02 10:59:49 markd Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:35 jperkin Exp $
 
 DISTNAME=      requests-kerberos-0.12.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
@@ -18,7 +18,7 @@ DEPENDS+=     ${PYPKGPREFIX}-requests>=1.1.0
 USE_LANGUAGES= # none
 
 SUBST_CLASSES+=                requires
-SUBST_STAGE.requires=  post-patch
+SUBST_STAGE.requires=  pre-configure
 SUBST_FILES.requires=  setup.py
 SUBST_SED.requires=    -e 's/pykerberos/kerberos/'
 

Index: pkgsrc/security/qca2/Makefile.common
diff -u pkgsrc/security/qca2/Makefile.common:1.1 pkgsrc/security/qca2/Makefile.common:1.2
--- pkgsrc/security/qca2/Makefile.common:1.1    Wed Jan 31 09:14:55 2018
+++ pkgsrc/security/qca2/Makefile.common        Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.1 2018/01/31 09:14:55 markd Exp $
+# $NetBSD: Makefile.common,v 1.2 2018/07/04 13:40:36 jperkin Exp $
 
 DISTNAME=      qca-2.1.3
 CATEGORIES=    security
@@ -22,6 +22,6 @@ CMAKE_ARGS+=  -DOSX_FRAMEWORK=OFF
 CMAKE_ARGS+=   -DBUILD_TESTS=OFF
 
 SUBST_CLASSES+=                certs 
-SUBST_STAGE.certs=     post-patch
+SUBST_STAGE.certs=     pre-configure
 SUBST_FILES.certs=     CMakeLists.txt
 SUBST_VARS.certs=      PREFIX

Index: pkgsrc/security/qca2-gnupg/Makefile
diff -u pkgsrc/security/qca2-gnupg/Makefile:1.23 pkgsrc/security/qca2-gnupg/Makefile:1.24
--- pkgsrc/security/qca2-gnupg/Makefile:1.23    Mon Mar 12 11:17:30 2018
+++ pkgsrc/security/qca2-gnupg/Makefile Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2018/03/12 11:17:30 wiz Exp $
+# $NetBSD: Makefile,v 1.24 2018/07/04 13:40:35 jperkin Exp $
 
 PKGNAME=       qca2-gnupg-${DISTNAME:C/.*-//}
 PKGREVISION=   1
@@ -17,7 +17,7 @@ CMAKE_ARGS+=  -DBUILD_TOOLS=OFF
 CMAKE_ARGS+=   -DINST_QCA_LIB_NAME=-lqca
 
 SUBST_CLASSES+=                libname
-SUBST_STAGE.libname=   post-patch
+SUBST_STAGE.libname=   pre-configure
 SUBST_MESSAGE.libname= Use installed lib.
 SUBST_FILES.libname=   plugins/qca-gnupg/CMakeLists.txt
 SUBST_SED.libname=     -e 's:{QCA_LIB_NAME}:{INST_QCA_LIB_NAME}:'

Index: pkgsrc/security/qca2-ossl/Makefile
diff -u pkgsrc/security/qca2-ossl/Makefile:1.36 pkgsrc/security/qca2-ossl/Makefile:1.37
--- pkgsrc/security/qca2-ossl/Makefile:1.36     Mon Mar 12 11:17:30 2018
+++ pkgsrc/security/qca2-ossl/Makefile  Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.36 2018/03/12 11:17:30 wiz Exp $
+# $NetBSD: Makefile,v 1.37 2018/07/04 13:40:35 jperkin Exp $
 
 PKGNAME=       qca2-ossl-${DISTNAME:C/.*-//}
 PKGREVISION=   1
@@ -15,7 +15,7 @@ CMAKE_ARGS+=  -DBUILD_TOOLS=OFF
 CMAKE_ARGS+=   -DINST_QCA_LIB_NAME=-lqca
 
 SUBST_CLASSES+=                libname
-SUBST_STAGE.libname=   post-patch
+SUBST_STAGE.libname=   pre-configure
 SUBST_MESSAGE.libname= Use installed lib.
 SUBST_FILES.libname=   plugins/qca-ossl/CMakeLists.txt
 SUBST_SED.libname=     -e 's:{QCA_LIB_NAME}:{INST_QCA_LIB_NAME}:'

Index: pkgsrc/security/qca2-qt5-gnupg/Makefile
diff -u pkgsrc/security/qca2-qt5-gnupg/Makefile:1.3 pkgsrc/security/qca2-qt5-gnupg/Makefile:1.4
--- pkgsrc/security/qca2-qt5-gnupg/Makefile:1.3 Sat Apr 14 07:34:39 2018
+++ pkgsrc/security/qca2-qt5-gnupg/Makefile     Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/04/14 07:34:39 adam Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:35 jperkin Exp $
 
 PKGNAME=       qca2-qt5-gnupg-${DISTNAME:C/.*-//}
 PKGREVISION=   2
@@ -16,7 +16,7 @@ CMAKE_ARGS+=  -DBUILD_TOOLS=OFF
 CMAKE_ARGS+=   -DINST_QCA_LIB_NAME=-lqca-qt5
 
 SUBST_CLASSES+=                libname
-SUBST_STAGE.libname=   post-patch
+SUBST_STAGE.libname=   pre-configure
 SUBST_MESSAGE.libname= Use installed lib.
 SUBST_FILES.libname=   plugins/qca-gnupg/CMakeLists.txt
 SUBST_SED.libname=     -e 's:{QCA_LIB_NAME}:{INST_QCA_LIB_NAME}:'

Index: pkgsrc/security/qca2-qt5-ossl/Makefile
diff -u pkgsrc/security/qca2-qt5-ossl/Makefile:1.3 pkgsrc/security/qca2-qt5-ossl/Makefile:1.4
--- pkgsrc/security/qca2-qt5-ossl/Makefile:1.3  Sat Apr 14 07:34:40 2018
+++ pkgsrc/security/qca2-qt5-ossl/Makefile      Wed Jul  4 13:40:35 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2018/04/14 07:34:40 adam Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:35 jperkin Exp $
 
 PKGNAME=       qca2-qt5-ossl-${DISTNAME:C/.*-//}
 PKGREVISION=   2
@@ -14,7 +14,7 @@ CMAKE_ARGS+=  -DBUILD_TOOLS=OFF
 CMAKE_ARGS+=   -DINST_QCA_LIB_NAME=-lqca-qt5
 
 SUBST_CLASSES+=                libname
-SUBST_STAGE.libname=   post-patch
+SUBST_STAGE.libname=   pre-configure
 SUBST_MESSAGE.libname= Use installed lib.
 SUBST_FILES.libname=   plugins/qca-ossl/CMakeLists.txt
 SUBST_SED.libname=     -e 's:{QCA_LIB_NAME}:{INST_QCA_LIB_NAME}:'

Index: pkgsrc/security/skey/hacks.mk
diff -u pkgsrc/security/skey/hacks.mk:1.4 pkgsrc/security/skey/hacks.mk:1.5
--- pkgsrc/security/skey/hacks.mk:1.4   Sat Dec 13 12:07:54 2008
+++ pkgsrc/security/skey/hacks.mk       Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: hacks.mk,v 1.4 2008/12/13 12:07:54 obache Exp $
+# $NetBSD: hacks.mk,v 1.5 2018/07/04 13:40:36 jperkin Exp $
 
 .if !defined(SKEY_HACKS_MK)
 SKEY_HACKS_MK= # defined
@@ -11,7 +11,7 @@ PKG_HACKS+=           enforce-troff-style-man-pag
 CONFIGURE_ARGS+=       --with-catman=man
 SUBST_CLASSES+=                tsmp
 SUBST_MESSAGE.tsmp=    enforce use of troff style man pages
-SUBST_STAGE.tsmp=      post-patch
+SUBST_STAGE.tsmp=      pre-configure
 SUBST_FILES.tsmp=      configure
 SUBST_SED.tsmp=                -e 's,$$(CATMAN),$$(TROFFMAN),g'
 
@@ -22,7 +22,7 @@ SUBST_SED.tsmp=               -e 's,$$(CATMAN),$$(TRO
 PKG_HACKS+=            use-sginap-instead-of-usleep
 SUBST_CLASSES+=                sginap
 SUBST_MESSAGE.sginap=  use sginap() instead of usleep()
-SUBST_STAGE.sginap=    post-patch
+SUBST_STAGE.sginap=    pre-configure
 SUBST_FILES.sginap=    skeyinit.c skeylogin.c
 SUBST_SED.sginap=      -e 's,usleep(100000),sginap(CLK_TCK/10),g'
 .endif

Index: pkgsrc/security/snortsnarf/Makefile
diff -u pkgsrc/security/snortsnarf/Makefile:1.25 pkgsrc/security/snortsnarf/Makefile:1.26
--- pkgsrc/security/snortsnarf/Makefile:1.25    Tue Aug  1 14:59:05 2017
+++ pkgsrc/security/snortsnarf/Makefile Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2017/08/01 14:59:05 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:36 jperkin Exp $
 #
 
 DISTNAME=      SnortSnarf-050314.1
@@ -20,7 +20,7 @@ REPLACE_PERL= snortsnarf.pl include/ann_
                include/xml_help.pl
 
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     snortsnarf.pl
 SUBST_SED.paths=       -e "s|./include|${PREFIX}/share/snortsnarf|g"
 SUBST_MESSAGE.paths=   Fixing paths.

Index: pkgsrc/security/softhsm/Makefile
diff -u pkgsrc/security/softhsm/Makefile:1.38 pkgsrc/security/softhsm/Makefile:1.39
--- pkgsrc/security/softhsm/Makefile:1.38       Sat Apr 14 07:34:01 2018
+++ pkgsrc/security/softhsm/Makefile    Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2018/04/14 07:34:01 adam Exp $
+# $NetBSD: Makefile,v 1.39 2018/07/04 13:40:36 jperkin Exp $
 #
 
 DISTNAME=      softhsm-1.3.7
@@ -24,7 +24,7 @@ EGDIR=                        ${PREFIX}/share/examples/sofths
 
 SUBST_CLASSES+=         paths
 SUBST_FILES.paths=      ${WRKSRC}/Makefile.in
-SUBST_STAGE.paths=      post-patch
+SUBST_STAGE.paths=      pre-configure
 SUBST_SED.paths=        -e 's,@EGDIR@,${EGDIR},'
 
 CXXFLAGS.NetBSD+=      -D_NETBSD_SOURCE

Index: pkgsrc/security/uvscan/Makefile
diff -u pkgsrc/security/uvscan/Makefile:1.49 pkgsrc/security/uvscan/Makefile:1.50
--- pkgsrc/security/uvscan/Makefile:1.49        Fri Mar  6 23:22:25 2015
+++ pkgsrc/security/uvscan/Makefile     Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.49 2015/03/06 23:22:25 tnn Exp $
+# $NetBSD: Makefile,v 1.50 2018/07/04 13:40:36 jperkin Exp $
 
 # See here for new version: http://www.mcafee.com/apps/downloads/free-evaluations/default.aspx?pc=aaad13320&plat=linux&pid=&eid=&ilv=LatestVersions&sz=25&pg=1&segment=false&region=us
 BROKEN=                        distfile is gone, package must be updated to version 6.0.4
@@ -51,7 +51,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     update_dat.sh uvscan.sh
 SUBST_VARS.paths=      AWK BASENAME CP DATFILES ECHO GTAR MKDIR MV     \
                        PREFIX RM SED UVSCANDIR
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 post-extract:
        ${CP} ${FILESDIR}/update_dat.sh ${WRKSRC}/update_dat.sh

Index: pkgsrc/shells/lshell/Makefile
diff -u pkgsrc/shells/lshell/Makefile:1.18 pkgsrc/shells/lshell/Makefile:1.19
--- pkgsrc/shells/lshell/Makefile:1.18  Tue Jul  3 05:03:33 2018
+++ pkgsrc/shells/lshell/Makefile       Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2018/07/03 05:03:33 adam Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:36 jperkin Exp $
 
 DISTNAME=      lshell-0.9.16
 CATEGORIES=    shells python
@@ -22,7 +22,7 @@ PYTHON_VERSIONS_INCOMPATIBLE= 34 35 36 3
 EGDIR=                 share/examples/lshell
 
 SUBST_CLASSES+=                setup
-SUBST_STAGE.setup=     post-patch
+SUBST_STAGE.setup=     pre-configure
 SUBST_FILES.setup=     setup.py
 SUBST_SED.setup=       -e 's,/etc,${EGDIR},'
 SUBST_SED.setup+=      -e 's,share/man,${PKGMANDIR},'

Index: pkgsrc/shells/xonsh/Makefile
diff -u pkgsrc/shells/xonsh/Makefile:1.1 pkgsrc/shells/xonsh/Makefile:1.2
--- pkgsrc/shells/xonsh/Makefile:1.1    Sun Aug 21 11:34:57 2016
+++ pkgsrc/shells/xonsh/Makefile        Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2016/08/21 11:34:57 kamil Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:36 jperkin Exp $
 
 DISTNAME=      xonsh-0.4.5
 CATEGORIES=    shells python
@@ -21,7 +21,7 @@ PKG_SHELL=    ${PREFIX}/bin/xon.sh
 PKG_SHELL+=    ${PREFIX}/bin/xonsh
 
 SUBST_CLASSES+=                xonsh
-SUBST_STAGE.xonsh=     post-patch
+SUBST_STAGE.xonsh=     pre-configure
 SUBST_FILES.xonsh=     scripts/xon.sh
 SUBST_SED.xonsh=       -e 's,python3,${PYTHONBIN},'
 

Index: pkgsrc/sysutils/accountsservice/Makefile
diff -u pkgsrc/sysutils/accountsservice/Makefile:1.2 pkgsrc/sysutils/accountsservice/Makefile:1.3
--- pkgsrc/sysutils/accountsservice/Makefile:1.2        Tue Jun 26 09:54:30 2018
+++ pkgsrc/sysutils/accountsservice/Makefile    Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2018/06/26 09:54:30 jperkin Exp $
+# $NetBSD: Makefile,v 1.3 2018/07/04 13:40:36 jperkin Exp $
 
 DISTNAME=      accountsservice-0.6.42
 CATEGORIES=    sysutils
@@ -35,7 +35,7 @@ CONF_FILES+=  ${EGDIR}/dbus-1/system.d/or
 
 SUBST_CLASSES+=                gdm
 SUBST_FILES.gdm=       src/daemon.c
-SUBST_STAGE.gdm=       post-patch
+SUBST_STAGE.gdm=       pre-configure
 SUBST_SED.gdm=         -e 's,/etc/gdm/custom.conf,${PKG_SYSCONFDIR}/gdm/custom.conf,g'
 
 BUILD_DEPENDS+=        gdbus-codegen-[0-9]*:../../devel/gdbus-codegen

Index: pkgsrc/sysutils/amanda-common/Makefile.common
diff -u pkgsrc/sysutils/amanda-common/Makefile.common:1.42 pkgsrc/sysutils/amanda-common/Makefile.common:1.43
--- pkgsrc/sysutils/amanda-common/Makefile.common:1.42  Mon Feb 29 05:50:40 2016
+++ pkgsrc/sysutils/amanda-common/Makefile.common       Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.42 2016/02/29 05:50:40 mlelstv Exp $
+# $NetBSD: Makefile.common,v 1.43 2018/07/04 13:40:36 jperkin Exp $
 
 # used by sysutils/amanda-common/Makefile
 # used by sysutils/amanda-client/Makefile
@@ -54,7 +54,7 @@ AUTO_MKDIRS=          yes
 
 SUBST_CLASSES+=                bool
 SUBST_MESSAGE.bool=    Fix SWIG messing with stdbool.h.
-SUBST_STAGE.bool=      post-patch
+SUBST_STAGE.bool=      pre-configure
 SUBST_FILES.bool=      perl/Amanda/*.c perl/Amanda/*/*.c
 SUBST_SED.bool=        -e '/undef bool/d'
 

Index: pkgsrc/sysutils/bcmfw/Makefile
diff -u pkgsrc/sysutils/bcmfw/Makefile:1.12 pkgsrc/sysutils/bcmfw/Makefile:1.13
--- pkgsrc/sysutils/bcmfw/Makefile:1.12 Thu Dec 21 10:36:44 2017
+++ pkgsrc/sysutils/bcmfw/Makefile      Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2017/12/21 10:36:44 plunky Exp $
+# $NetBSD: Makefile,v 1.13 2018/07/04 13:40:36 jperkin Exp $
 
 DISTNAME=              bcmfw-2.2
 CATEGORIES=            sysutils
@@ -33,7 +33,7 @@ PLIST_SUBST+=         FIRMWARE_DIR=${FIRMWARE_D
 SUBST_CLASSES+=                dir
 SUBST_FILES.dir=       bcmfw.8
 SUBST_SED.dir=         -e 's,/libdata/bcmfw,${PREFIX}/${FIRMWARE_DIR}&,'
-SUBST_STAGE.dir=       post-patch
+SUBST_STAGE.dir=       pre-configure
 SUBST_MESSAGE.dir=     Fixing path to firmware directory.
 
 USE_BSD_MAKEFILE=      yes

Index: pkgsrc/sysutils/cdrtools/Makefile
diff -u pkgsrc/sysutils/cdrtools/Makefile:1.116 pkgsrc/sysutils/cdrtools/Makefile:1.117
--- pkgsrc/sysutils/cdrtools/Makefile:1.116     Sun Apr 22 17:57:47 2018
+++ pkgsrc/sysutils/cdrtools/Makefile   Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.116 2018/04/22 17:57:47 tron Exp $
+# $NetBSD: Makefile,v 1.117 2018/07/04 13:40:36 jperkin Exp $
 
 DISTNAME=      cdrtools-3.01
 PKGNAME=       ${DISTNAME:S/a/alpha/:S/-pre/pre/}
@@ -79,7 +79,7 @@ INSTALLATION_DIRS=    bin lib/siconv ${PKGM
                        share/examples/cdrtools
 
 SUBST_CLASSES+=                fix
-SUBST_STAGE.fix=       post-patch
+SUBST_STAGE.fix=       pre-configure
 SUBST_FILES.fix=       btcflash/btcflash.1
 SUBST_FILES.fix+=      cdrecord/cdrecord.1
 SUBST_FILES.fix+=      libcdrdeflt/cdrdeflt.c
@@ -89,7 +89,7 @@ SUBST_SED.fix=                -e "s,/etc/default/cdrec
 SUBST_MESSAGE.fix=     Fixing paths.
 
 SUBST_CLASSES+=                oss
-SUBST_STAGE.oss=       post-patch
+SUBST_STAGE.oss=       pre-configure
 SUBST_FILES.oss=       cdda2wav/local.cnf.in
 SUBST_SED.oss=         -e "s,/dev/dsp,${DEVOSSSOUND},g"
 SUBST_MESSAGE.oss=     Fixing OSS sound device path.

Index: pkgsrc/sysutils/dbus-sharp/Makefile
diff -u pkgsrc/sysutils/dbus-sharp/Makefile:1.17 pkgsrc/sysutils/dbus-sharp/Makefile:1.18
--- pkgsrc/sysutils/dbus-sharp/Makefile:1.17    Sat Apr 14 07:34:02 2018
+++ pkgsrc/sysutils/dbus-sharp/Makefile Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2018/04/14 07:34:02 adam Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:37 jperkin Exp $
 #
 
 DISTNAME=      dbus-sharp-0.7.0
@@ -18,7 +18,7 @@ USE_LANGUAGES=        # none
 PKGCONFIG_OVERRIDE+=   dbus-sharp-1.0.pc.in
 
 SUBST_CLASSES+=         fix-mcs
-SUBST_STAGE.fix-mcs=    post-patch
+SUBST_STAGE.fix-mcs=    pre-configure
 SUBST_MESSAGE.fix-mcs=  Fix compiler name
 SUBST_FILES.fix-mcs=    configure
 SUBST_SED.fix-mcs=      -e 's,gmcs,mcs,'

Index: pkgsrc/sysutils/dbus-sharp-glib/Makefile
diff -u pkgsrc/sysutils/dbus-sharp-glib/Makefile:1.15 pkgsrc/sysutils/dbus-sharp-glib/Makefile:1.16
--- pkgsrc/sysutils/dbus-sharp-glib/Makefile:1.15       Sat Apr 14 07:34:02 2018
+++ pkgsrc/sysutils/dbus-sharp-glib/Makefile    Wed Jul  4 13:40:36 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2018/04/14 07:34:02 adam Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:36 jperkin Exp $
 #
 
 DISTNAME=      dbus-sharp-glib-0.5.0
@@ -18,7 +18,7 @@ USE_TOOLS+=   gmake pkg-config
 PKGCONFIG_OVERRIDE+=   dbus-sharp-glib-1.0.pc.in
 
 SUBST_CLASSES+=         fix-mcs
-SUBST_STAGE.fix-mcs=    post-patch
+SUBST_STAGE.fix-mcs=    pre-configure
 SUBST_MESSAGE.fix-mcs=  Fix compiler name
 SUBST_FILES.fix-mcs=    configure
 SUBST_SED.fix-mcs=      -e 's,gmcs,mcs,'

Index: pkgsrc/sysutils/dc-tools/Makefile
diff -u pkgsrc/sysutils/dc-tools/Makefile:1.14 pkgsrc/sysutils/dc-tools/Makefile:1.15
--- pkgsrc/sysutils/dc-tools/Makefile:1.14      Thu Jan 19 18:52:25 2017
+++ pkgsrc/sysutils/dc-tools/Makefile   Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2017/01/19 18:52:25 agc Exp $
+# $NetBSD: Makefile,v 1.15 2018/07/04 13:40:37 jperkin Exp $
 
 DISTNAME=      dc-tools-1.6
 CATEGORIES=    sysutils
@@ -28,7 +28,7 @@ EXTRACT_CMD=  ${CP} ${DISTDIR}/${DIST_SUB
        ${TAR} -xzf ${DISTDIR}/${DIST_SUBDIR}/serial_slave.tar.gz -C serial
 
 SUBST_CLASSES+=                IP_TMPL
-SUBST_STAGE.IP_TMPL=   post-patch
+SUBST_STAGE.IP_TMPL=   pre-configure
 SUBST_FILES.IP_TMPL=   makeip.c
 SUBST_SED.IP_TMPL=     -e "s|"IP.TMPL"|"${PREFIX}/share/dc-tools/IP.TMPL"|"
 SUBST_MESSAGE.IP_TMPL= Update path to IP.TMPL

Index: pkgsrc/sysutils/e2fsprogs/Makefile
diff -u pkgsrc/sysutils/e2fsprogs/Makefile:1.26 pkgsrc/sysutils/e2fsprogs/Makefile:1.27
--- pkgsrc/sysutils/e2fsprogs/Makefile:1.26     Fri Dec  8 08:12:58 2017
+++ pkgsrc/sysutils/e2fsprogs/Makefile  Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2017/12/08 08:12:58 adam Exp $
+# $NetBSD: Makefile,v 1.27 2018/07/04 13:40:37 jperkin Exp $
 
 DISTNAME=      e2fsprogs-1.43.7
 CATEGORIES=    sysutils
@@ -40,7 +40,7 @@ INSTALL_MAKE_FLAGS=   ${MAKE_FLAGS} root_s
 
 SUBST_CLASSES+=                man
 SUBST_MESSAGE.man=     Give correct path for man page
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_FILES.man+=      misc/mke2fs.8.in
 SUBST_FILES.man+=      misc/mke2fs.conf.5.in
 SUBST_FILES.man+=      e2fsck/e2fsck.conf.5.in

Index: pkgsrc/sysutils/gkrellm/Makefile
diff -u pkgsrc/sysutils/gkrellm/Makefile:1.92 pkgsrc/sysutils/gkrellm/Makefile:1.93
--- pkgsrc/sysutils/gkrellm/Makefile:1.92       Tue Apr 17 22:29:51 2018
+++ pkgsrc/sysutils/gkrellm/Makefile    Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.92 2018/04/17 22:29:51 wiz Exp $
+# $NetBSD: Makefile,v 1.93 2018/07/04 13:40:37 jperkin Exp $
 .include "Makefile.common"
 
 PKGREVISION=           33
@@ -34,7 +34,7 @@ MAKE_FLAGS+=          BINOWNER=${BINOWN} BINGROU
 INSTALL_MAKE_FLAGS+=   MANDIR=${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
 INSTALL_MAKE_FLAGS+=   SMANDIR=${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
 
-SUBST_STAGE.gkprefix=  post-patch
+SUBST_STAGE.gkprefix=  pre-configure
 SUBST_FILES.gkprefix=  src/gkrellm.h
 SUBST_SED.gkprefix=    -e '/SYSTEM_/{s!/usr!${PREFIX}!;}'
 SUBST_CLASSES+=                gkprefix

Index: pkgsrc/sysutils/gkrellm-server/Makefile
diff -u pkgsrc/sysutils/gkrellm-server/Makefile:1.32 pkgsrc/sysutils/gkrellm-server/Makefile:1.33
--- pkgsrc/sysutils/gkrellm-server/Makefile:1.32        Sun Feb 16 00:45:28 2014
+++ pkgsrc/sysutils/gkrellm-server/Makefile     Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2014/02/16 00:45:28 wiedi Exp $
+# $NetBSD: Makefile,v 1.33 2018/07/04 13:40:37 jperkin Exp $
 
 .include "../../sysutils/gkrellm/Makefile.common"
 
@@ -32,7 +32,7 @@ PKG_SUPPORTED_OPTIONS=        glib1
 .include "../../mk/bsd.options.mk"
 
 SUBST_CLASSES+=                gkprefix
-SUBST_STAGE.gkprefix=  post-patch
+SUBST_STAGE.gkprefix=  pre-configure
 SUBST_FILES.gkprefix=  server/gkrellmd.h
 SUBST_SED.gkprefix=    -e '/GKRELLMD_SYS_ETC/{s!/etc!${PKG_SYSCONFDIR}!;}'
 

Index: pkgsrc/sysutils/gnometoaster/Makefile
diff -u pkgsrc/sysutils/gnometoaster/Makefile:1.28 pkgsrc/sysutils/gnometoaster/Makefile:1.29
--- pkgsrc/sysutils/gnometoaster/Makefile:1.28  Wed Aug 16 20:45:45 2017
+++ pkgsrc/sysutils/gnometoaster/Makefile       Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2017/08/16 20:45:45 wiz Exp $
+# $NetBSD: Makefile,v 1.29 2018/07/04 13:40:37 jperkin Exp $
 #
 
 DISTNAME=      gtoaster1.0Beta5
@@ -24,7 +24,7 @@ LDFLAGS.DragonFly=    -lintl
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     audio_oss.c
 SUBST_SED.paths+=      -e 's,@DEVOSSAUDIO@,${DEVOSSAUDIO},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 .include "../../x11/gtk/buildlink3.mk"
 .include "../../mk/oss.buildlink3.mk"

Index: pkgsrc/sysutils/grub/Makefile
diff -u pkgsrc/sysutils/grub/Makefile:1.57 pkgsrc/sysutils/grub/Makefile:1.58
--- pkgsrc/sysutils/grub/Makefile:1.57  Tue Aug 18 07:31:17 2015
+++ pkgsrc/sysutils/grub/Makefile       Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2015/08/18 07:31:17 wiz Exp $
+# $NetBSD: Makefile,v 1.58 2018/07/04 13:40:37 jperkin Exp $
 
 DISTNAME=      grub-0.97
 PKGREVISION=   10
@@ -60,7 +60,7 @@ CONFIGURE_ARGS+=      ${GRUB_SCAN_ARGS}
 .endif
 
 SUBST_CLASSES+=                grubterm
-SUBST_STAGE.grubterm=  post-patch
+SUBST_STAGE.grubterm=  pre-configure
 SUBST_MESSAGE.grubterm=        Changing references to <term.h> to <grubterm.h>
 SUBST_FILES.grubterm=  grub/*.c stage2/Makefile.in stage2/*.c
 SUBST_SED.grubterm=    -e "s,<term.h>,<grubterm.h>,g"

Index: pkgsrc/sysutils/grub2/Makefile
diff -u pkgsrc/sysutils/grub2/Makefile:1.13 pkgsrc/sysutils/grub2/Makefile:1.14
--- pkgsrc/sysutils/grub2/Makefile:1.13 Wed May 23 10:45:54 2018
+++ pkgsrc/sysutils/grub2/Makefile      Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2018/05/23 10:45:54 maya Exp $
+# $NetBSD: Makefile,v 1.14 2018/07/04 13:40:37 jperkin Exp $
 
 DISTNAME=              grub-2.02
 PKGNAME=               ${DISTNAME:S/grub/grub2/}
@@ -102,7 +102,7 @@ do-install-custom-config:
 # Force installation of all OS configuration scripts in ${EGDIR}.
 #
 SUBST_CLASSES+=                        fix-os-conf
-SUBST_STAGE.fix-os-conf=       post-patch
+SUBST_STAGE.fix-os-conf=       pre-configure
 SUBST_MESSAGE.fix-os-conf=     Fixing installation of OS configuration scripts.
 SUBST_FILES.fix-os-conf=       Makefile.in
 SUBST_SED.fix-os-conf=         -e 's,^@COND_HOST_[A-Z]*_TRUE@,,g'
@@ -111,7 +111,7 @@ SUBST_SED.fix-os-conf=              -e 's,^@COND_HOS
 # Adjust the configuration paths in scripts.
 #
 SUBST_CLASSES+=                        fix-paths-1
-SUBST_STAGE.fix-paths-1=       post-patch
+SUBST_STAGE.fix-paths-1=       pre-configure
 SUBST_MESSAGE.fix-paths-1=     Fixing configuration paths in scripts.
 SUBST_FILES.fix-paths-1=       util/grub-install.in util/grub-mkconfig.in
 SUBST_SED.fix-paths-1=         -e 's,\(\$${sysconfdir}"\{0\,1\}\)/grub.d,\1,g'
@@ -130,7 +130,7 @@ SUBST_SED.fix-dejavu=               -e 's, \(/usr/sha
 # Do not use `\t' with sed, as it's not portable.
 #
 SUBST_CLASSES+=                        fix-sed-tabs
-SUBST_STAGE.fix-sed-tabs=      post-patch
+SUBST_STAGE.fix-sed-tabs=      pre-configure
 SUBST_MESSAGE.fix-sed-tabs=    Fixing tabulations for sed in scripts.
 SUBST_FILES.fix-sed-tabs=      util/grub.d/*.in
 SUBST_SED.fix-sed-tabs=                -e 's,\\t,      ,g'

Index: pkgsrc/sysutils/k3b/Makefile
diff -u pkgsrc/sysutils/k3b/Makefile:1.94 pkgsrc/sysutils/k3b/Makefile:1.95
--- pkgsrc/sysutils/k3b/Makefile:1.94   Sun Apr 29 21:32:03 2018
+++ pkgsrc/sysutils/k3b/Makefile        Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.94 2018/04/29 21:32:03 adam Exp $
+# $NetBSD: Makefile,v 1.95 2018/07/04 13:40:37 jperkin Exp $
 
 DISTNAME=              k3b-2.0.3a
 PKGREVISION=           18
@@ -25,7 +25,7 @@ CONF_FILES=           ${PREFIX}/share/examples/kd
 ONLY_FOR_PLATFORM=     FreeBSD-*-* Linux-*-* NetBSD-*-* DragonFly-*-*
 
 SUBST_CLASSES+=                pathfix
-SUBST_STAGE.pathfix=   post-patch
+SUBST_STAGE.pathfix=   pre-configure
 SUBST_MESSAGE.pathfix= Add cdrtools path.
 SUBST_FILES.pathfix=   libk3b/core/k3bexternalbinmanager.cpp
 SUBST_SED.pathfix=     -e 's:"/usr/bin/":"${LOCALBASE}/bin", "/usr/bin/":g'

Index: pkgsrc/sysutils/mc46/Makefile
diff -u pkgsrc/sysutils/mc46/Makefile:1.20 pkgsrc/sysutils/mc46/Makefile:1.21
--- pkgsrc/sysutils/mc46/Makefile:1.20  Thu Mar 22 08:14:52 2018
+++ pkgsrc/sysutils/mc46/Makefile       Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2018/03/22 08:14:52 adam Exp $
+# $NetBSD: Makefile,v 1.21 2018/07/04 13:40:37 jperkin Exp $
 
 DISTNAME=      mc-4.6.1
 PKGREVISION=   21
@@ -30,7 +30,7 @@ PLIST_SRC+=           ${PKGDIR}/PLIST
 
 PKG_SYSCONFSUBDIR=     mc
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      vfs/extfs.c vfs/sfs.c
 SUBST_VARS.conf=       PKG_SYSCONFDIR
 

Index: pkgsrc/sysutils/mcollective/Makefile
diff -u pkgsrc/sysutils/mcollective/Makefile:1.3 pkgsrc/sysutils/mcollective/Makefile:1.4
--- pkgsrc/sysutils/mcollective/Makefile:1.3    Mon Aug  7 09:42:32 2017
+++ pkgsrc/sysutils/mcollective/Makefile        Wed Jul  4 13:40:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2017/08/07 09:42:32 jlam Exp $
+# $NetBSD: Makefile,v 1.4 2018/07/04 13:40:37 jperkin Exp $
 #
 
 DISTNAME=      mcollective-2.1.1
@@ -45,13 +45,13 @@ SUBST_FILES.confpath=       ${WRKSRC}/bin/mcol
                        ${WRKSRC}/lib/mcollective/util.rb       \
                        ${WRKSRC}/lib/mcollective/rpc.rb
 SUBST_SED.confpath=    -e "s,/etc/mcollective,${PKG_SYSCONFDIR},"
-SUBST_STAGE.confpath=  post-patch
+SUBST_STAGE.confpath=  pre-configure
 
 SUBST_CLASSES+=                sharepath
 SUBST_FILES.sharepath= ${WRKSRC}/etc/server.cfg.dist           \
                        ${WRKSRC}/etc/client.cfg.dist
 SUBST_SED.sharepath=   -e "s,/usr/libexec/mcollective,${PREFIX}/share,"
-SUBST_STAGE.sharepath= post-patch
+SUBST_STAGE.sharepath= pre-configure
 
 do-install:
        ${INSTALL_SCRIPT} ${WRKSRC}/bin/mcollectived ${DESTDIR}${PREFIX}/sbin

Index: pkgsrc/sysutils/memtestplus/options.mk
diff -u pkgsrc/sysutils/memtestplus/options.mk:1.6 pkgsrc/sysutils/memtestplus/options.mk:1.7
--- pkgsrc/sysutils/memtestplus/options.mk:1.6  Wed Jun  4 16:07:34 2014
+++ pkgsrc/sysutils/memtestplus/options.mk      Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.6 2014/06/04 16:07:34 gdt Exp $
+# $NetBSD: options.mk,v 1.7 2018/07/04 13:40:38 jperkin Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.memtestplus
 PKG_SUPPORTED_OPTIONS= iso serialconsole
@@ -15,7 +15,7 @@ PLIST.iso=            yes
 
 .if !empty(PKG_OPTIONS:Mserialconsole)
 SUBST_CLASSES+=                serialopt
-SUBST_STAGE.serialopt= post-patch
+SUBST_STAGE.serialopt= pre-configure
 SUBST_MESSAGE.serialopt=       Setting serial console option
 SUBST_FILES.serialopt= config.h
 SUBST_SED.serialopt=   -e '/define.*SERIAL_CONSOLE_DEFAULT/s/0/1/'

Index: pkgsrc/sysutils/ndesk-dbus/Makefile
diff -u pkgsrc/sysutils/ndesk-dbus/Makefile:1.27 pkgsrc/sysutils/ndesk-dbus/Makefile:1.28
--- pkgsrc/sysutils/ndesk-dbus/Makefile:1.27    Sat Apr 14 07:34:41 2018
+++ pkgsrc/sysutils/ndesk-dbus/Makefile Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2018/04/14 07:34:41 adam Exp $
+# $NetBSD: Makefile,v 1.28 2018/07/04 13:40:38 jperkin Exp $
 
 DISTNAME=      ndesk-dbus-0.6.1a
 PKGREVISION=   22
@@ -17,7 +17,7 @@ DEPENDS+=     dbus>=1.0:../../sysutils/dbus
 PKGCONFIG_OVERRIDE+=   ndesk-dbus-1.0.pc.in
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/sysutils/ndesk-dbus-glib/Makefile
diff -u pkgsrc/sysutils/ndesk-dbus-glib/Makefile:1.27 pkgsrc/sysutils/ndesk-dbus-glib/Makefile:1.28
--- pkgsrc/sysutils/ndesk-dbus-glib/Makefile:1.27       Sat Apr 14 07:34:02 2018
+++ pkgsrc/sysutils/ndesk-dbus-glib/Makefile    Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2018/04/14 07:34:02 adam Exp $
+# $NetBSD: Makefile,v 1.28 2018/07/04 13:40:38 jperkin Exp $
 
 DISTNAME=      ndesk-dbus-glib-0.4.1
 PKGREVISION=   23
@@ -15,7 +15,7 @@ USE_TOOLS+=   pkg-config gmake
 PKGCONFIG_OVERRIDE+=   ndesk-dbus-glib-1.0.pc.in
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/sysutils/pfstat/Makefile
diff -u pkgsrc/sysutils/pfstat/Makefile:1.31 pkgsrc/sysutils/pfstat/Makefile:1.32
--- pkgsrc/sysutils/pfstat/Makefile:1.31        Mon Mar 12 11:17:37 2018
+++ pkgsrc/sysutils/pfstat/Makefile     Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2018/03/12 11:17:37 wiz Exp $
+# $NetBSD: Makefile,v 1.32 2018/07/04 13:40:38 jperkin Exp $
 
 DISTNAME=      pfstat-2.5
 PKGREVISION=   11
@@ -18,7 +18,7 @@ MAKE_ENV+=    PF_VERSION=${PF_VERSION:S/.//
 INSTALLATION_DIRS=     bin ${PKGMANDIR}/man8 ${PKGMANDIR}/cat8 share/examples/pfstat
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      pfstat.8 pfstat.c pfstat.conf.example
 SUBST_SED.conf=                -e "s|/etc/pfstat.conf|${PKG_SYSCONFDIR}/pfstat.conf|g"
 SUBST_MESSAGE.conf=    Fixing configuration file paths.

Index: pkgsrc/sysutils/polysh/Makefile
diff -u pkgsrc/sysutils/polysh/Makefile:1.8 pkgsrc/sysutils/polysh/Makefile:1.9
--- pkgsrc/sysutils/polysh/Makefile:1.8 Tue Jul  3 05:03:34 2018
+++ pkgsrc/sysutils/polysh/Makefile     Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2018/07/03 05:03:34 adam Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:38 jperkin Exp $
 
 DISTNAME=      polysh-0.4
 PKGREVISION=   1
@@ -17,7 +17,7 @@ PYTHON_VERSIONS_INCOMPATIBLE= 34 35 36 3
 REPLACE_PYTHON=        polysh/rb_tree.py
 
 SUBST_CLASSES+=                setup
-SUBST_STAGE.setup=     post-patch
+SUBST_STAGE.setup=     pre-configure
 SUBST_FILES.setup=     setup.py
 SUBST_SED.setup+=      -e 's,share/man,${PKGMANDIR},'
 

Index: pkgsrc/sysutils/puppet/Makefile
diff -u pkgsrc/sysutils/puppet/Makefile:1.35 pkgsrc/sysutils/puppet/Makefile:1.36
--- pkgsrc/sysutils/puppet/Makefile:1.35        Fri Mar 23 14:31:46 2018
+++ pkgsrc/sysutils/puppet/Makefile     Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2018/03/23 14:31:46 taca Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:38 jperkin Exp $
 
 DISTNAME=              puppet-5.5.0
 CATEGORIES=            sysutils
@@ -20,7 +20,7 @@ PKG_SYSCONFSUBDIR=    puppet
 RCD_SCRIPTS=           puppetd puppetmasterd
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    install.rb
 SUBST_FILES.prefix+=   lib/puppet/face/module/changes.rb
 SUBST_FILES.prefix+=   lib/puppet/face/module/install.rb

Index: pkgsrc/sysutils/py-euca2ools/Makefile
diff -u pkgsrc/sysutils/py-euca2ools/Makefile:1.1 pkgsrc/sysutils/py-euca2ools/Makefile:1.2
--- pkgsrc/sysutils/py-euca2ools/Makefile:1.1   Sat Apr 14 13:57:30 2018
+++ pkgsrc/sysutils/py-euca2ools/Makefile       Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2018/04/14 13:57:30 adam Exp $
+# $NetBSD: Makefile,v 1.2 2018/07/04 13:40:38 jperkin Exp $
 
 DISTNAME=      euca2ools-3.4.1
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
@@ -25,7 +25,7 @@ PYTHON_VERSIONS_ACCEPTED=     27
 EGG_NAME=      ${DISTNAME:C/-([^0-9])/_\1/g:S/.1$/_devel/}
 
 SUBST_CLASSES+=                setup
-SUBST_STAGE.setup=     post-patch
+SUBST_STAGE.setup=     pre-configure
 SUBST_MESSAGE.setup=   Fixing setup.
 SUBST_FILES.setup=     setup.py
 SUBST_SED.setup=       -e 's,share/man,${PKGMANDIR},g'

Index: pkgsrc/sysutils/rdiff-backup/Makefile
diff -u pkgsrc/sysutils/rdiff-backup/Makefile:1.53 pkgsrc/sysutils/rdiff-backup/Makefile:1.54
--- pkgsrc/sysutils/rdiff-backup/Makefile:1.53  Tue Jul  3 05:03:34 2018
+++ pkgsrc/sysutils/rdiff-backup/Makefile       Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2018/07/03 05:03:34 adam Exp $
+# $NetBSD: Makefile,v 1.54 2018/07/04 13:40:38 jperkin Exp $
 
 DISTNAME=      rdiff-backup-1.2.8
 PKGREVISION=   8
@@ -12,7 +12,7 @@ COMMENT=      Remote incremental backup utili
 PYTHON_VERSIONS_INCOMPATIBLE=  34 35 36 37 # not yet ported as of 1.2.8
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      setup.py
 SUBST_SED.path=                -e "s|share/man|${PKGMANDIR}|"
 SUBST_MESSAGE.path=    Fixing path to manpages.

Index: pkgsrc/sysutils/rox/Makefile
diff -u pkgsrc/sysutils/rox/Makefile:1.86 pkgsrc/sysutils/rox/Makefile:1.87
--- pkgsrc/sysutils/rox/Makefile:1.86   Mon Apr 16 14:35:13 2018
+++ pkgsrc/sysutils/rox/Makefile        Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.86 2018/04/16 14:35:13 wiz Exp $
+# $NetBSD: Makefile,v 1.87 2018/07/04 13:40:38 jperkin Exp $
 #
 
 DISTNAME=      rox-filer-2.10
@@ -26,7 +26,7 @@ INSTALLATION_DIRS=    bin libexec/rox ${PKG
 
 SUBST_CLASSES+=                path
 SUBST_MESSAGE.path=    Fixing hardcoded paths.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      ROX-Filer/AppRun
 SUBST_FILES.path+=     ROX-Filer/src/choices.c
 SUBST_FILES.path+=     ROX-Filer/src/type.c
@@ -35,7 +35,7 @@ SUBST_SED.path=               -e 's,/usr/local,${PREF
 
 SUBST_CLASSES+=                bin
 SUBST_MESSAGE.bin=     Fixing binary path.
-SUBST_STAGE.bin=       post-patch
+SUBST_STAGE.bin=       pre-configure
 SUBST_FILES.bin=       ROX-Filer/AppRun
 SUBST_SED.bin=         -e 's,BIN="$$APP_DIR,BIN="${PREFIX}/libexec/rox,g'
 

Index: pkgsrc/sysutils/su2/Makefile
diff -u pkgsrc/sysutils/su2/Makefile:1.17 pkgsrc/sysutils/su2/Makefile:1.18
--- pkgsrc/sysutils/su2/Makefile:1.17   Fri Feb 26 10:24:13 2016
+++ pkgsrc/sysutils/su2/Makefile        Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2016/02/26 10:24:13 jperkin Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:38 jperkin Exp $
 #
 
 DISTNAME=              su2-1.3
@@ -20,7 +20,7 @@ NO_CONFIGURE=         yes
 
 SUBST_CLASSES+=                preproc
 SUBST_MESSAGE.preproc= Correcting C preprocessor directives.
-SUBST_STAGE.preproc=   post-patch
+SUBST_STAGE.preproc=   pre-configure
 SUBST_FILES.preproc=   su2.c
 SUBST_SED.preproc=     -e 's,^\(\# *else\).*,\1,'
 SUBST_SED.preproc=     -e 's,^\(\# *endif\).*,\1,'

Index: pkgsrc/sysutils/xe-guest-utilities/Makefile
diff -u pkgsrc/sysutils/xe-guest-utilities/Makefile:1.10 pkgsrc/sysutils/xe-guest-utilities/Makefile:1.11
--- pkgsrc/sysutils/xe-guest-utilities/Makefile:1.10    Mon Apr 20 08:05:30 2015
+++ pkgsrc/sysutils/xe-guest-utilities/Makefile Wed Jul  4 13:40:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2015/04/20 08:05:30 sborrill Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:38 jperkin Exp $
 #
 
 # Values from XenServer 6.5.0 = 6, 5, 0, 90977
@@ -34,13 +34,13 @@ NO_BUILD=   yes
 
 RCD_SCRIPTS=           xenguest
 SUBST_CLASSES+=                paths
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     ${SRCFILES}
 SUBST_SED.paths=       -e "s,@VARBASE@,${VARBASE},g"
 SUBST_SED.paths+=      -e "s,@PREFIX@,${PREFIX},g"
 
 SUBST_CLASSES+=                version
-SUBST_STAGE.version=   post-patch
+SUBST_STAGE.version=   pre-configure
 SUBST_FILES.version=   xe-update-guest-attrs
 SUBST_SED.version=     -e "s,@XENMAJOR@,${XENMAJOR},g"
 SUBST_SED.version+=    -e "s,@XENMINOR@,${XENMINOR},g"

Index: pkgsrc/sysutils/xfe/Makefile
diff -u pkgsrc/sysutils/xfe/Makefile:1.50 pkgsrc/sysutils/xfe/Makefile:1.51
--- pkgsrc/sysutils/xfe/Makefile:1.50   Mon Mar 12 11:17:39 2018
+++ pkgsrc/sysutils/xfe/Makefile        Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.50 2018/03/12 11:17:39 wiz Exp $
+# $NetBSD: Makefile,v 1.51 2018/07/04 13:40:39 jperkin Exp $
 
 DISTNAME=      xfe-1.40
 PKGREVISION=   3
@@ -19,7 +19,7 @@ LDFLAGS.DragonFly=    -lXft -lX11
 PTHREAD_AUTO_VARS=     yes
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      src/XFileExplorer.cpp
 SUBST_SED.conf=                -e "s|/usr/local|${PREFIX}|"
 SUBST_MESSAGE.conf=    Fixing hardcoded path.

Index: pkgsrc/textproc/eb/Makefile
diff -u pkgsrc/textproc/eb/Makefile:1.54 pkgsrc/textproc/eb/Makefile:1.55
--- pkgsrc/textproc/eb/Makefile:1.54    Thu Jan 19 18:52:27 2017
+++ pkgsrc/textproc/eb/Makefile Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.54 2017/01/19 18:52:27 agc Exp $
+# $NetBSD: Makefile,v 1.55 2018/07/04 13:40:39 jperkin Exp $
 
 DISTNAME=      eb-4.3
 PKGREVISION=   8
@@ -65,7 +65,7 @@ EGDIR=                ${PREFIX}/share/examples/eb
 # -    ZLIBLIBS="-L$z_libdir -lz"
 # +    ZLIBLIBS="-Wl,-R$z_libdir -L$z_libdir -lz"
 SUBST_CLASSES+=                runpath
-SUBST_STAGE.runpath=   post-patch
+SUBST_STAGE.runpath=   pre-configure
 SUBST_FILES.runpath=   configure configure.ac
 SUBST_SED.runpath=     -e 's|^\(.*LIBS=['\''"]\)-L\(\$$[^[:blank:]][^[:blank:]]*\)\(.*\)$$|\1${COMPILER_RPATH_FLAG}\2 -L\2\3|'
 

Index: pkgsrc/textproc/fop/Makefile
diff -u pkgsrc/textproc/fop/Makefile:1.35 pkgsrc/textproc/fop/Makefile:1.36
--- pkgsrc/textproc/fop/Makefile:1.35   Tue Aug  1 14:59:06 2017
+++ pkgsrc/textproc/fop/Makefile        Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2017/08/01 14:59:06 wiz Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:39 jperkin Exp $
 #
 # Note: we currently use the pre-built (-bin) distribution of FOP,
 #
@@ -25,7 +25,7 @@ WRKSRC=               ${WRKDIR}/${PKGNAME_NOREV}
 PLIST_SRC=     ${PKGDIR}/PLIST
 
 SUBST_CLASSES+=                        java_home
-SUBST_STAGE.java_home=         post-patch
+SUBST_STAGE.java_home=         pre-configure
 SUBST_MESSAGE.java_home=       Setting JAVA_HOME to a sane value.
 SUBST_FILES.java_home=         fop
 SUBST_FILES.java_home+=                fop-ttfreader.sh

Index: pkgsrc/textproc/helpdeco/Makefile
diff -u pkgsrc/textproc/helpdeco/Makefile:1.25 pkgsrc/textproc/helpdeco/Makefile:1.26
--- pkgsrc/textproc/helpdeco/Makefile:1.25      Wed Aug 16 20:21:15 2017
+++ pkgsrc/textproc/helpdeco/Makefile   Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2017/08/16 20:21:15 wiz Exp $
+# $NetBSD: Makefile,v 1.26 2018/07/04 13:40:39 jperkin Exp $
 #
 
 DISTNAME=              helpdeco-2.1.3
@@ -22,7 +22,7 @@ USE_TOOLS+=           gmake
 
 SUBST_CLASSES+=                prefix
 SUBST_MESSAGE.prefix=  Configuring to use PREFIX.
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    Makefile
 SUBST_SED.prefix=      -e "s,/usr/local,${DESTDIR}${PREFIX},g"
 

Index: pkgsrc/textproc/p5-Pod-Spell/Makefile
diff -u pkgsrc/textproc/p5-Pod-Spell/Makefile:1.22 pkgsrc/textproc/p5-Pod-Spell/Makefile:1.23
--- pkgsrc/textproc/p5-Pod-Spell/Makefile:1.22  Mon Jun  5 14:24:44 2017
+++ pkgsrc/textproc/p5-Pod-Spell/Makefile       Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2017/06/05 14:24:44 ryoon Exp $
+# $NetBSD: Makefile,v 1.23 2018/07/04 13:40:39 jperkin Exp $
 
 DISTNAME=      Pod-Spell-1.20
 PKGNAME=       p5-${DISTNAME}
@@ -23,7 +23,7 @@ BUILD_DEPENDS+=       p5-Test-Deep-[0-9]*:../.
 PERL5_PACKLIST=                auto/Pod/Spell/.packlist
 
 SUBST_CLASSES+=                perl
-SUBST_STAGE.perl=      post-patch
+SUBST_STAGE.perl=      pre-configure
 SUBST_MESSAGE.perl=    Fixing path to perl
 SUBST_FILES.perl+=     bin/podspell
 SUBST_SED.perl=                -e "s|/usr/bin/env perl|${PERL5}|"

Index: pkgsrc/textproc/p5-XML-Bare/Makefile
diff -u pkgsrc/textproc/p5-XML-Bare/Makefile:1.10 pkgsrc/textproc/p5-XML-Bare/Makefile:1.11
--- pkgsrc/textproc/p5-XML-Bare/Makefile:1.10   Mon Jun  5 14:24:54 2017
+++ pkgsrc/textproc/p5-XML-Bare/Makefile        Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2017/06/05 14:24:54 ryoon Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:39 jperkin Exp $
 #
 
 DISTNAME=      XML-Bare-0.53
@@ -17,7 +17,7 @@ USE_LANGUAGES=        c
 
 SUBST_CLASSES+=                perl
 SUBST_MESSAGE.perl=    Fixing the path of perl.
-SUBST_STAGE.perl=      post-patch
+SUBST_STAGE.perl=      pre-configure
 SUBST_FILES.perl=      Bare.pm
 SUBST_SED.perl=                -e "s,/usr/bin/perl,${PREFIX}/bin/perl,g"
 

Index: pkgsrc/textproc/rfcutil/Makefile
diff -u pkgsrc/textproc/rfcutil/Makefile:1.29 pkgsrc/textproc/rfcutil/Makefile:1.30
--- pkgsrc/textproc/rfcutil/Makefile:1.29       Mon Sep  4 18:01:02 2017
+++ pkgsrc/textproc/rfcutil/Makefile    Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2017/09/04 18:01:02 wiz Exp $
+# $NetBSD: Makefile,v 1.30 2018/07/04 13:40:39 jperkin Exp $
 #
 
 DISTNAME=      rfc-3.2
@@ -24,7 +24,7 @@ RFCINDEXURL=  http://www.ietf.org/downloa
 INSTALLATION_DIRS=     bin
 
 SUBST_CLASSES+=                rfcutil
-SUBST_STAGE.rfcutil=   post-patch
+SUBST_STAGE.rfcutil=   pre-configure
 SUBST_FILES.rfcutil=   rfc
 SUBST_SED.rfcutil+=    -e 's,/usr/local,${PREFIX},'
 SUBST_SED.rfcutil+=    -e '/VIEWER=/s,w3m lynx,${RFCVIEWER},'

Index: pkgsrc/textproc/robodoc/Makefile
diff -u pkgsrc/textproc/robodoc/Makefile:1.15 pkgsrc/textproc/robodoc/Makefile:1.16
--- pkgsrc/textproc/robodoc/Makefile:1.15       Mon Sep  4 18:08:29 2017
+++ pkgsrc/textproc/robodoc/Makefile    Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2017/09/04 18:08:29 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:39 jperkin Exp $
 #
 
 DISTNAME=      robodoc-3.2.3
@@ -16,7 +16,7 @@ USE_TOOLS+=   gm4 gmake
 SUBST_CLASSES+=                gm4
 SUBST_FILES.gm4=       Docs/makefile.in
 SUBST_SED.gm4+=                -e 's,@M4@,${TOOLS_M4},g'
-SUBST_STAGE.gm4=       post-patch
+SUBST_STAGE.gm4=       pre-configure
 
 MAKE_FILE=     makefile
 

Index: pkgsrc/time/hamster-applet/Makefile
diff -u pkgsrc/time/hamster-applet/Makefile:1.57 pkgsrc/time/hamster-applet/Makefile:1.58
--- pkgsrc/time/hamster-applet/Makefile:1.57    Tue Jul  3 05:03:38 2018
+++ pkgsrc/time/hamster-applet/Makefile Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2018/07/03 05:03:38 adam Exp $
+# $NetBSD: Makefile,v 1.58 2018/07/04 13:40:39 jperkin Exp $
 
 DISTNAME=      hamster-applet-2.28.1
 PKGREVISION=   36
@@ -21,7 +21,7 @@ PYTHON_VERSIONS_INCOMPATIBLE= 34 35 36 3
 
 SUBST_CLASSES+=                python
 SUBST_MESSAGE.python=  Fixing path to Python interpreter.
-SUBST_STAGE.python=    post-patch
+SUBST_STAGE.python=    pre-configure
 SUBST_FILES.python=    hamster/hamster-applet.py
 SUBST_SED.python=      -e 's@/usr/bin/env python@${PYTHONBIN}@g'
 

Index: pkgsrc/wm/compiz/Makefile
diff -u pkgsrc/wm/compiz/Makefile:1.105 pkgsrc/wm/compiz/Makefile:1.106
--- pkgsrc/wm/compiz/Makefile:1.105     Sun Apr 29 21:32:06 2018
+++ pkgsrc/wm/compiz/Makefile   Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.105 2018/04/29 21:32:06 adam Exp $
+# $NetBSD: Makefile,v 1.106 2018/07/04 13:40:39 jperkin Exp $
 #
 
 PKGVER=                0.8.8
@@ -59,7 +59,7 @@ PKGCONFIG_OVERRIDE+=  libdecoration/libde
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     metadata/decoration.xml.in
 SUBST_SED.paths=       -e 's,@PREFIX@,${PREFIX},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 .include "options.mk"
 

Index: pkgsrc/wm/fvwm-devel/Makefile
diff -u pkgsrc/wm/fvwm-devel/Makefile:1.52 pkgsrc/wm/fvwm-devel/Makefile:1.53
--- pkgsrc/wm/fvwm-devel/Makefile:1.52  Mon Mar 12 11:17:43 2018
+++ pkgsrc/wm/fvwm-devel/Makefile       Wed Jul  4 13:40:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.52 2018/03/12 11:17:43 wiz Exp $
+# $NetBSD: Makefile,v 1.53 2018/07/04 13:40:39 jperkin Exp $
 
 DISTNAME=      fvwm-${FVWM_VER}
 PKGREVISION=   12
@@ -48,7 +48,7 @@ SUBST_FILES.perl+=    modules/FvwmScript/Sc
 SUBST_SED.perl=                -e "s|${TOOLS_CMD.perl}|${PERL5}|"
 
 SUBST_CLASSES+=                mail
-SUBST_STAGE.mail=      post-patch
+SUBST_STAGE.mail=      pre-configure
 SUBST_MESSAGE.mail=    Fixing mail address
 SUBST_FILES.mail+=     bin/fvwm-bug.in
 SUBST_SED.mail=                -e "s|@MAINTAINER@|${MAINTAINER}|"

Index: pkgsrc/wm/golem/Makefile
diff -u pkgsrc/wm/golem/Makefile:1.32 pkgsrc/wm/golem/Makefile:1.33
--- pkgsrc/wm/golem/Makefile:1.32       Tue Jun 24 06:28:02 2014
+++ pkgsrc/wm/golem/Makefile    Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2014/06/24 06:28:02 dholland Exp $
+# $NetBSD: Makefile,v 1.33 2018/07/04 13:40:40 jperkin Exp $
 #
 
 DISTNAME=      golem-0.0.5
@@ -42,7 +42,7 @@ CONF_FILES=   ${EGDIR}/golemrc.default ${P
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     sample.golem/golemrc
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 INSTALLATION_DIRS=     ${EGDIR}
 INSTALL_MAKE_FLAGS+=   prefix=${DESTDIR}${PREFIX} \

Index: pkgsrc/wm/larswm/Makefile
diff -u pkgsrc/wm/larswm/Makefile:1.19 pkgsrc/wm/larswm/Makefile:1.20
--- pkgsrc/wm/larswm/Makefile:1.19      Wed Aug 16 20:45:46 2017
+++ pkgsrc/wm/larswm/Makefile   Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2017/08/16 20:45:46 wiz Exp $
+# $NetBSD: Makefile,v 1.20 2018/07/04 13:40:40 jperkin Exp $
 #
 
 DISTNAME=      larswm-7.5.3
@@ -27,7 +27,7 @@ CPPFLAGS+=    -DPKG_SYSCONFDIR=\"${PKG_SYSC
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     larswm.man
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 INSTALLATION_DIRS=     share/doc/larswm share/examples/larswm
 

Index: pkgsrc/wm/oroborox/Makefile
diff -u pkgsrc/wm/oroborox/Makefile:1.53 pkgsrc/wm/oroborox/Makefile:1.54
--- pkgsrc/wm/oroborox/Makefile:1.53    Mon Apr 16 14:35:17 2018
+++ pkgsrc/wm/oroborox/Makefile Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2018/04/16 14:35:17 wiz Exp $
+# $NetBSD: Makefile,v 1.54 2018/07/04 13:40:40 jperkin Exp $
 #
 
 DISTNAME=      OroboROX-0.9.8
@@ -33,19 +33,19 @@ INSTALLATION_DIRS=  share/rox/OroboROX
 
 SUBST_CLASSES+=                bin
 SUBST_MESSAGE.bin=     Fixing binary path.
-SUBST_STAGE.bin=       post-patch
+SUBST_STAGE.bin=       pre-configure
 SUBST_FILES.bin=       AppRun
 SUBST_SED.bin=         -e 's,BIN="$$APP_DIR/$$PLATFORM,BIN="${PREFIX}/libexec/rox,g'
 
 SUBST_CLASSES+=                path
 SUBST_MESSAGE.path=    Fixing hardcoded paths.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      AppRun
 SUBST_SED.path=                -e 's,/usr/local,${PREFIX},g'
 
 SUBST_CLASSES+=                lib
 SUBST_MESSAGE.lib=     Fixing hardcoded paths for ROX-Lib.
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 SUBST_FILES.lib=       Configure/Keybindings/findrox.py
 SUBST_FILES.lib+=      Configure/Windows/findrox.py
 SUBST_FILES.lib+=      Configure/Workspaces/findrox.py
@@ -54,7 +54,7 @@ SUBST_SED.lib=                -e 's,/usr/local/lib,${P
 
 SUBST_CLASSES+=                py
 SUBST_MESSAGE.py=      Replace shell magic by python version.
-SUBST_STAGE.py=                post-patch
+SUBST_STAGE.py=                pre-configure
 SUBST_FILES.py=                Configure/Keybindings/AppRun
 SUBST_FILES.py+=       Configure/Keybindings/Messages/update-po
 SUBST_FILES.py+=       Configure/Windows/Messages/update-po

Index: pkgsrc/wm/wmii/Makefile
diff -u pkgsrc/wm/wmii/Makefile:1.34 pkgsrc/wm/wmii/Makefile:1.35
--- pkgsrc/wm/wmii/Makefile:1.34        Mon May 14 10:31:14 2018
+++ pkgsrc/wm/wmii/Makefile     Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2018/05/14 10:31:14 maya Exp $
+# $NetBSD: Makefile,v 1.35 2018/07/04 13:40:40 jperkin Exp $
 
 DISTNAME=              wmii+ixp-3.9.2
 PKGNAME=               wmii-3.9.2
@@ -50,7 +50,7 @@ CONF_FILES+=          ${EGDIR}/${EGSUBDIR.${subd
 LDFLAGS.SunOS+=                -lsocket -lnsl -liconv
 
 SUBST_CLASSES+=                vars
-SUBST_STAGE.vars=      post-patch
+SUBST_STAGE.vars=      pre-configure
 SUBST_FILES.vars=      util/compile
 SUBST_VARS.vars=       EGREP SED SH AWK
 

Index: pkgsrc/wm/xmonad/Makefile
diff -u pkgsrc/wm/xmonad/Makefile:1.8 pkgsrc/wm/xmonad/Makefile:1.9
--- pkgsrc/wm/xmonad/Makefile:1.8       Sun Jun 26 04:29:56 2016
+++ pkgsrc/wm/xmonad/Makefile   Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2016/06/26 04:29:56 dholland Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:40 jperkin Exp $
 
 DISTNAME=      xmonad-0.12
 PKGNAME=       ${DISTNAME}
@@ -15,7 +15,7 @@ SUBST_FILES.1=        xmonad.cabal
 SUBST_SED.1=   -e "s|executable xmonad|executable xmonad+    buildable: False|"
 
 SUBST_CLASSES+=        2
-SUBST_STAGE.2= post-patch
+SUBST_STAGE.2= pre-configure
 SUBST_FILES.2= xmonad.cabal
 SUBST_FILTER_CMD.2=    ${TR} '+' \\n
 

Index: pkgsrc/wm/xmonad-contrib/options.mk
diff -u pkgsrc/wm/xmonad-contrib/options.mk:1.1 pkgsrc/wm/xmonad-contrib/options.mk:1.2
--- pkgsrc/wm/xmonad-contrib/options.mk:1.1     Mon Aug 25 13:58:21 2014
+++ pkgsrc/wm/xmonad-contrib/options.mk Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2014/08/25 13:58:21 szptvlfn Exp $
+# $NetBSD: options.mk,v 1.2 2018/07/04 13:40:40 jperkin Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.xmonad-contrib
 PKG_SUPPORTED_OPTIONS= xft2
@@ -15,7 +15,7 @@ SUBST_FILES.1=        xmonad-contrib.cabal
 SUBST_SED.1=   -e "s|render text|render text+  default: False|"
 
 SUBST_CLASSES+=        2
-SUBST_STAGE.2= post-patch
+SUBST_STAGE.2= pre-configure
 SUBST_FILES.2= xmonad-contrib.cabal
 SUBST_FILTER_CMD.2=    ${TR} '+' \\n
 .endif

Index: pkgsrc/www/SOGo3/Makefile
diff -u pkgsrc/www/SOGo3/Makefile:1.10 pkgsrc/www/SOGo3/Makefile:1.11
--- pkgsrc/www/SOGo3/Makefile:1.10      Sun Apr 29 21:32:06 2018
+++ pkgsrc/www/SOGo3/Makefile   Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2018/04/29 21:32:06 adam Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:40 jperkin Exp $
 #
 
 DISTNAME=      SOGo-3.2.9
@@ -50,7 +50,7 @@ RCD_SCRIPTS=  sogod
 
 SUBST_CLASSES+=         paths
 SUBST_MESSAGE.paths=    Fixing hardcoded paths.
-SUBST_STAGE.paths=      post-patch
+SUBST_STAGE.paths=      pre-configure
 SUBST_FILES.paths=      SoObjects/SOGo/SOGoSystemDefaults.m
 SUBST_SED.paths=        -e 's,/etc/sogo/,${PKG_SYSCONFDIR}/,g'
 

Index: pkgsrc/www/SpeedyCGI/Makefile
diff -u pkgsrc/www/SpeedyCGI/Makefile:1.23 pkgsrc/www/SpeedyCGI/Makefile:1.24
--- pkgsrc/www/SpeedyCGI/Makefile:1.23  Wed Aug 23 17:54:53 2017
+++ pkgsrc/www/SpeedyCGI/Makefile       Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2017/08/23 17:54:53 jlam Exp $
+# $NetBSD: Makefile,v 1.24 2018/07/04 13:40:40 jperkin Exp $
 
 DISTNAME=      CGI-SpeedyCGI-2.22
 PKGNAME=       SpeedyCGI-2.22
@@ -18,7 +18,7 @@ PERL5_PACKLIST=       auto/CGI/SpeedyCGI/.pac
 MAKE_ENV+=             PERL_USE_UNSAFE_INC=1
 
 SUBST_CLASSES+=                run
-SUBST_STAGE.run=       post-patch
+SUBST_STAGE.run=       pre-configure
 SUBST_FILES.run=       src/optdefs
 SUBST_SED.run+=                -e "s|@@PREFIX@@|${PREFIX}|g"
 SUBST_MESSAGE.run=     Fixing hardcoded paths.

Index: pkgsrc/www/album/Makefile
diff -u pkgsrc/www/album/Makefile:1.24 pkgsrc/www/album/Makefile:1.25
--- pkgsrc/www/album/Makefile:1.24      Fri Dec 16 15:24:20 2016
+++ pkgsrc/www/album/Makefile   Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2016/12/16 15:24:20 hans Exp $
+# $NetBSD: Makefile,v 1.25 2018/07/04 13:40:40 jperkin Exp $
 
 DISTNAME=      album-4.15
 PKGREVISION=   
@@ -26,7 +26,7 @@ AUTO_MKDIRS=          yes
 
 SUBST_CLASSES+=                prefix
 SUBST_MESSAGE.prefix=  Adjust Install Path to ${PREFIX}
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    album
 SUBST_VARS.prefix=     PREFIX
 

Index: pkgsrc/www/apache24/Makefile
diff -u pkgsrc/www/apache24/Makefile:1.68 pkgsrc/www/apache24/Makefile:1.69
--- pkgsrc/www/apache24/Makefile:1.68   Sun Apr 29 21:32:07 2018
+++ pkgsrc/www/apache24/Makefile        Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.68 2018/04/29 21:32:07 adam Exp $
+# $NetBSD: Makefile,v 1.69 2018/07/04 13:40:40 jperkin Exp $
 #
 # When updating this package, make sure that no strings like
 # "PR 12345" are in the commit message. Upstream likes
@@ -109,7 +109,7 @@ FIX_MAN_PERMS+=             man8/apachectl.8 man1/a
 
 # Fix paths in the apache manpages.
 SUBST_CLASSES+=                man
-SUBST_STAGE.man=       post-patch
+SUBST_STAGE.man=       pre-configure
 SUBST_MESSAGE.man=     Fixing paths in man pages.
 SUBST_FILES.man=       docs/man/*.1 docs/man/*.8
 SUBST_SED.man=         -e 's,/usr/local/etc/apache,${PKG_SYSCONFDIR},'

Index: pkgsrc/www/aws-demos/Makefile
diff -u pkgsrc/www/aws-demos/Makefile:1.21 pkgsrc/www/aws-demos/Makefile:1.22
--- pkgsrc/www/aws-demos/Makefile:1.21  Tue Apr 17 22:29:52 2018
+++ pkgsrc/www/aws-demos/Makefile       Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2018/04/17 22:29:52 wiz Exp $
+# $NetBSD: Makefile,v 1.22 2018/07/04 13:40:40 jperkin Exp $
 
 DISTNAME=      aws-${AWS_VERSION}
 PKGNAME=       aws-demos-${AWS_VERSION}
@@ -32,7 +32,7 @@ CONFIGURE_ARGS+=      LPATH=${BUILDLINK_PREFI
 CONFIGURE_ARGS+=       ZPATH=${BUILDLINK_PREFIX.zlib}/lib
 
 SUBST_CLASSES+=        lpath
-SUBST_STAGE.lpath=     post-patch
+SUBST_STAGE.lpath=     pre-configure
 SUBST_MESSAGE.lpath=   Add library path for ldap
 SUBST_FILES.lpath=     demos/test_ldap/test_ldap.gpr
 SUBST_SED.lpath=       -e 's|@PREFIX@|${PREFIX}|g'

Index: pkgsrc/www/bannerfilter/Makefile
diff -u pkgsrc/www/bannerfilter/Makefile:1.17 pkgsrc/www/bannerfilter/Makefile:1.18
--- pkgsrc/www/bannerfilter/Makefile:1.17       Sat Jul  9 06:39:11 2016
+++ pkgsrc/www/bannerfilter/Makefile    Wed Jul  4 13:40:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2016/07/09 06:39:11 wiz Exp $
+# $NetBSD: Makefile,v 1.18 2018/07/04 13:40:40 jperkin Exp $
 #
 
 DISTNAME=      bannerfilter-1.31
@@ -18,7 +18,7 @@ CONF_FILES=   ${SHAREDIR}/bannerfilter.con
 REPLACE_PERL=  redirector.pl
 
 SUBST_CLASSES+=        bf
-SUBST_STAGE.bf=        post-patch
+SUBST_STAGE.bf=        pre-configure
 SUBST_FILES.bf=        bannerfilter.conf
 SUBST_SED.bf=  -e s,@SHAREDIR@,${SHAREDIR},g
 

Index: pkgsrc/www/crawl/Makefile
diff -u pkgsrc/www/crawl/Makefile:1.22 pkgsrc/www/crawl/Makefile:1.23
--- pkgsrc/www/crawl/Makefile:1.22      Tue Aug  1 14:59:07 2017
+++ pkgsrc/www/crawl/Makefile   Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2017/08/01 14:59:07 wiz Exp $
+# $NetBSD: Makefile,v 1.23 2018/07/04 13:40:41 jperkin Exp $
 
 DISTNAME=      crawl-0.4
 PKGREVISION=   12
@@ -25,7 +25,7 @@ post-install:
        ${INSTALL_DATA} ${WRKSRC}/crawl.conf ${DESTDIR}${PREFIX}/share/examples/crawl/crawl.conf
 
 SUBST_CLASSES+=                path
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      cfg.h
 SUBST_SED.path=                -e 's,crawl.conf,${PKG_SYSCONFDIR}/crawl.conf,g'
 SUBST_MESSAGE.path=    Fixing hardcoded path.

Index: pkgsrc/www/cvsweb/Makefile
diff -u pkgsrc/www/cvsweb/Makefile:1.46 pkgsrc/www/cvsweb/Makefile:1.47
--- pkgsrc/www/cvsweb/Makefile:1.46     Tue Aug  1 14:59:07 2017
+++ pkgsrc/www/cvsweb/Makefile  Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.46 2017/08/01 14:59:07 wiz Exp $
+# $NetBSD: Makefile,v 1.47 2018/07/04 13:40:41 jperkin Exp $
 #
 
 DISTNAME=              cvsweb-3.0.6
@@ -62,7 +62,7 @@ do-install:
 .endfor
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    cvsweb.conf cvsweb.cgi INSTALL
 SUBST_SED.prefix=      -e "s,/usr/local/etc/apache,${PKG_SYSCONFBASE}/httpd,g"
 SUBST_SED.prefix+=     -e "s,/usr/local/etc/cvsweb,${PKG_SYSCONFDIR},g"

Index: pkgsrc/www/drraw/Makefile
diff -u pkgsrc/www/drraw/Makefile:1.21 pkgsrc/www/drraw/Makefile:1.22
--- pkgsrc/www/drraw/Makefile:1.21      Sat Jul  9 06:39:12 2016
+++ pkgsrc/www/drraw/Makefile   Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2016/07/09 06:39:12 wiz Exp $
+# $NetBSD: Makefile,v 1.22 2018/07/04 13:40:41 jperkin Exp $
 #
 
 DISTNAME=              drraw-2.2b2
@@ -45,7 +45,7 @@ do-install:
 .endfor
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    drraw.cgi
 SUBST_SED.prefix=      -e "s,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g"
 SUBST_MESSAGE.prefix=  Fixing harcoded paths.

Index: pkgsrc/www/drupal8/Makefile
diff -u pkgsrc/www/drupal8/Makefile:1.7 pkgsrc/www/drupal8/Makefile:1.8
--- pkgsrc/www/drupal8/Makefile:1.7     Fri Jun 22 12:59:08 2018
+++ pkgsrc/www/drupal8/Makefile Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2018/06/22 12:59:08 wen Exp $
+# $NetBSD: Makefile,v 1.8 2018/07/04 13:40:41 jperkin Exp $
 
 DISTNAME=      drupal-8.5.4
 PKGNAME=       ${PHP_PKG_PREFIX}-${DISTNAME}
@@ -43,7 +43,7 @@ REPLACE_FILES.php+=   core/scripts/update-
 REPLACE_FILES.php+=    core/scripts/rebuild_token_calculator.sh
 
 SUBST_CLASSES+=                sh
-SUBST_STAGE.sh=                post-patch
+SUBST_STAGE.sh=                pre-configure
 SUBST_MESSAGE.sh=      Fixing path to sh
 SUBST_FILES.sh+=       vendor/paragonie/random_compat/build-phar.sh
 SUBST_SED.sh=          -e "s|/usr/bin/env bash|${SH}|"

Index: pkgsrc/www/gallery/Makefile
diff -u pkgsrc/www/gallery/Makefile:1.14 pkgsrc/www/gallery/Makefile:1.15
--- pkgsrc/www/gallery/Makefile:1.14    Sat Jul  9 06:39:12 2016
+++ pkgsrc/www/gallery/Makefile Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2016/07/09 06:39:12 wiz Exp $
+# $NetBSD: Makefile,v 1.15 2018/07/04 13:40:41 jperkin Exp $
 #
 
 DISTNAME=      gallery-1.5.10
@@ -40,7 +40,7 @@ FILES_SUBST+= G1DIR=${G1DIR}
 SUBST_CLASSES+=        paths
 SUBST_FILES.paths=     ${WRKDIR}/gallery.conf
 SUBST_VARS.paths+=     G1DIR
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 INSTALLATION_DIRS=     share/examples/gallery
 INSTALLATION_DIRS+=    share/gallery

Index: pkgsrc/www/gallery2/Makefile
diff -u pkgsrc/www/gallery2/Makefile:1.15 pkgsrc/www/gallery2/Makefile:1.16
--- pkgsrc/www/gallery2/Makefile:1.15   Tue Aug  8 16:39:12 2017
+++ pkgsrc/www/gallery2/Makefile        Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2017/08/08 16:39:12 jlam Exp $
+# $NetBSD: Makefile,v 1.16 2018/07/04 13:40:41 jperkin Exp $
 #
 
 DISTNAME=              gallery-2.3.2-full
@@ -58,7 +58,7 @@ SUBST_CLASSES+=               paths
 SUBST_FILES.paths=     ${WRKDIR}/gallery2.conf
 SUBST_FILES.paths+=    ${WRKDIR}/config.php
 SUBST_VARS.paths+=     G2DIR G2DATA
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 OWN_DIRS_PERMS+=       ${G2DATA} ${APACHE_USER} ${APACHE_GROUP} 755
 

Index: pkgsrc/www/mediawiki/Makefile
diff -u pkgsrc/www/mediawiki/Makefile:1.70 pkgsrc/www/mediawiki/Makefile:1.71
--- pkgsrc/www/mediawiki/Makefile:1.70  Sat Dec 30 13:43:32 2017
+++ pkgsrc/www/mediawiki/Makefile       Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2017/12/30 13:43:32 wen Exp $
+# $NetBSD: Makefile,v 1.71 2018/07/04 13:40:41 jperkin Exp $
 
 DISTNAME=      mediawiki-${VER}.${PVER}
 CATEGORIES=    www
@@ -39,12 +39,12 @@ NO_BUILD=           YES
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing pathnames in configuration file.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     ../mediawiki.conf
 SUBST_SED.paths=       -e "s,@MEDIAWIKI@,${MEDIAWIKI},g"
 
 SUBST_CLASSES+=                sh
-SUBST_STAGE.sh=                post-patch
+SUBST_STAGE.sh=                pre-configure
 SUBST_MESSAGE.sh=      Fixing path to sh
 SUBST_FILES.sh+=       maintenance/storage/make-blobs
 SUBST_FILES.sh+=       maintenance/dev/install.sh maintenance/dev/installphp.sh
@@ -53,27 +53,27 @@ SUBST_FILES.sh+=    includes/limit.sh
 SUBST_SED.sh=          -e "s|/bin/bash|${SH}|"
 
 SUBST_CLASSES+=                sh2
-SUBST_STAGE.sh2=       post-patch
+SUBST_STAGE.sh2=       pre-configure
 SUBST_MESSAGE.sh2=     Fixing path to sh
 SUBST_FILES.sh2+=      maintenance/mwjsduck-gen
 SUBST_FILES.sh2+=      docs/kss/scripts/kss-node-check.sh
 SUBST_SED.sh2=         -e "s|/usr/bin/env bash|${SH}|"
 
 SUBST_CLASSES+=                perl
-SUBST_STAGE.perl=      post-patch
+SUBST_STAGE.perl=      pre-configure
 SUBST_MESSAGE.perl=    Fixing path to perl
 SUBST_FILES.perl+=     maintenance/postgres/compare_schemas.pl
 SUBST_FILES.perl+=     maintenance/postgres/mediawiki_mysql2postgres.pl
 SUBST_SED.perl=                -e "s|/usr/bin/perl|${PERL5}|"
 
 SUBST_CLASSES+=                python
-SUBST_STAGE.python=    post-patch
+SUBST_STAGE.python=    pre-configure
 SUBST_MESSAGE.python=  Fixing python path
 SUBST_FILES.python+=   extensions/ConfirmEdit/captcha.py
 SUBST_SED.python=      -e "s,/usr/bin/python,${PYTHONBIN},"
 
 SUBST_CLASSES+=                python2
-SUBST_STAGE.python2=   post-patch
+SUBST_STAGE.python2=   pre-configure
 SUBST_MESSAGE.python2= Fixing python path
 SUBST_FILES.python2+=  maintenance/language/zhtable/Makefile.py
 SUBST_SED.python2=     -e "s,/usr/bin/env python,${PYTHONBIN},"

Index: pkgsrc/www/mono-xsp/Makefile
diff -u pkgsrc/www/mono-xsp/Makefile:1.43 pkgsrc/www/mono-xsp/Makefile:1.44
--- pkgsrc/www/mono-xsp/Makefile:1.43   Sat Apr 14 07:34:04 2018
+++ pkgsrc/www/mono-xsp/Makefile        Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.43 2018/04/14 07:34:04 adam Exp $
+# $NetBSD: Makefile,v 1.44 2018/07/04 13:40:41 jperkin Exp $
 
 DISTNAME=      xsp-3.8
 PKGNAME=       mono-${DISTNAME}
@@ -25,7 +25,7 @@ SUBST_SED.unwrap_mk=          -e 's,^MAKEINFO = 
 SUBST_SED.unwrap_mk+=          -e 's,^PKG_CONFIG = .*,PKG_CONFIG = ${PREFIX}/bin/pkg-config,'
 
 SUBST_CLASSES+=         fix-mcs
-SUBST_STAGE.fix-mcs=    post-patch
+SUBST_STAGE.fix-mcs=    pre-configure
 SUBST_MESSAGE.fix-mcs=  Fix compiler name
 SUBST_FILES.fix-mcs=    configure
 SUBST_SED.fix-mcs=      -e 's,gmcs,mcs,'

Index: pkgsrc/www/moodle/Makefile
diff -u pkgsrc/www/moodle/Makefile:1.63 pkgsrc/www/moodle/Makefile:1.64
--- pkgsrc/www/moodle/Makefile:1.63     Sun May 20 10:43:53 2018
+++ pkgsrc/www/moodle/Makefile  Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.63 2018/05/20 10:43:53 wen Exp $
+# $NetBSD: Makefile,v 1.64 2018/07/04 13:40:41 jperkin Exp $
 
 DISTNAME=      moodle-3.5
 CATEGORIES=    www
@@ -56,7 +56,7 @@ PLIST_SRC+=           ${PKGDIR}/PLIST ${WRKDIR}/P
 
 SUBST_CLASSES+=                conf
 SUBST_MESSAGE.conf=    Fixing pathnames in configuration file.
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      ../moodle.conf
 SUBST_SED.conf=                -e "s,@MOODLEDIR@,${MOODLEDIR},g"
 SUBST_SED.conf+=       -e "s,@MOODLEDATADIR@,${MOODLEDATADIR},g"
@@ -67,7 +67,7 @@ SUBST_SED.conf+=      -e "s,Allow from all,Re
 
 SUBST_CLASSES+=                php
 SUBST_MESSAGE.php=     Fixing the path of php.
-SUBST_STAGE.php=       post-patch
+SUBST_STAGE.php=       pre-configure
 SUBST_FILES.php=       admin/cli/mysql_engine.php admin/cli/maintenance.php admin/cli/cron.php
 SUBST_FILES.php+=      admin/cli/reset_password.php admin/cli/automated_backups.php
 SUBST_FILES.php+=      admin/cli/install.php admin/cli/install_database.php admin/cli/upgrade.php
@@ -78,7 +78,7 @@ SUBST_SED.php=                -e "s,/usr/bin/php,${PRE
 
 SUBST_CLASSES+=                perl
 SUBST_MESSAGE.perl=    Fixing the path of perl.
-SUBST_STAGE.perl=      post-patch
+SUBST_STAGE.perl=      pre-configure
 SUBST_FILES.perl=      filter/algebra/algebra2tex.pl
 SUBST_SED.perl=                -e "s,/usr/bin/perl,${PREFIX}/bin/perl,g"
 

Index: pkgsrc/www/nspluginwrapper/Makefile
diff -u pkgsrc/www/nspluginwrapper/Makefile:1.62 pkgsrc/www/nspluginwrapper/Makefile:1.63
--- pkgsrc/www/nspluginwrapper/Makefile:1.62    Sun Apr 29 21:32:07 2018
+++ pkgsrc/www/nspluginwrapper/Makefile Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.62 2018/04/29 21:32:07 adam Exp $
+# $NetBSD: Makefile,v 1.63 2018/07/04 13:40:41 jperkin Exp $
 #
 
 DISTNAME=      nspluginwrapper-1.4.4
@@ -38,7 +38,7 @@ PLUGIN_SRCDIR=                ${WRKDIR}/usr/${PLUGIN_S
 LDFLAGS.DragonFly=     -lgmodule-2.0
 
 SUBST_CLASSES+=                npw-config
-SUBST_STAGE.npw-config=        post-patch
+SUBST_STAGE.npw-config=        pre-configure
 SUBST_FILES.npw-config=        src/npw-config.c
 SUBST_SED.npw-config=  -e "s|/usr/pkg/|${PREFIX}/|g"
 

Index: pkgsrc/www/p5-Catalyst-Plugin-Session/Makefile
diff -u pkgsrc/www/p5-Catalyst-Plugin-Session/Makefile:1.30 pkgsrc/www/p5-Catalyst-Plugin-Session/Makefile:1.31
--- pkgsrc/www/p5-Catalyst-Plugin-Session/Makefile:1.30 Fri Jun 16 09:48:19 2017
+++ pkgsrc/www/p5-Catalyst-Plugin-Session/Makefile      Wed Jul  4 13:40:41 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2017/06/16 09:48:19 jperkin Exp $
+# $NetBSD: Makefile,v 1.31 2018/07/04 13:40:41 jperkin Exp $
 
 DISTNAME=      Catalyst-Plugin-Session-0.40
 PKGNAME=       p5-${DISTNAME}
@@ -31,7 +31,7 @@ BUILD_DEPENDS+=       p5-Test-Exception>=0:../
 
 SUBST_CLASSES+=                perl
 SUBST_MESSAGE.perl=    Fixing the path of perl.
-SUBST_STAGE.perl=      post-patch
+SUBST_STAGE.perl=      pre-configure
 SUBST_FILES.perl=      lib/Catalyst/Plugin/Session.pm lib/Catalyst/Plugin/Session/State.pm \
                        lib/Catalyst/Plugin/Session/Store.pm lib/Catalyst/Plugin/Session/Store/Dummy.pm \
                        lib/Catalyst/Plugin/Session/Test/Store.pm

Index: pkgsrc/www/p5-libapreq2/Makefile
diff -u pkgsrc/www/p5-libapreq2/Makefile:1.40 pkgsrc/www/p5-libapreq2/Makefile:1.41
--- pkgsrc/www/p5-libapreq2/Makefile:1.40       Mon Jun  5 14:25:35 2017
+++ pkgsrc/www/p5-libapreq2/Makefile    Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.40 2017/06/05 14:25:35 ryoon Exp $
+# $NetBSD: Makefile,v 1.41 2018/07/04 13:40:42 jperkin Exp $
 
 DISTNAME=      libapreq2-2.13
 PKGNAME=       p5-${APACHE_PKG_PREFIX}-${DISTNAME}
@@ -18,7 +18,7 @@ USE_LIBTOOL=  YES
 PERL5_PACKLIST=        auto/libapreq2/.packlist
 
 SUBST_CLASSES+=                apxs
-SUBST_STAGE.apxs=      post-patch
+SUBST_STAGE.apxs=      pre-configure
 SUBST_FILES.apxs=      env/Makefile.in
 SUBST_SED.apxs=                -e "s|@APACHE2_APXS@ -i -a -n|@APACHE2_APXS@ -i -n|g"
 SUBST_MESSAGE.apxs=    Fixing module installation.

Index: pkgsrc/www/privoxy/Makefile
diff -u pkgsrc/www/privoxy/Makefile:1.60 pkgsrc/www/privoxy/Makefile:1.61
--- pkgsrc/www/privoxy/Makefile:1.60    Wed Mar 21 23:18:09 2018
+++ pkgsrc/www/privoxy/Makefile Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.60 2018/03/21 23:18:09 gdt Exp $
+# $NetBSD: Makefile,v 1.61 2018/07/04 13:40:42 jperkin Exp $
 #
 
 DISTNAME=      ${PKGNAME_NOREV}-stable-src
@@ -62,7 +62,7 @@ FILES_SUBST+=         PRIVOXY_USER=${PRIVOXY_US
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     config
 SUBST_SED.paths+=      -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 .include "options.mk"
 

Index: pkgsrc/www/shibboleth-sp/Makefile
diff -u pkgsrc/www/shibboleth-sp/Makefile:1.26 pkgsrc/www/shibboleth-sp/Makefile:1.27
--- pkgsrc/www/shibboleth-sp/Makefile:1.26      Sun Apr 29 21:32:08 2018
+++ pkgsrc/www/shibboleth-sp/Makefile   Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.26 2018/04/29 21:32:08 adam Exp $
+# $NetBSD: Makefile,v 1.27 2018/07/04 13:40:42 jperkin Exp $
 #
 
 DISTNAME=      shibboleth-sp-2.5.5
@@ -34,7 +34,7 @@ PLIST_SUBST+= PKG_APACHE_NUM=${PKG_APACH
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     ${WRKSRC}/configs/Makefile.in
 SUBST_FILES.paths+=    ${WRKSRC}/configs/keygen.sh
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_SED.paths=       -e 's,@EGDIR@,${EGDIR},'
 SUBST_SED.paths+=      -e 's,@SHIB_CONFDIR@,${SHIB_CONFDIR},'
 

Index: pkgsrc/www/siege/Makefile
diff -u pkgsrc/www/siege/Makefile:1.4 pkgsrc/www/siege/Makefile:1.5
--- pkgsrc/www/siege/Makefile:1.4       Mon Sep 25 22:39:56 2017
+++ pkgsrc/www/siege/Makefile   Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2017/09/25 22:39:56 jlam Exp $
+# $NetBSD: Makefile,v 1.5 2018/07/04 13:40:42 jperkin Exp $
 #
 
 DISTNAME=              siege-3.1.3
@@ -25,7 +25,7 @@ CONF_FILES=           ${EGDIR}/urls.txt ${PKG_SYS
 CONF_FILES+=           ${EGDIR}/siegerc ${PKG_SYSCONFDIR}/siegerc
 
 SUBST_CLASSES+=                siege
-SUBST_STAGE.siege=     post-patch
+SUBST_STAGE.siege=     pre-configure
 SUBST_FILES.siege=     doc/Makefile.am doc/Makefile.in
 SUBST_SED.siege+=      -e "s|@EGDIR@|${EGDIR}|g"
 

Index: pkgsrc/www/squidview/Makefile
diff -u pkgsrc/www/squidview/Makefile:1.5 pkgsrc/www/squidview/Makefile:1.6
--- pkgsrc/www/squidview/Makefile:1.5   Fri Dec 23 22:30:50 2016
+++ pkgsrc/www/squidview/Makefile       Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2016/12/23 22:30:50 joerg Exp $
+# $NetBSD: Makefile,v 1.6 2018/07/04 13:40:42 jperkin Exp $
 
 DISTNAME=      squidview-0.80
 PKGREVISION=   3
@@ -16,7 +16,7 @@ GNU_CONFIGURE=                yes
 .include "../../www/squid3/Makefile.common"
 
 SUBST_CLASSES+=        files
-SUBST_STAGE.files=     post-patch
+SUBST_STAGE.files=     pre-configure
 SUBST_FILES.files=     squidview.h squidview.1
 SUBST_SED.files=       -e "s|/var/log/squid|${LOGDIR}|g"
 SUBST_MESSAGE.files=   Fixing logfile location.

Index: pkgsrc/www/swiggle/Makefile
diff -u pkgsrc/www/swiggle/Makefile:1.18 pkgsrc/www/swiggle/Makefile:1.19
--- pkgsrc/www/swiggle/Makefile:1.18    Thu Oct  9 14:07:12 2014
+++ pkgsrc/www/swiggle/Makefile Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2014/10/09 14:07:12 wiz Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:42 jperkin Exp $
 
 DISTNAME=      swiggle-0.4
 PKGREVISION=   3
@@ -10,7 +10,7 @@ HOMEPAGE=     http://homepage.univie.ac.at/l
 COMMENT=       Lightweight image gallery generator
 
 SUBST_CLASSES+=                mf
-SUBST_STAGE.mf=                post-patch
+SUBST_STAGE.mf=                pre-configure
 SUBST_FILES.mf=                Makefile
 SUBST_SED.mf=          -e "s/gcc/${CC}/"
 SUBST_SED.mf+=         -e "s/-O3//"

Index: pkgsrc/www/thttpd/Makefile
diff -u pkgsrc/www/thttpd/Makefile:1.48 pkgsrc/www/thttpd/Makefile:1.49
--- pkgsrc/www/thttpd/Makefile:1.48     Mon May  7 07:01:37 2018
+++ pkgsrc/www/thttpd/Makefile  Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.48 2018/05/07 07:01:37 wiz Exp $
+# $NetBSD: Makefile,v 1.49 2018/07/04 13:40:42 jperkin Exp $
 
 DISTNAME=      thttpd-2.28
 CATEGORIES=    www
@@ -34,7 +34,7 @@ INSTALLATION_DIRS=    ${PKGMANDIR}/man1 sha
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     thttpd.conf
 SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 MAKE_JOBS_SAFE=        no
 

Index: pkgsrc/www/viewvc/Makefile
diff -u pkgsrc/www/viewvc/Makefile:1.28 pkgsrc/www/viewvc/Makefile:1.29
--- pkgsrc/www/viewvc/Makefile:1.28     Tue Jul  3 05:03:41 2018
+++ pkgsrc/www/viewvc/Makefile  Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2018/07/03 05:03:41 adam Exp $
+# $NetBSD: Makefile,v 1.29 2018/07/04 13:40:42 jperkin Exp $
 
 DISTNAME=      viewvc-1.1.26
 CATEGORIES=    devel www
@@ -32,7 +32,7 @@ CONF_FILES+=  ${PREFIX}/share/examples/vi
 .include "options.mk"
 
 SUBST_CLASSES+=                conf
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_MESSAGE.conf=    Fixing configuration files.
 SUBST_FILES.conf=      conf/viewvc.conf.dist
 SUBST_FILES.conf+=     conf/cvsgraph.conf.dist

Index: pkgsrc/www/w3c-httpd/Makefile
diff -u pkgsrc/www/w3c-httpd/Makefile:1.27 pkgsrc/www/w3c-httpd/Makefile:1.28
--- pkgsrc/www/w3c-httpd/Makefile:1.27  Fri Feb 26 10:57:46 2016
+++ pkgsrc/www/w3c-httpd/Makefile       Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2016/02/26 10:57:46 jperkin Exp $
+# $NetBSD: Makefile,v 1.28 2018/07/04 13:40:42 jperkin Exp $
 
 DISTNAME=      w3c-httpd-3.0A
 PKGREVISION=   1
@@ -30,7 +30,7 @@ CPPFLAGS.Darwin+=     -Dunix
 CFLAGS+=       ${CPPFLAGS}
 
 SUBST_CLASSES+=                strcasestr
-SUBST_STAGE.strcasestr=        post-patch
+SUBST_STAGE.strcasestr=        pre-configure
 SUBST_FILES.strcasestr=        Daemon/Implementation/HTWild.c \
        Library/Implementation/HTString.c \
        Library/Implementation/HTString.h \

Index: pkgsrc/www/w3m/Makefile.common
diff -u pkgsrc/www/w3m/Makefile.common:1.66 pkgsrc/www/w3m/Makefile.common:1.67
--- pkgsrc/www/w3m/Makefile.common:1.66 Mon May 14 14:40:17 2018
+++ pkgsrc/www/w3m/Makefile.common      Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.66 2018/05/14 14:40:17 leot Exp $
+# $NetBSD: Makefile.common,v 1.67 2018/07/04 13:40:42 jperkin Exp $
 #
 # used by www/w3m/Makefile
 # used by www/w3m-img/Makefile
@@ -57,13 +57,13 @@ CONFIGURE_ARGS+=    --sysconfdir=${PKG_SYSC
 
 SUBST_CLASSES+=                man-ja
 SUBST_MESSAGE.man-ja=  Fixing the path to Japanese manual pages.
-SUBST_STAGE.man-ja=    post-patch
+SUBST_STAGE.man-ja=    pre-configure
 SUBST_FILES.man-ja=    Makefile.in config.h.dist
 SUBST_SED.man-ja=      -e 's|/ja/|/ja_JP.eucJP/|g'
 
 SUBST_CLASSES+=                fh
 SUBST_MESSAGE.fh=      Rename file_handle.
-SUBST_STAGE.fh=                post-patch
+SUBST_STAGE.fh=                pre-configure
 SUBST_FILES.fh=                istream.*
 SUBST_SED.fh=          -e 's/file_handle/file_handle_rofl/g'
 

Index: pkgsrc/www/wdg-validate/Makefile
diff -u pkgsrc/www/wdg-validate/Makefile:1.28 pkgsrc/www/wdg-validate/Makefile:1.29
--- pkgsrc/www/wdg-validate/Makefile:1.28       Sat Jul  9 06:39:15 2016
+++ pkgsrc/www/wdg-validate/Makefile    Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2016/07/09 06:39:15 wiz Exp $
+# $NetBSD: Makefile,v 1.29 2018/07/04 13:40:42 jperkin Exp $
 #
 
 DISTNAME=      validate-1.2.2
@@ -25,7 +25,7 @@ NO_BUILD=     YES
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     validate
 SUBST_SED.paths=       -e 's,/usr/local/share,${PREFIX}/share,g'
 SUBST_SED.paths+=      -e 's,/usr/local/bin/lq-nsgmls,${LOCALBASE}/bin/lq-nsgmls,g'

Index: pkgsrc/www/wordpress/Makefile
diff -u pkgsrc/www/wordpress/Makefile:1.78 pkgsrc/www/wordpress/Makefile:1.79
--- pkgsrc/www/wordpress/Makefile:1.78  Fri May 18 14:22:40 2018
+++ pkgsrc/www/wordpress/Makefile       Wed Jul  4 13:40:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.78 2018/05/18 14:22:40 jklos Exp $
+# $NetBSD: Makefile,v 1.79 2018/07/04 13:40:42 jperkin Exp $
 
 DISTNAME=              wordpress-${VERSION}
 VERSION=               4.9.6
@@ -45,7 +45,7 @@ DEPENDS+=             ${PHP_PKG_PREFIX}-zlib>=5.6.0
 
 SUBST_CLASSES+=                conf
 SUBST_MESSAGE.conf=    Fixing pathnames in configuration file.
-SUBST_STAGE.conf=      post-patch
+SUBST_STAGE.conf=      pre-configure
 SUBST_FILES.conf=      ../wordpress.conf
 SUBST_SED.conf=                -e "s,@WPHOME@,${WPHOME},g"
 .if !empty(PKG_OPTIONS:Map-php) && ${PKG_APACHE} == "apache24"

Index: pkgsrc/x11/XaoS/Makefile
diff -u pkgsrc/x11/XaoS/Makefile:1.38 pkgsrc/x11/XaoS/Makefile:1.39
--- pkgsrc/x11/XaoS/Makefile:1.38       Tue Dec 29 13:41:58 2015
+++ pkgsrc/x11/XaoS/Makefile    Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2015/12/29 13:41:58 bsiegert Exp $
+# $NetBSD: Makefile,v 1.39 2018/07/04 13:40:43 jperkin Exp $
 #
 
 DISTNAME=              xaos-3.6
@@ -18,7 +18,7 @@ INFO_FILES=           yes
 
 SUBST_CLASSES+=                paths
 SUBST_MESSAGE.paths=   Fixing hardcoded paths.
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 SUBST_FILES.paths=     configure
 SUBST_SED.paths=       -e 's,/usr/share/locale,${PREFIX}/${PKGLOCALEDIR}/locale,g'
 

Index: pkgsrc/x11/Xbae/Makefile
diff -u pkgsrc/x11/Xbae/Makefile:1.30 pkgsrc/x11/Xbae/Makefile:1.31
--- pkgsrc/x11/Xbae/Makefile:1.30       Tue Jan  2 21:11:10 2018
+++ pkgsrc/x11/Xbae/Makefile    Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2018/01/02 21:11:10 rillig Exp $
+# $NetBSD: Makefile,v 1.31 2018/07/04 13:40:43 jperkin Exp $
 #
 
 DISTNAME=      xbae-4.51.01
@@ -20,7 +20,7 @@ CONFIGURE_ARGS+=      --with-motif-libraries=
 INSTALLATION_DIRS=     share/aclocal
 
 SUBST_CLASSES+=                dirs
-SUBST_STAGE.dirs=      post-patch
+SUBST_STAGE.dirs=      pre-configure
 SUBST_FILES.dirs=      Makefile.in doc/Makefile.in doc/images/Makefile.in src/Makefile.in
 SUBST_SED.dirs=                -e '/^mandir =/         s,=.*,= @mandir@,'
 SUBST_SED.dirs+=       -e '/^SUBDIRS =/        s,examples,,'

Index: pkgsrc/x11/avant-window-navigator/Makefile
diff -u pkgsrc/x11/avant-window-navigator/Makefile:1.42 pkgsrc/x11/avant-window-navigator/Makefile:1.43
--- pkgsrc/x11/avant-window-navigator/Makefile:1.42     Tue Jul  3 05:03:42 2018
+++ pkgsrc/x11/avant-window-navigator/Makefile  Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2018/07/03 05:03:42 adam Exp $
+# $NetBSD: Makefile,v 1.43 2018/07/04 13:40:43 jperkin Exp $
 
 DISTNAME=      avant-window-navigator-0.4.0
 PKGREVISION=   29
@@ -26,13 +26,13 @@ GCONF_SCHEMAS+=             avant-window-navigator.
 GCONF_SCHEMAS+=                awn-applet-taskmanager.schemas
 
 SUBST_CLASSES+=                python
-SUBST_STAGE.python=    post-patch
+SUBST_STAGE.python=    pre-configure
 SUBST_MESSAGE.python=  Fixing python path
 SUBST_FILES.python=    applet-activation/main.c
 SUBST_SED.python=      -e "s,@PYTHONBIN@,${PYTHONBIN},"
 
 SUBST_CLASSES+=                pathfix
-SUBST_STAGE.pathfix=   post-patch
+SUBST_STAGE.pathfix=   pre-configure
 SUBST_MESSAGE.pathfix= Fixing hardcoded paths
 SUBST_FILES.pathfix=   applets/taskmanager/awn-applet-taskmanager.schema-ini.in
 SUBST_FILES.pathfix+=  doc/reference/html/*.html

Index: pkgsrc/x11/gdm/Makefile
diff -u pkgsrc/x11/gdm/Makefile:1.189 pkgsrc/x11/gdm/Makefile:1.190
--- pkgsrc/x11/gdm/Makefile:1.189       Mon Apr 16 14:35:20 2018
+++ pkgsrc/x11/gdm/Makefile     Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.189 2018/04/16 14:35:20 wiz Exp $
+# $NetBSD: Makefile,v 1.190 2018/07/04 13:40:43 jperkin Exp $
 #
 
 DISTNAME=      gdm-2.20.11
@@ -83,7 +83,7 @@ SUBST_SED.desktop+=   -e 's|^PreFetchProgr
 
 SUBST_CLASSES+=                gdmsetup
 SUBST_MESSAGE.gdmsetup=        Patching gdmsetup theme installer to use ${REAL_ROOT_USER}:${REAL_ROOT_GROUP}
-SUBST_STAGE.gdmsetup=  post-patch
+SUBST_STAGE.gdmsetup=  pre-configure
 SUBST_FILES.gdmsetup=  gui/gdmsetup.c
 SUBST_SED.gdmsetup=    -e 's/root:root/${REAL_ROOT_USER}:${REAL_ROOT_GROUP}/g'
 

Index: pkgsrc/x11/gnome-desktop-sharp/Makefile
diff -u pkgsrc/x11/gnome-desktop-sharp/Makefile:1.78 pkgsrc/x11/gnome-desktop-sharp/Makefile:1.79
--- pkgsrc/x11/gnome-desktop-sharp/Makefile:1.78        Tue Apr 17 22:29:34 2018
+++ pkgsrc/x11/gnome-desktop-sharp/Makefile     Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.78 2018/04/17 22:29:34 wiz Exp $
+# $NetBSD: Makefile,v 1.79 2018/07/04 13:40:43 jperkin Exp $
 #
 
 DISTNAME=      gnome-desktop-sharp-2.26.0
@@ -26,7 +26,7 @@ PKGCONFIG_OVERRIDE+=  vte/vte-sharp-0.16.
 PKGCONFIG_OVERRIDE+=   wnck/wnck-sharp-1.0.pc.in
 
 SUBST_CLASSES=         pc
-SUBST_STAGE.pc=                post-patch
+SUBST_STAGE.pc=                pre-configure
 SUBST_FILES.pc=                ${PKGCONFIG_OVERRIDE}
 SUBST_SED.pc=          -e "s|\$${pcfiledir}/../..|@prefix@|g"
 SUBST_MESSAGE.pc=      Fixing hardcoded paths.

Index: pkgsrc/x11/gnome-sharp/Makefile
diff -u pkgsrc/x11/gnome-sharp/Makefile:1.73 pkgsrc/x11/gnome-sharp/Makefile:1.74
--- pkgsrc/x11/gnome-sharp/Makefile:1.73        Mon Apr 16 14:33:59 2018
+++ pkgsrc/x11/gnome-sharp/Makefile     Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.73 2018/04/16 14:33:59 wiz Exp $
+# $NetBSD: Makefile,v 1.74 2018/07/04 13:40:43 jperkin Exp $
 #
 
 DISTNAME=      gnome-sharp-2.24.2
@@ -33,7 +33,7 @@ PKGCONFIG_OVERRIDE+=  gnome/gnome-sharp-2
 PKGCONFIG_OVERRIDE+=   gnomevfs/gnome-vfs-sharp-2.0.pc.in
 
 SUBST_CLASSES=         pc
-SUBST_STAGE.pc=                post-patch
+SUBST_STAGE.pc=                pre-configure
 SUBST_FILES.pc=                ${PKGCONFIG_OVERRIDE}
 SUBST_SED.pc=          -e "s|\$${pcfiledir}/../..|@prefix@|g"
 SUBST_MESSAGE.pc=      Fixing hardcoded paths.

Index: pkgsrc/x11/gtk-sharp/Makefile
diff -u pkgsrc/x11/gtk-sharp/Makefile:1.65 pkgsrc/x11/gtk-sharp/Makefile:1.66
--- pkgsrc/x11/gtk-sharp/Makefile:1.65  Mon Apr 16 14:35:21 2018
+++ pkgsrc/x11/gtk-sharp/Makefile       Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.65 2018/04/16 14:35:21 wiz Exp $
+# $NetBSD: Makefile,v 1.66 2018/07/04 13:40:43 jperkin Exp $
 #
 
 DISTNAME=              gtk-sharp-2.12.26
@@ -29,7 +29,7 @@ PKGCONFIG_OVERRIDE+=  glade/glade-sharp-2
 
 SUBST_CLASSES+=                relprefix
 SUBST_MESSAGE.relprefix=Replacing relative prefix in pkg-config files.
-SUBST_STAGE.relprefix= post-patch
+SUBST_STAGE.relprefix= pre-configure
 SUBST_FILES.relprefix= ${PKGCONFIG_OVERRIDE}
 SUBST_SED.relprefix=   -e 's|$${pcfiledir}/../..|@prefix@|g'
 

Index: pkgsrc/x11/gtkada/Makefile
diff -u pkgsrc/x11/gtkada/Makefile:1.42 pkgsrc/x11/gtkada/Makefile:1.43
--- pkgsrc/x11/gtkada/Makefile:1.42     Mon Apr 16 14:33:59 2018
+++ pkgsrc/x11/gtkada/Makefile  Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2018/04/16 14:33:59 wiz Exp $
+# $NetBSD: Makefile,v 1.43 2018/07/04 13:40:43 jperkin Exp $
 
 DISTNAME=      gtkada-${GTKADA_VERSION}
 PKGREVISION=   16
@@ -26,13 +26,13 @@ CONFIGURE_ARGS+=    --enable-nls \
 MAKE_ENV+=             PROCESSORS=${MAKE_JOBS}
 
 SUBST_CLASSES+=                docs lgnat sphinx
-SUBST_STAGE.docs=      post-patch
+SUBST_STAGE.docs=      pre-configure
 SUBST_FILES.docs=      Makefile.in
 SUBST_SED.docs=                -e 's/^all: \(.*\)/all: \1 docs/g'
-SUBST_STAGE.lgnat=     post-patch
+SUBST_STAGE.lgnat=     pre-configure
 SUBST_FILES.lgnat=     src/tools/Makefile.in testgtk/Makefile.in
 SUBST_SED.lgnat=       -e 's|-largs|-largs -lgnat|'
-SUBST_STAGE.sphinx=    post-patch
+SUBST_STAGE.sphinx=    pre-configure
 SUBST_FILES.sphinx=    docs/gtkada_ug/Makefile
 SUBST_SED.sphinx=      -e 's|sphinx-build|${PREFIX}/bin/sphinx-build${PYVERSSUFFIX}|'
 

Index: pkgsrc/x11/hyena/Makefile
diff -u pkgsrc/x11/hyena/Makefile:1.11 pkgsrc/x11/hyena/Makefile:1.12
--- pkgsrc/x11/hyena/Makefile:1.11      Sat Apr 14 07:34:45 2018
+++ pkgsrc/x11/hyena/Makefile   Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2018/04/14 07:34:45 adam Exp $
+# $NetBSD: Makefile,v 1.12 2018/07/04 13:40:43 jperkin Exp $
 
 DISTNAME=      hyena-0.5
 PKGREVISION=   11
@@ -20,7 +20,7 @@ PKGCONFIG_OVERRIDE+=  build/pkg-config/hy
 PKGCONFIG_OVERRIDE+=   build/pkg-config/hyena.pc.in
 
 SUBST_CLASSES+=                fix-mcs
-SUBST_STAGE.fix-mcs=   post-patch
+SUBST_STAGE.fix-mcs=   pre-configure
 SUBST_MESSAGE.fix-mcs= Fix compiler name
 SUBST_FILES.fix-mcs=   configure
 SUBST_SED.fix-mcs=     -e 's,gmcs,mcs,'

Index: pkgsrc/x11/kde-runtime4/Makefile
diff -u pkgsrc/x11/kde-runtime4/Makefile:1.87 pkgsrc/x11/kde-runtime4/Makefile:1.88
--- pkgsrc/x11/kde-runtime4/Makefile:1.87       Sun Apr 29 21:31:25 2018
+++ pkgsrc/x11/kde-runtime4/Makefile    Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.87 2018/04/29 21:31:25 adam Exp $
+# $NetBSD: Makefile,v 1.88 2018/07/04 13:40:43 jperkin Exp $
 
 DISTNAME=      kde-runtime-15.12.0
 PKGNAME=       ${DISTNAME:S/-1/4-1/}
@@ -44,7 +44,7 @@ PLIST.x11=    yes
 .endif
 
 SUBST_CLASSES+=                htdig
-SUBST_STAGE.htdig=     post-patch
+SUBST_STAGE.htdig=     pre-configure
 SUBST_MESSAGE.htdig=   Fix htdig paths.
 SUBST_FILES.htdig=     khelpcenter/searchhandlers/khc_htsearch.pl
 SUBST_SED.htdig=       -e s:/srv/www/cgi-bin:${PREFIX}/libexec/cgi-bin:
@@ -52,7 +52,7 @@ SUBST_SED.htdig=      -e s:/srv/www/cgi-bin:$
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     kioslave/info/kde-info2html.conf
 SUBST_SED.paths=       -e 's,@LOCALBASE@,${LOCALBASE},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 REPLACE_PERL+= \
        khelpcenter/searchhandlers/khc_docbookdig.pl.cmake \

Index: pkgsrc/x11/kde-workspace4/Makefile
diff -u pkgsrc/x11/kde-workspace4/Makefile:1.69 pkgsrc/x11/kde-workspace4/Makefile:1.70
--- pkgsrc/x11/kde-workspace4/Makefile:1.69     Sun Apr 29 21:31:25 2018
+++ pkgsrc/x11/kde-workspace4/Makefile  Wed Jul  4 13:40:43 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.69 2018/04/29 21:31:25 adam Exp $
+# $NetBSD: Makefile,v 1.70 2018/07/04 13:40:43 jperkin Exp $
 
 DISTNAME=      kde-workspace-4.11.22
 PKGNAME=       ${DISTNAME:S/-4/4-4/}
@@ -87,17 +87,17 @@ CONF_FILES+=                ${PREFIX}/share/examples/k
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     kdm/kcm/main.cpp
 SUBST_SED.paths=       -e 's,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 SUBST_CLASSES+=                qtpath
 SUBST_FILES.qtpath=    startkde.cmake
 SUBST_VARS.qtpath=     QTDIR
-SUBST_STAGE.qtpath=    post-patch
+SUBST_STAGE.qtpath=    pre-configure
 
 SUBST_CLASSES+=                isocodes
 SUBST_FILES.isocodes=  kcontrol/keyboard/iso_codes.h
 SUBST_SED.isocodes=    -e 's,/usr/share/xml/iso-codes,${BUILDLINK_PREFIX.iso-codes}/share/xml/iso-codes,g'
-SUBST_STAGE.isocodes=  post-patch
+SUBST_STAGE.isocodes=  pre-configure
 
 ICONDIR=               share/icons
 

Index: pkgsrc/x11/lxsession/Makefile
diff -u pkgsrc/x11/lxsession/Makefile:1.18 pkgsrc/x11/lxsession/Makefile:1.19
--- pkgsrc/x11/lxsession/Makefile:1.18  Tue May 22 16:07:01 2018
+++ pkgsrc/x11/lxsession/Makefile       Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2018/05/22 16:07:01 youri Exp $
+# $NetBSD: Makefile,v 1.19 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=      lxsession-0.5.3
 CATEGORIES=    x11
@@ -23,7 +23,7 @@ CONF_FILES+=  ${LXDE_CONF}/lxpolkit.deskt
 
 SUBST_CLASSES+=                prefix
 SUBST_MESSAGE.prefix=  Fixing paths.
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    lxsession/environement.c
 SUBST_FILES.prefix+=   lxsession/app.c
 SUBST_FILES.prefix+=   lxsession/settings.c

Index: pkgsrc/x11/ocaml-graphics/Makefile
diff -u pkgsrc/x11/ocaml-graphics/Makefile:1.35 pkgsrc/x11/ocaml-graphics/Makefile:1.36
--- pkgsrc/x11/ocaml-graphics/Makefile:1.35     Fri Apr 13 13:55:29 2018
+++ pkgsrc/x11/ocaml-graphics/Makefile  Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2018/04/13 13:55:29 jaapb Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:44 jperkin Exp $
 
 .include "../../lang/ocaml/Makefile.common"
 DISTINFO_FILE= ${PKGDIR}/../../lang/ocaml/distinfo
@@ -43,19 +43,19 @@ PLIST_SRC+= ${PKGDIR}/PLIST.stub
 BUILDLINK_DEPMETHOD.ocaml=     full
 
 SUBST_CLASSES+=                depend
-SUBST_STAGE.depend=    post-patch
+SUBST_STAGE.depend=    pre-configure
 SUBST_FILES.depend=    otherlibs/graph/.depend
 SUBST_SED.depend=      -e 's,/usr/X11R6,${X11BASE},g'
 SUBST_MESSAGE.depend=  Fixing .depend in otherlibs/graph.
 
 SUBST_CLASSES+=                mklib
-SUBST_STAGE.mklib=     post-patch
+SUBST_STAGE.mklib=     pre-configure
 SUBST_FILES.mklib=     otherlibs/Makefile.shared
 SUBST_SED.mklib=       -e 's,^MKLIB=.*,MKLIB=ocamlmklib,g'
 SUBST_MESSAGE.mklib=   Fixing MKLIB in otherlibs/Makefile.shared.
 
 SUBST_CLASSES+=                comp
-SUBST_STAGE.comp=      post-patch
+SUBST_STAGE.comp=      pre-configure
 SUBST_FILES.comp=      otherlibs/Makefile
 SUBST_SED.comp=                -e 's,^CAMLC=.*,CAMLC=ocamlc,g'
 SUBST_SED.comp+=       -e '/^CAMLOPT=/{;N;s,^CAMLOPT=.*,CAMLOPT=ocamlopt,g;}'
@@ -63,7 +63,7 @@ SUBST_SED.comp+=      -e 's,^MKLIB=.*,MKLIB=o
 SUBST_MESSAGE.comp=    Fixing CAMLC OCAMLOPT MKLIB in otherlibs/Makefile.
 
 SUBST_CLASSES+=                comp2
-SUBST_STAGE.comp2=     post-patch
+SUBST_STAGE.comp2=     pre-configure
 SUBST_FILES.comp2=     otherlibs/graph/Makefile
 SUBST_SED.comp2=       -e 's,..CAMLRUN..*ocamldep,ocamldep,g'
 SUBST_MESSAGE.comp2=   Fixing ocamldep in otherlibs/graph/Makefile.

Index: pkgsrc/x11/p5-Tk/Makefile
diff -u pkgsrc/x11/p5-Tk/Makefile:1.91 pkgsrc/x11/p5-Tk/Makefile:1.92
--- pkgsrc/x11/p5-Tk/Makefile:1.91      Mon Sep  4 12:45:32 2017
+++ pkgsrc/x11/p5-Tk/Makefile   Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.91 2017/09/04 12:45:32 wiz Exp $
+# $NetBSD: Makefile,v 1.92 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=      Tk-804.034
 PKGNAME=       p5-${DISTNAME}
@@ -25,7 +25,7 @@ REPLACE_PERL+=                pTk/mkVFunc
 REPLACE_PERL+=         demos/widget
 
 SUBST_CLASSES+=                prefix
-SUBST_STAGE.prefix=    post-patch
+SUBST_STAGE.prefix=    pre-configure
 SUBST_FILES.prefix=    PNG/Makefile.PL
 SUBST_SED.prefix=      -e 's,%%LOCALBASE%%,${LOCALBASE},g'
 

Index: pkgsrc/x11/pixman/Makefile
diff -u pkgsrc/x11/pixman/Makefile:1.65 pkgsrc/x11/pixman/Makefile:1.66
--- pkgsrc/x11/pixman/Makefile:1.65     Thu Dec  1 15:47:24 2016
+++ pkgsrc/x11/pixman/Makefile  Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.65 2016/12/01 15:47:24 marino Exp $
+# $NetBSD: Makefile,v 1.66 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=      pixman-0.34.0
 PKGREVISION=   1
@@ -23,7 +23,7 @@ PKGCONFIG_OVERRIDE+=  pixman-1.pc.in
 PKGCONFIG_OVERRIDE+=   pixman-1-uninstalled.pc.in
 
 SUBST_CLASSES=         subdirs
-SUBST_STAGE.subdirs=   post-patch
+SUBST_STAGE.subdirs=   pre-configure
 SUBST_FILES.subdirs=   Makefile.in
 SUBST_SED.subdirs=     -e "s|pixman demos test|pixman|"
 SUBST_MESSAGE.lbase=   Skip building demos and test SUBDIRS

Index: pkgsrc/x11/py-qt5/Makefile
diff -u pkgsrc/x11/py-qt5/Makefile:1.35 pkgsrc/x11/py-qt5/Makefile:1.36
--- pkgsrc/x11/py-qt5/Makefile:1.35     Sat Jun 23 11:23:46 2018
+++ pkgsrc/x11/py-qt5/Makefile  Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2018/06/23 11:23:46 wiz Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=      PyQt5_gpl-5.10.1
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME:S/PyQt5_gpl/qt5/}
@@ -27,7 +27,7 @@ PLIST_VARS+=          webkit
 PY_PATCHPLIST=         yes
 
 SUBST_CLASSES+=                x11lib
-SUBST_STAGE.x11lib=    post-patch
+SUBST_STAGE.x11lib=    pre-configure
 SUBST_MESSAGE.x11lib=  Fixing rpath for X11 and pulseaudio libraries.
 SUBST_FILES.x11lib+=   configure.py
 SUBST_FILES.x11lib+=   designer/designer.pro-in

Index: pkgsrc/x11/rox-session/Makefile
diff -u pkgsrc/x11/rox-session/Makefile:1.53 pkgsrc/x11/rox-session/Makefile:1.54
--- pkgsrc/x11/rox-session/Makefile:1.53        Tue Jul  3 05:03:44 2018
+++ pkgsrc/x11/rox-session/Makefile     Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2018/07/03 05:03:44 adam Exp $
+# $NetBSD: Makefile,v 1.54 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=      rox-session-0.28
 PKGREVISION=   33
@@ -24,13 +24,13 @@ INSTALLATION_DIRS=  share/rox/ROX-Session
 
 SUBST_CLASSES+=                path
 SUBST_MESSAGE.path=    Fixing hardcoded paths.
-SUBST_STAGE.path=      post-patch
+SUBST_STAGE.path=      pre-configure
 SUBST_FILES.path=      Login
 SUBST_SED.path=                -e 's,/usr/local,${PREFIX},g'
 
 SUBST_CLASSES+=                lib
 SUBST_MESSAGE.lib=     Fixing hardcoded paths for ROX-Lib.
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 SUBST_FILES.lib=       findrox.py
 SUBST_SED.lib=         -e 's,/usr/local/lib,${PREFIX}/share/rox,g'
 

Index: pkgsrc/x11/rox-wallpaper/Makefile
diff -u pkgsrc/x11/rox-wallpaper/Makefile:1.10 pkgsrc/x11/rox-wallpaper/Makefile:1.11
--- pkgsrc/x11/rox-wallpaper/Makefile:1.10      Sat May 17 16:10:50 2014
+++ pkgsrc/x11/rox-wallpaper/Makefile   Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2014/05/17 16:10:50 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2018/07/04 13:40:44 jperkin Exp $
 #
 
 DISTNAME=      wallpaper-2.0
@@ -25,7 +25,7 @@ INSTALLATION_DIRS=    share/rox/Wallpaper
 
 SUBST_CLASSES+=                lib
 SUBST_MESSAGE.lib=     Fixing hardcoded paths for ROX-Lib.
-SUBST_STAGE.lib=       post-patch
+SUBST_STAGE.lib=       pre-configure
 SUBST_FILES.lib=       findrox.py
 SUBST_SED.lib=         -e 's,/usr/local/lib,${PREFIX}/share/rox,g'
 

Index: pkgsrc/x11/xf86-input-joystick/Makefile
diff -u pkgsrc/x11/xf86-input-joystick/Makefile:1.8 pkgsrc/x11/xf86-input-joystick/Makefile:1.9
--- pkgsrc/x11/xf86-input-joystick/Makefile:1.8 Wed Mar  7 11:57:41 2018
+++ pkgsrc/x11/xf86-input-joystick/Makefile     Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2018/03/07 11:57:41 wiz Exp $
+# $NetBSD: Makefile,v 1.9 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=      xf86-input-joystick-1.6.3
 PKGREVISION=   2
@@ -20,7 +20,7 @@ PKGCONFIG_OVERRIDE+=  xorg-joystick.pc.in
 CONFIGURE_ENV.SunOS+=  DRIVER_MAN_SUFFIX=4
 
 SUBST_CLASSES.DragonFly+=      usbhid
-SUBST_STAGE.usbhid=            post-patch
+SUBST_STAGE.usbhid=            pre-configure
 SUBST_FILES.usbhid=            configure
 SUBST_FILES.usbhid+=           src/backend_bsd.c
 SUBST_SED.usbhid=              -e 's,dev/usb/,bus/u4b/,g'

Index: pkgsrc/x11/xfstt/Makefile
diff -u pkgsrc/x11/xfstt/Makefile:1.42 pkgsrc/x11/xfstt/Makefile:1.43
--- pkgsrc/x11/xfstt/Makefile:1.42      Wed Mar  7 11:57:46 2018
+++ pkgsrc/x11/xfstt/Makefile   Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2018/03/07 11:57:46 wiz Exp $
+# $NetBSD: Makefile,v 1.43 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=              xfstt-1.9.3
 PKGREVISION=           1
@@ -32,7 +32,7 @@ INSTALLATION_DIRS=    bin                     \
 SUBST_CLASSES+=                paths
 SUBST_FILES.paths=     doc/FAQ
 SUBST_SED.paths=       -e 's,/usr,${PREFIX},g'
-SUBST_STAGE.paths=     post-patch
+SUBST_STAGE.paths=     pre-configure
 
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/src/xfstt ${DESTDIR}${PREFIX}/bin

Index: pkgsrc/x11/xorg-cf-files/Makefile
diff -u pkgsrc/x11/xorg-cf-files/Makefile:1.35 pkgsrc/x11/xorg-cf-files/Makefile:1.36
--- pkgsrc/x11/xorg-cf-files/Makefile:1.35      Wed Mar  7 11:57:47 2018
+++ pkgsrc/x11/xorg-cf-files/Makefile   Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.35 2018/03/07 11:57:47 wiz Exp $
+# $NetBSD: Makefile,v 1.36 2018/07/04 13:40:44 jperkin Exp $
 
 DISTNAME=              xorg-cf-files-1.0.6
 PKGREVISION=           5
@@ -22,7 +22,7 @@ DARWIN_USE_QUARTZ?=   1
 DEPENDS+=              byacc-[0-9]*:../../devel/byacc
 DEPENDS+=              flex-[0-9]*:../../devel/flex
 SUBST_CLASSES+=                fixpaths
-SUBST_STAGE.fixpaths=  post-patch
+SUBST_STAGE.fixpaths=  pre-configure
 SUBST_MESSAGE.fixpaths=        Fixing compiler tool paths
 SUBST_FILES.fixpaths=  svr4.cf
 SUBST_SED.fixpaths+=   -e 's,/usr/ccs/bin/ar,/usr/bin/ar,g'

Index: pkgsrc/x11/xosd/Makefile.common
diff -u pkgsrc/x11/xosd/Makefile.common:1.28 pkgsrc/x11/xosd/Makefile.common:1.29
--- pkgsrc/x11/xosd/Makefile.common:1.28        Wed Sep  6 09:03:06 2017
+++ pkgsrc/x11/xosd/Makefile.common     Wed Jul  4 13:40:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.28 2017/09/06 09:03:06 wiz Exp $
+# $NetBSD: Makefile.common,v 1.29 2018/07/04 13:40:44 jperkin Exp $
 #
 # used by x11/xmms-osd/Makefile
 
@@ -19,7 +19,7 @@ USE_LIBTOOL=          yes
 SHLIBTOOL_OVERRIDE=    libtool-disable-static
 
 SUBST_CLASSES+=                fixme
-SUBST_STAGE.fixme=     post-patch
+SUBST_STAGE.fixme=     pre-configure
 SUBST_FILES.fixme=     configure
 SUBST_SED.fixme=       -e "s|-lpthread|"${PTHREAD_LIBS:M*:Q}"|g"
 



Home | Main Index | Thread Index | Old Index