summaryrefslogtreecommitdiff
path: root/language/thai/thailatex/emacs/Makefile.am
blob: c11e8cbe8302658d67678cdf49f452b1711c91ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
EXTRA_DIST = thai-latex-setup.el

emacslispdir = $(emacsdir)/site-lisp
emacslisp_DATA = thai-latex-setup.el

EMACS_SITE_START=$(DESTDIR)$(emacslispdir)/site-start.el

if ENABLE_HOOKS

install-data-hook:
	@if test -z "$(DESTDIR)" ; then                                       \
	  if [ -f $(EMACS_SITE_START) ] ; then                                \
	    $(SED) -e '/thai-latex-setup/d' $(EMACS_SITE_START)               \
	      > /tmp/tmp.$$$$ ;                                               \
	    mv /tmp/tmp.$$$$ $(EMACS_SITE_START) ;                            \
	  fi ;                                                                \
	  echo '(load-library "thai-latex-setup")' >> $(EMACS_SITE_START) ;   \
	else                                                                  \
	  echo "***" ;                                                        \
	  echo "*** Warning: Emacs site-start.el not patched" ;               \
	  echo "***" ;                                                        \
	  echo "*** update the file on the target system" ;                   \
	  echo "*** using 'sync-thailatex install'" ;                         \
	  echo "***" ;                                                        \
	fi


uninstall-hook:
	if [ -f $(EMACS_SITE_START) ] ; then \
	  $(SED) -e '/thai-latex-setup/d' $(EMACS_SITE_START) \
	    > /tmp/tmp.$$$$ ; \
	  mv /tmp/tmp.$$$$ $(EMACS_SITE_START) ; \
	  [ -s $(EMACS_SITE_START) ] || rm -f $(EMACS_SITE_START) ; \
	fi

endif # ENABLE_HOOKS