#!/usr/bin/sed # Match the install section of the makefile /^install:/,/^$/{ # link commands only substitute the final PREFIX /^\s*ln.*$/s/\$\(PREFIX\)(\S+)$/$(DESTDIR)$(PREFIX)\1/; # non-inks substitute $(PREFIX) for $(DESTDIR)$(PREFIX) /^\s*ln.*$/!s/\$\(PREFIX\)/$(DESTDIR)$(PREFIX)/g; # fix manpage paths s|\$\(PREFIX\)/man|$(PREFIX)/share/man|g }