summaryrefslogtreecommitdiff
path: root/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-20-TL-install-dirs
blob: 5ffca2472602dae83813e1e676cd77a57448dd41 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
	Installation paths for TL and standalone builds.

	ToDo:
	Determination of libdir and moduledir in the xindy perl script.

diff -ur -x Makefile.in xindy.orig/configure.ac xindy/configure.ac
--- xindy.orig/configure.ac	2009-12-03 11:52:02.000000000 +0100
+++ xindy/configure.ac	2009-12-03 11:59:47.000000000 +0100
@@ -35,6 +35,11 @@
 # programs, automake's defaults are not usable for us, too.
 AM_INIT_AUTOMAKE([foreign no-define])
 
+# Installation directories for standalone xindy.
+memdir='$(pkglibdir)'
+AC_SUBST([memdir])
+AM_CONDITIONAL([TEXLIVE_BUILD], [false])
+
 # Test for building make-rules
 AC_ARG_ENABLE(make-rules, AS_HELP_STRING([--enable-make-rules ],[build and install make-rules package (default is YES)]),[BUILDRULES=$enableval],[BUILDRULES=yes])
 test "$BUILDRULES" = "yes"  &&  AC_PROG_LATEX
@@ -56,6 +61,7 @@
 # FIXME: lex actually must really be flex. But there is no AC_PROG_FLEX!?
 AC_PROG_LEX
 AC_PROG_CC
+AC_PROG_LN_S
 
 # Check system type
 AC_CANONICAL_HOST
diff -ur -x Makefile.in xindy.orig/src/Makefile.am xindy/src/Makefile.am
--- xindy.orig/src/Makefile.am	2009-12-03 11:53:59.000000000 +0100
+++ xindy/src/Makefile.am	2009-12-03 12:00:48.000000000 +0100
@@ -26,7 +26,7 @@
 
 # Automake has no CLISP support; moreover xindy.mem is not a binary
 # to be stripped upon 'make install-strip'.  We define it as DATA.
-pkglib_DATA = xindy.mem
+mem_DATA = xindy.mem
 
 # Tell the dist target about our sources, define the object files for
 # our own rule and the .lib files for the clean definition. Don't use
diff -ur -x Makefile.in xindy.orig/user-commands/Makefile.am xindy/user-commands/Makefile.am
--- xindy.orig/user-commands/Makefile.am	2009-12-03 01:31:28.000000000 +0100
+++ xindy/user-commands/Makefile.am	2009-12-03 11:59:47.000000000 +0100
@@ -20,7 +20,39 @@
 ## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ## Boston, MA 02110-1301 USA.
 
-bin_SCRIPTS = texindy xindy xindy.v2
+scripts = texindy xindy
+
+if TEXLIVE_BUILD
+bin_SCRIPTS =
+noinst_SCRIPTS = $(scripts)
+scriptspath = texmf/scripts/xindy
+scriptsdir = ${prefix}/$(scriptspath)
+install-exec-hook: $(scripts)
+	$(MKDIR_P) "$(DESTDIR)$(scriptsdir)"
+	@for f in $(scripts); do \
+	  $(INSTALL_SCRIPT) `test -f "$$f" || echo "$(srcdir)/"`$$f $(DESTDIR)$(scriptsdir)/$$f.pl; \
+	done
+	case "$(bindir)" in \
+	  */bin) $(MAKE) $(AM_MAKEFLAGS) REL=.. install-links;; \
+	  */bin/*) $(MAKE) $(AM_MAKEFLAGS) REL=../.. install-links;; \
+	  *) echo "strange directory '$(bindir)' for linked scripts" >&2; \
+	     exit 1;; \
+	esac
+install-links:
+	@cd $(DESTDIR)$(bindir) && \
+	for f in $(scripts); do \
+	  rm -f $$f; \
+	  echo "creating link '$$f -> '$(REL)/$(scriptspath)/$$f.pl"; \
+	  $(LN_S) $(REL)/$(scriptspath)/$$f.pl $$f; \
+	done
+uninstall-hook:
+	@for f in $(scripts); do \
+	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	  rm -f $(DESTDIR)$(scriptsdir)/$$f.pl; \
+	done
+else !TEXLIVE_BUILD
+bin_SCRIPTS = $(scripts) xindy.v2
+endif !TEXLIVE_BUILD
 
 xindy: xindy.in Makefile
 	sed -e 's:@libdir\@:$(libdir):' $(srcdir)/xindy.in >xindy