Create correct symlinks even when

--program-{prefix,suffix,transform} is passed to configure.
This commit is contained in:
Lasse Collin 2009-06-27 12:32:40 +03:00
parent 0adc72feb8
commit 792db79f27
3 changed files with 65 additions and 45 deletions

View File

@ -10,44 +10,56 @@ dist_man_MANS = xzdiff.1 xzgrep.1 xzmore.1
install-exec-hook: install-exec-hook:
cd $(DESTDIR)$(bindir) && \ cd $(DESTDIR)$(bindir) && \
rm -f xzcmp xzegrep xzfgrep xzless \ target=`echo xzdiff | $(SED) '$(transform)'` && \
lzdiff lzgrep lzmore \ for name in xzcmp lzdiff lzcmp; do \
lzcmp lzegrep lzfgrep lzless && \ link=`echo $$name | $(SED) '$(transform)'` && \
$(LN_S) xzdiff xzcmp && \ rm -f $$link && \
$(LN_S) xzgrep xzegrep && \ $(LN_S) $$target $$link; \
$(LN_S) xzgrep xzfgrep && \ done && \
$(LN_S) xzmore xzless && \ target=`echo xzgrep | $(SED) '$(transform)'` && \
$(LN_S) xzdiff lzdiff && \ for name in xzegrep xzfgrep lzgrep lzegrep lzfgrep; do \
$(LN_S) xzgrep lzgrep && \ link=`echo $$name | $(SED) '$(transform)'` && \
$(LN_S) xzmore lzmore && \ rm -f $$link && \
$(LN_S) xzdiff lzcmp && \ $(LN_S) $$target $$link; \
$(LN_S) xzgrep lzegrep && \ done && \
$(LN_S) xzgrep lzfgrep && \ target=`echo xzmore | $(SED) '$(transform)'` && \
$(LN_S) xzmore lzless for name in xzless lzmore lzless; do \
link=`echo $$name | $(SED) '$(transform)'` && \
rm -f $$link && \
$(LN_S) $$target $$link; \
done
install-data-hook: install-data-hook:
cd $(DESTDIR)$(mandir)/man1 && \ cd $(DESTDIR)$(mandir)/man1 && \
rm -f xzcmp.1 xzegrep.1 xzfgrep.1 xzless.1 \ target=`echo xzdiff | $(SED) '$(transform)'` && \
lzdiff.1 lzgrep.1 lzmore.1 \ for name in xzcmp lzdiff lzcmp; do \
lzcmp.1 lzegrep.1 lzfgrep.1 lzless.1 && \ link=`echo $$name | $(SED) '$(transform)'` && \
$(LN_S) xzdiff.1 xzcmp.1 && \ rm -f $$link.1 && \
$(LN_S) xzgrep.1 xzegrep.1 && \ $(LN_S) $$target.1 $$link.1; \
$(LN_S) xzgrep.1 xzfgrep.1 && \ done && \
$(LN_S) xzmore.1 xzless.1 && \ target=`echo xzgrep | $(SED) '$(transform)'` && \
$(LN_S) xzdiff.1 lzdiff.1 && \ for name in xzegrep xzfgrep lzgrep lzegrep lzfgrep; do \
$(LN_S) xzgrep.1 lzgrep.1 && \ link=`echo $$name | $(SED) '$(transform)'` && \
$(LN_S) xzmore.1 lzmore.1 && \ rm -f $$link.1 && \
$(LN_S) xzdiff.1 lzcmp.1 && \ $(LN_S) $$target.1 $$link.1; \
$(LN_S) xzgrep.1 lzegrep.1 && \ done && \
$(LN_S) xzgrep.1 lzfgrep.1 && \ target=`echo xzmore | $(SED) '$(transform)'` && \
$(LN_S) xzmore.1 lzless.1 for name in xzless lzmore lzless; do \
link=`echo $$name | $(SED) '$(transform)'` && \
rm -f $$link.1 && \
$(LN_S) $$target.1 $$link.1; \
done
uninstall-hook: uninstall-hook:
cd $(DESTDIR)$(bindir) && \ cd $(DESTDIR)$(bindir) && \
rm -f xzcmp xzegrep xzfgrep xzless \ for name in xzcmp lzdiff lzcmp xzgrep xzegrep xzfgrep \
lzdiff lzgrep lzmore \ lzgrep lzegrep lzfgrep xzless lzmore lzless; do \
lzcmp lzegrep lzfgrep lzless link=`echo $$name | $(SED) '$(transform)'` && \
rm -f $$link; \
done
cd $(DESTDIR)$(mandir)/man1 && \ cd $(DESTDIR)$(mandir)/man1 && \
rm -f xzcmp.1 xzegrep.1 xzfgrep.1 xzless.1 \ for name in xzcmp lzdiff lzcmp xzgrep xzegrep xzfgrep \
lzdiff.1 lzgrep.1 lzmore.1 \ lzgrep lzegrep lzfgrep xzless lzmore lzless; do \
lzcmp.1 lzegrep.1 lzfgrep.1 lzless.1 link=`echo $$name | $(SED) '$(transform)'` && \
rm -f $$link.1; \
done

View File

@ -49,17 +49,22 @@ endif
xz_LDADD += $(LTLIBINTL) xz_LDADD += $(LTLIBINTL)
## Create symlinks for unxz and xzcat for convenicen. Create symlinks also ## Create symlinks for unxz and xzcat for convenience. Create symlinks also
## for lzma, unlzma, and lzcat for compatibility with LZMA Utils 4.32.x. ## for lzma, unlzma, and lzcat for compatibility with LZMA Utils 4.32.x.
xzlinks = unxz xzcat lzma unlzma lzcat
install-exec-hook: install-exec-hook:
cd $(DESTDIR)$(bindir) && \ cd $(DESTDIR)$(bindir) && \
rm -f unxz xzcat lzma unlzma lzcat && \ target=`echo xz | $(SED) '$(transform)'` && \
$(LN_S) xz unxz && \ for name in $(xzlinks); do \
$(LN_S) xz xzcat && \ link=`echo $$name | $(SED) '$(transform)'` && \
$(LN_S) xz lzma && \ rm -f $$link && \
$(LN_S) xz unlzma && \ $(LN_S) $$target $$link; \
$(LN_S) xz lzcat done
uninstall-hook: uninstall-hook:
cd $(DESTDIR)$(bindir) && \ cd $(DESTDIR)$(bindir) && \
rm -f unxz xzcat lzma unlzma lzcat for name in $(xzlinks); do \
link=`echo $$name | $(SED) '$(transform)'` && \
rm -f $$link; \
done

View File

@ -32,9 +32,12 @@ dist_man_MANS = xzdec.1
install-data-hook: install-data-hook:
cd $(DESTDIR)$(mandir)/man1 && \ cd $(DESTDIR)$(mandir)/man1 && \
rm -f lzmadec.1 && \ target=`echo xzdec | $(SED) '$(transform)'` && \
$(LN_S) xzdec.1 lzmadec.1 link=`echo lzmadec | $(SED) '$(transform)'` && \
rm -f $$link.1 && \
$(LN_S) $$target.1 $$link.1
uninstall-hook: uninstall-hook:
cd $(DESTDIR)$(mandir)/man1 && \ cd $(DESTDIR)$(mandir)/man1 && \
rm -f lzmadec.1 link=`echo lzmadec | $(SED) '$(transform)'` && \
rm -f $$link.1