summaryrefslogtreecommitdiff
path: root/bzip2.morph-makefix.sed
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-10-31 12:44:30 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-10-31 12:44:30 +0000
commit8deafa68e52b230018c0318dc7959ff9af3ad2a5 (patch)
tree5d5afee28c3b990efb762747c1894fb36d1a32fe /bzip2.morph-makefix.sed
parent731ca15ed0c02730197deb3fd16321544eebee47 (diff)
parent2df3d891926b785d1abd590eb8bc233913fed992 (diff)
downloadbzip2-8deafa68e52b230018c0318dc7959ff9af3ad2a5.tar.gz
Merge remote-tracking branch 'remotes/origin/baserock/richardmaw/bzip2-symlink-fix' into baserock/morphbaserock/morph
Diffstat (limited to 'bzip2.morph-makefix.sed')
-rw-r--r--bzip2.morph-makefix.sed10
1 files changed, 10 insertions, 0 deletions
diff --git a/bzip2.morph-makefix.sed b/bzip2.morph-makefix.sed
new file mode 100644
index 0000000..9589790
--- /dev/null
+++ b/bzip2.morph-makefix.sed
@@ -0,0 +1,10 @@
+#!/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
+}