2005-11-08 Oliver Kiddle <okiddle@yahoo.co.uk>
+ * bug #10230: etc/Makefile.in, man/Makefile.in, uip/Makefile.in:
+ Michael De La Rue: prepend DESTDIR to install locations
+
* configure.in, */Makefile.in, mts/smtp/smtp.c: replace obsolete
autoconf macros
install: install-bin-files install-etc-files
install-bin-files:
- $(top_srcdir)/mkinstalldirs $(bindir)
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
for script in $(GENERATED_BIN_FILES); do \
- $(INSTALL_PROGRAM) $$script $(bindir)/$$script; \
+ $(INSTALL_PROGRAM) $$script $(DESTDIR)$(bindir)/$$script; \
done
install-etc-files:
- $(top_srcdir)/mkinstalldirs $(etcdir)
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
for file in $(STATIC_FILES); do \
INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
for path in $$INSTALL_FILES; do \
file=`basename $$path`; \
echo "Installing $$file..."; \
- if [ -f $(etcdir)/$$file ]; then \
- mv $(etcdir)/$$file $(etcdir)/$$file.prev; \
- $(INSTALL_DATA) $$path $(etcdir)/$$file; \
- if diff $(etcdir)/$$file.prev $(etcdir)/$$file; then \
- rm $(etcdir)/$$file.prev; \
+ if [ -f $(DESTDIR)$(etcdir)/$$file ]; then \
+ mv $(DESTDIR)$(etcdir)/$$file $(DESTDIR)$(etcdir)/$$file.prev; \
+ $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
+ if diff $(DESTDIR)$(etcdir)/$$file.prev $(DESTDIR)$(etcdir)/$$file; then \
+ rm $(DESTDIR)$(etcdir)/$$file.prev; \
else \
echo; \
echo " Previous version of $$file saved as $$file.prev due\c";\
echo; \
fi; \
else \
- $(INSTALL_DATA) $$path $(etcdir)/$$file; \
+ $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
fi; \
done
uninstall-bin-files:
for script in $(GENERATED_BIN_FILES); do \
- rm -f $(bindir)/$$script; \
+ rm -f $(DESTDIR)$(bindir)/$$script; \
done
uninstall-etc-files:
for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
- rm -f $(etcdir)/$$file; \
+ rm -f $(DESTDIR)$(etcdir)/$$file; \
done
# ========== DEPENDENCIES FOR CLEANUP ==========
# install the man pages in man1
install-man1:
- $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext1)
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
for file in $(MAN1); do \
- $(INSTALL_DATA) $$file $(mandir)/man$(manext1) ; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
done
# install the man pages in man5
install-man5:
- $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext5)
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
for file in $(MAN5); do \
- $(INSTALL_DATA) $$file $(mandir)/man$(manext5) ; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
done
- if [ ! -f $(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
- ( cd $(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
+ if [ ! -f $(DESTDIR)$(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
+ ( cd $(DESTDIR)$(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
mh_profile.$(manext5) ) \
fi
# install the man pages in man8
install-man8:
- $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext8)
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
for file in $(MAN8); do \
- $(INSTALL_DATA) $$file $(mandir)/man$(manext8) ; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
done
# ========= UNINSTALL TARGETS =========
# uninstall the man pages in man1
uninstall-man1:
for file in $(MAN1); do \
- rm -f $(mandir)/man$(manext1)/$$file; \
+ rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
done
# uninstall the man pages in man5
uninstall-man5:
for file in $(MAN5); do \
- rm -f $(mandir)/man$(manext5)/$$file; \
+ rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
done
# uninstall the man pages in man8
uninstall-man8:
for file in $(MAN8); do \
- rm -f $(mandir)/man$(manext8)/$$file; \
+ rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
done
# ========== DEPENDENCIES FOR CLEANUP ==========
# install commands
install-cmds:
- $(top_srcdir)/mkinstalldirs $(bindir)
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
for cmd in $(CMDS); do \
- $(INSTALL_PROGRAM) $$cmd $(bindir)/$$cmd; \
+ $(INSTALL_PROGRAM) $$cmd $(DESTDIR)$(bindir)/$$cmd; \
done
# install links
install-lcmds:
- rm -f $(bindir)/flists
- rm -f $(bindir)/folders
- rm -f $(bindir)/prev
- rm -f $(bindir)/next
- rm -f $(libdir)/install-mh
- $(LN) $(bindir)/flist $(bindir)/flists
- $(LN) $(bindir)/folder $(bindir)/folders
- $(LN) $(bindir)/show $(bindir)/prev
- $(LN) $(bindir)/show $(bindir)/next
- $(LN) $(bindir)/install-mh $(libdir)/install-mh
+ rm -f $(DESTDIR)$(bindir)/flists
+ rm -f $(DESTDIR)$(bindir)/folders
+ rm -f $(DESTDIR)$(bindir)/prev
+ rm -f $(DESTDIR)$(bindir)/next
+ rm -f $(DESTDIR)$(libdir)/install-mh
+ $(LN) $(DESTDIR)$(bindir)/flist $(DESTDIR)$(bindir)/flists
+ $(LN) $(DESTDIR)$(bindir)/folder $(DESTDIR)$(bindir)/folders
+ $(LN) $(DESTDIR)$(bindir)/show $(DESTDIR)$(bindir)/prev
+ $(LN) $(DESTDIR)$(bindir)/show $(DESTDIR)$(bindir)/next
+ $(LN) $(DESTDIR)$(bindir)/install-mh $(DESTDIR)$(libdir)/install-mh
# install misc support binaries
install-misc:
- $(top_srcdir)/mkinstalldirs $(libdir)
+ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir)
for misc in $(MISC); do \
- $(INSTALL_PROGRAM) $$misc $(libdir)/$$misc; \
+ $(INSTALL_PROGRAM) $$misc $(DESTDIR)$(libdir)/$$misc; \
done
# install commands with special installation needs (thus no $(SCMDS) use here)
install-scmds:
if test x$(SETGID_MAIL) != x; then \
- $(INSTALL_PROGRAM) -g $(MAIL_SPOOL_GRP) -m 2755 inc $(bindir)/$$cmd; \
+ $(INSTALL_PROGRAM) -g $(MAIL_SPOOL_GRP) -m 2755 inc $(DESTDIR)$(bindir)/$$cmd; \
else \
- $(INSTALL_PROGRAM) inc $(bindir)/$$cmd; \
+ $(INSTALL_PROGRAM) inc $(DESTDIR)$(bindir)/$$cmd; \
fi
uninstall:
for cmd in $(CMDS); do \
- rm -f $(bindir)/$$cmd; \
+ rm -f $(DESTDIR)$(bindir)/$$cmd; \
done
for lcmd in $(LCMDS); do \
- rm -f $(bindir)/$$lcmd; \
+ rm -f $(DESTDIR)$(bindir)/$$lcmd; \
done
for misc in $(MISC); do \
- rm -f $(libdir)/$$misc; \
+ rm -f $(DESTDIR)$(libdir)/$$misc; \
done
for cmd in $(SCMDS); do \
- rm -f $(bindir)/$$cmd; \
+ rm -f $(DESTDIR)$(bindir)/$$cmd; \
done
# ========== DEPENDENCIES FOR CLEANUP ==========