Skip to content
Browse files

Respect DESTDIR

  • Loading branch information...
1 parent 70db95a commit 331dad10d1b0c6934f54622c8cc3ee495b7749d4 yamaoka committed Jan 6, 2012
Showing with 76 additions and 41 deletions.
  1. +18 −0 ChangeLog
  2. +29 −25 Makefile.in
  3. +1 −1 aclocal.m4
  4. +10 −10 doc/Makefile.in
  5. +18 −5 w3mhack.el
View
18 ChangeLog
@@ -1,3 +1,21 @@
+2012-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * Makefile.in (install-icons, install-icons30, install-info)
+ (install-info-en, install-info-ja, install-package)
+ (install-package-ja):
+ * doc/Makefile.in (install): Add DESTDIR variable to installation
+ directory.
+
+ * w3mhack.el (w3mhack-expand-file-name): New function.
+ (w3mhack-what-where): Use it.
+
+ * aclocal.m4 (AC_SET_VANILLA_FLAG): Remove --no-unibyte option.
+
+2012-01-02 Elias Pipping <pipping@lavabit.com>
+
+ * Makefile.in (install-lisp): Add DESTDIR variable to installation
+ directory.
+
2011-12-26 Dan Jacobson <jidanni@jidanni.org>
* w3m.el (w3m-gohome): Always reload the home page.
View
54 Makefile.in
@@ -42,6 +42,7 @@ lisp: Makefile
env test ! -f w3m-proc.elc -o w3m-proc.elc -nt w3m-proc.el || $(MAKE) clean
$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-compile
+# `w3mhack-what-where' respects DESTDIR
what-where:
@$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-what-where\
"$(lispdir)" "$(ICONDIR)" "$(PACKAGEDIR)" "$(infodir)"
@@ -62,74 +63,77 @@ install-en: install-lisp install-info-en
install-ja: install-lisp install-info-ja
install-lisp: lisp
- @$(SHELL) $(srcdir)/mkinstalldirs "$(lispdir)";\
+ @$(SHELL) $(srcdir)/mkinstalldirs "$(DESTDIR)$(lispdir)";\
for p in ChangeLog ChangeLog.[1-9] ChangeLog.[1-9][0-9] *.el; do\
if test -f "$$p"; then\
case "$$p" in\
$(IGNORES)) ;;\
w3m-ems\.el) if test -z "$(XEMACSDEBUG)"; then\
- echo "$(INSTALL_DATA) $$p \"$(lispdir)/$$p\"";\
- $(INSTALL_DATA) $$p "$(lispdir)/$$p"; fi;;\
+ echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\
+ $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p"; fi;;\
w3m-xmas\.el) if test -n "$(XEMACSDEBUG)"; then\
- echo "$(INSTALL_DATA) $$p \"$(lispdir)/$$p\"";\
- $(INSTALL_DATA) $$p "$(lispdir)/$$p"; fi;;\
- *) echo "$(INSTALL_DATA) $$p \"$(lispdir)/$$p\"";\
- $(INSTALL_DATA) $$p "$(lispdir)/$$p";;\
+ echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\
+ $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p"; fi;;\
+ *) echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\
+ $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p";;\
esac;\
fi;\
done;\
for p in *.elc; do\
if test -f "$$p"; then\
- echo "$(INSTALL_DATA) $$p \"$(lispdir)/$$p\"";\
- $(INSTALL_DATA) $$p "$(lispdir)/$$p";\
+ echo "$(INSTALL_DATA) $$p \"$(DESTDIR)$(lispdir)/$$p\"";\
+ $(INSTALL_DATA) $$p "$(DESTDIR)$(lispdir)/$$p";\
fi;\
done;\
if test -f shimbun/shimbun.elc; then\
for p in `cd shimbun && echo ChangeLog ChangeLog.[1-9] ChangeLog.[1-9][0-9]`; do\
if test -f "shimbun/$$p"; then\
- echo "$(INSTALL_DATA) shimbun/$$p \"$(lispdir)/s$$p\"";\
- $(INSTALL_DATA) shimbun/$$p "$(lispdir)/s$$p";\
+ echo "$(INSTALL_DATA) shimbun/$$p \"$(DESTDIR)$(lispdir)/s$$p\"";\
+ $(INSTALL_DATA) shimbun/$$p "$(DESTDIR)$(lispdir)/s$$p";\
fi;\
done;\
for p in `cd shimbun && echo *.el`; do\
- echo "$(INSTALL_DATA) shimbun/$$p \"$(lispdir)/$$p\"";\
- $(INSTALL_DATA) shimbun/$$p "$(lispdir)/$$p";\
+ echo "$(INSTALL_DATA) shimbun/$$p \"$(DESTDIR)$(lispdir)/$$p\"";\
+ $(INSTALL_DATA) shimbun/$$p "$(DESTDIR)$(lispdir)/$$p";\
done;\
for p in `cd shimbun && echo *.elc`; do\
- echo "$(INSTALL_DATA) shimbun/$$p \"$(lispdir)/$$p\"";\
- $(INSTALL_DATA) shimbun/$$p "$(lispdir)/$$p";\
+ echo "$(INSTALL_DATA) shimbun/$$p \"$(DESTDIR)$(lispdir)/$$p\"";\
+ $(INSTALL_DATA) shimbun/$$p "$(DESTDIR)$(lispdir)/$$p";\
done;\
fi
install-icons:
@if test "$(ICONDIR)" = NONE; then\
echo "You don't have to install icon files for \"$(EMACS)\".";\
else\
- $(SHELL) $(srcdir)/mkinstalldirs "$(ICONDIR)";\
+ $(SHELL) $(srcdir)/mkinstalldirs "$(DESTDIR)$(ICONDIR)";\
for i in `cd icons && echo *.gif *.png *.xpm`; do\
- echo "$(INSTALL_DATA) icons/$$i \"$(ICONDIR)/$$i\"";\
- $(INSTALL_DATA) icons/$$i "$(ICONDIR)/$$i";\
+ echo "$(INSTALL_DATA) icons/$$i \"$(DESTDIR)$(ICONDIR)/$$i\"";\
+ $(INSTALL_DATA) icons/$$i "$(DESTDIR)$(ICONDIR)/$$i";\
done;\
fi
install-icons30:
@if test "$(ICONDIR)" = NONE; then\
echo "You don't have to install icon files for \"$(EMACS)\".";\
else\
- $(SHELL) $(srcdir)/mkinstalldirs "$(ICONDIR)";\
+ $(SHELL) $(srcdir)/mkinstalldirs "$(DESTDIR)$(ICONDIR)";\
for i in `cd icons30 && echo *.gif *.png *.xpm`; do\
- echo "$(INSTALL_DATA) icons30/$$i \"$(ICONDIR)/$$i\"";\
- $(INSTALL_DATA) icons30/$$i "$(ICONDIR)/$$i";\
+ echo "$(INSTALL_DATA) icons30/$$i \"$(DESTDIR)$(ICONDIR)/$$i\"";\
+ $(INSTALL_DATA) icons30/$$i "$(DESTDIR)$(ICONDIR)/$$i";\
done;\
fi
install-info: info
+ @echo "cd doc && $(MAKE) EMACS=\"$(EMACS)\" infodir=\"$(DESTDIR)$(infodir)\" install";\
cd doc && $(MAKE) EMACS="$(EMACS)" infodir="$(infodir)" install
install-info-en: info-en
+ @echo "cd doc && $(MAKE) EMACS=\"$(EMACS)\" infodir=\"$(DESTDIR)$(infodir)\" install-en";\
cd doc && $(MAKE) EMACS="$(EMACS)" infodir="$(infodir)" install-en
install-info-ja: info-ja
+ @echo "cd doc && $(MAKE) EMACS=\"$(EMACS)\" infodir=\"$(DESTDIR)$(infodir)\" install-ja";\
cd doc && $(MAKE) EMACS="$(EMACS)" infodir="$(infodir)" install-ja
install-package:
@@ -140,8 +144,8 @@ install-package:
$(MAKE) lispdir="$(PACKAGEDIR)/lisp/w3m" install-lisp;\
$(MAKE) ICONDIR="$(PACKAGEDIR)/etc/images/w3m" install-icons30;\
$(MAKE) infodir="$(PACKAGEDIR)/info" install-info;\
- echo "$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR)";\
- $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR);\
+ echo "$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR)";\
+ $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR);\
fi
install-package-ja:
@@ -152,8 +156,8 @@ install-package-ja:
$(MAKE) lispdir="$(PACKAGEDIR)/lisp/w3m" install-lisp;\
$(MAKE) ICONDIR="$(PACKAGEDIR)/etc/images/w3m" install-icons30;\
$(MAKE) infodir="$(PACKAGEDIR)/info" install-info-ja;\
- echo "$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR)";\
- $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(PACKAGEDIR);\
+ echo "$(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR)";\
+ $(XEMACSDEBUG)$(EMACS) $(FLAGS) -f w3mhack-make-package $(DESTDIR)$(PACKAGEDIR);\
fi
Makefile: Makefile.in config.status
View
2 aclocal.m4
@@ -2,7 +2,7 @@ AC_DEFUN(AC_SET_VANILLA_FLAG,
[dnl Determine arguments to run Emacs as vanilla.
retval=`echo ${EMACS}| ${EGREP} xemacs| ${EGREP} -v '^$'`
if test -z "${retval}"; then
- VANILLA_FLAG="-q -no-site-file --no-unibyte"
+ VANILLA_FLAG="-q -no-site-file"
else
VANILLA_FLAG="-vanilla"
fi
View
20 doc/Makefile.in
@@ -68,25 +68,25 @@ emacs-w3m-ja.info: version.texi emacs-w3m-ja.texi
esac
install: $(INFO_DEPS)
- $(SHELL) $(top_srcdir)/mkinstalldirs "$(infodir)"
+ $(SHELL) $(top_srcdir)/mkinstalldirs "$(DESTDIR)$(infodir)"
@for file in $(INFO_DEPS); do\
if test -f $$file; then\
- for old in `cd "$(infodir)" && echo $$file-[0-9]`; do\
- if test -f "$(infodir)/$$old"; then\
- echo "rm -f \"$(infodir)/$$old\"";\
- rm -f "$(infodir)/$$old";\
+ for old in `cd "$(DESTDIR)$(infodir)" && echo $$file-[0-9]`; do\
+ if test -f "$(DESTDIR)$(infodir)/$$old"; then\
+ echo "rm -f \"$(DESTDIR)$(infodir)/$$old\"";\
+ rm -f "$(DESTDIR)$(infodir)/$$old";\
fi;\
done;\
- echo "$(INSTALL_DATA) $$file \"$(infodir)/$$file\"";\
- $(INSTALL_DATA) $$file "$(infodir)/$$file";\
+ echo "$(INSTALL_DATA) $$file \"$(DESTDIR)$(infodir)/$$file\"";\
+ $(INSTALL_DATA) $$file "$(DESTDIR)$(infodir)/$$file";\
else : ; fi;\
done
@if $(SHELL) -c $(INSTALL_INFO)' --version| sed 1q\
| fgrep -s -v -i debian'>/dev/null 2>&1; then\
for file in $(INFO_DEPS); do\
- if test -f "$(infodir)/$$file"; then\
- echo "$(INSTALL_INFO) --info-dir=\"$(infodir)\" \"$(infodir)/$$file\"";\
- $(INSTALL_INFO) --info-dir="$(infodir)" "$(infodir)/$$file" || :;\
+ if test -f "$(DESTDIR)$(infodir)/$$file"; then\
+ echo "$(INSTALL_INFO) --info-dir=\"$(DESTDIR)$(infodir)\" \"$(DESTDIR)$(infodir)/$$file\"";\
+ $(INSTALL_INFO) --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$file" || :;\
else : ; fi\
done;\
else : ; fi
View
23 w3mhack.el
@@ -1,6 +1,6 @@
;;; w3mhack.el --- a hack to setup the environment for building w3m
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2001-2010, 2012
;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
@@ -701,12 +701,25 @@ to remove some obsolete variables in the first argument VARLIST."
(function directory-file-name)
(nreverse paths) ":")))))
+;; FIXME: How to do it for Windows?
+(defun w3mhack-expand-file-name (name destdir)
+ "Convert filename NAME to the one relative to DESTDIR."
+ (if (and name destdir
+ (eq (aref name 0) ?/)) ;; Not "NONE"?
+ (expand-file-name (substring name 1) destdir)
+ name))
+
(defun w3mhack-what-where ()
"Show what files should be installed and where should they go."
- (let ((lisp-dir (pop command-line-args-left))
- (icon-dir (pop command-line-args-left))
- (package-dir (pop command-line-args-left))
- (info-dir (pop command-line-args-left)))
+ (let* ((destdir (getenv "DESTDIR"))
+ (lisp-dir (w3mhack-expand-file-name (pop command-line-args-left)
+ destdir))
+ (icon-dir (w3mhack-expand-file-name (pop command-line-args-left)
+ destdir))
+ (package-dir (w3mhack-expand-file-name (pop command-line-args-left)
+ destdir))
+ (info-dir (w3mhack-expand-file-name (pop command-line-args-left)
+ destdir)))
(message "
lispdir=%s
ICONDIR=%s

0 comments on commit 331dad1

Please sign in to comment.
Something went wrong with that request. Please try again.