File: configure

package info (click to toggle)
latex-make 2.1.19-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 464 kB
  • ctags: 45
  • sloc: makefile: 216; sh: 147
file content (108 lines) | stat: -rwxr-xr-x 2,486 bytes parent folder | download
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash

print-TDS() { # 1:starttoken
	declare -a loc
	declare -a home
	declare -a mid
	declare -a end
	declare -a all
	
	while read dir; do
		dir="$dir/"
		motif="//"
		rep="/"
		dir2="${dir/$motif/$rep}"
		while test "$dir2" != "$dir"; do
			dir="$dir2"
			dir2=${dir/$motif/$rep}
		done
		motif="/./"
		rep="/"
		dir2="${dir/$motif/$rep}"
		while test "$dir2" != "$dir"; do
			dir="$dir2"
			dir2=${dir/$motif/$rep}
		done
		dir2="$(echo "$dir" | sed -e 's,[^/]\+/\.\./,,')"
		while test "$dir2" != "$dir"; do
			dir="$dir2"
			dir2="$(echo "$dir" | sed -e 's,[^/]\+/\.\./,,')"
		done
		dir="${dir%/}"
		case "$dir" in
		"") ;;
		*"/."*) end=("${end[@]}" "$dir");;
		*"/local/"*) loc=("${loc[@]}" "$dir");;
		*"/etc/"*) end=("${end[@]}" "$dir");;
		*"/var/"*) end=("${end[@]}" "$dir");;
		"${HOME}"*) home=("${home[@]}" "$dir");;
		*) mid=("${mid[@]}" "$dir");;
		esac
	done < <(kpsepath tex \
		| tr ':' '\n' \
		| sed -e 's/^!!//' -e 's,/*$,,' \
		| sed -e 's,/tex$,,p;d')
	
	trie() {
		local -a var
		eval 'var=( "${'"$1"'[@]}" )'
		for d in "${var[@]}"; do
			echo $d
		done | sort
	}
	
	OLD_IFS="$IFS"
	IFS="
	"
	all=( $(trie loc) $(trie mid) $(trie home) $(trie end) )
	IFS="$OLD_IFS"
	
	for dir in "${all[@]}"; do
		flags="    "
		if [ -e "$dir" ]; then
			if [ ! -w "$dir" ]; then
				flags="[R] "
			fi
		else
			flags="[U] "
		fi
		echo "$1$flags$dir"
	done 
}

cat <<EOF
When installing LaTeX-Make, two paths must be chosen:
* prefix:
  The 'LaTeX.mk' file will be installed into \${prefix}/include. If you use a
  directory where your GNU-Make look for included files, you will be able to
  just put 'include LaTeX.mk' into your Makfiles.
    By default, LaTeX-Make use the '/usr/local' prefix, so 'LaTeX.mk' will
  be installed into '/usr/local/include'.

* texmf_prefix:
  This is the base TeX tree (TeX Directory Structure) in which all LaTeX files
  will be installed. By default, this is '\${prefix}/share/texmf' but a list
  of such directories configurated on this system is provided below.
  One of them should probably be used.

Valid texmf_prefix values on this system:
=========================================
EOF
print-TDS "  "
cat <<EOF

Flags meaning:
  [U]: unexistant but configurated TDS, will be created if choosen
  [R]: read-only TDS. Use 'sudo' for 'make install' is choosen

You can now run:
================
    make
    make check #optional
    [sudo] make install prefix=PREFIX texmf_prefix=TDS

with PREFIX and TDS correctly choosen

EOF