-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
157 lines (126 loc) · 4.01 KB
/
Makefile
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# Makefile responsible for token substitutions,
# and localisation of user-mediated edition.
#
# WikiTeX: expansible LaTeX module for MediaWiki
# Copyright (C) 2004-6 Peter Danenberg
#
# WikiTeX is licensed under the Artistic License 2.0; to
# view a copy of this license, see COPYING or visit:
#
# http://dev.perl.org/perl6/rfc/346.html
#
# Edit the following parameters:
# Required programs
# Full path to LaTeX:
LATEX = /usr/bin/latex
# Full path to dvipng:
DVIPNG = /usr/bin/dvipng
# Full path to ImageMagick's mogrify:
MOGRIFY = /usr/bin/mogrify
# Full path to ImageMagick's convert:
CONVERT = /usr/bin/convert
# Optional programs
# Full path to LilyPond (music):
LILYPOND = /usr/bin/lilypond
# Full path to Gnuplot (graph):
GNUPLOT = /usr/bin/gnuplot
# Full path to Graphviz' dot (graph):
DOT = /usr/local/bin/dot
# Full path to Graphviz' neato (graph):
NEATO = /usr/local/bin/neato
# Full path to Graphviz' fdp (graph):
FDP = /usr/local/bin/fdp
# Full path to Graphviz' twopi (graph):
TWOPI = /usr/local/bin/twopi
# Full path to Graphviz' circo (graph):
CIRCO = /usr/local/bin/circo
# Full path to sgf2dg (go):
SGF2DG = /usr/bin/sgf2dg
# Full path to TeX (go):
TEX = /usr/bin/tex
# Full path to MetaPost (feyn):
METAPOST = /usr/bin/mpost
# Quota
# Partition on which disk quota resides
PARTITION = /dev/hda3
# Cron
# Full path to wikitex-decruft.sh:
DECRUFT = /path/to/mediawiki/extensions/wikitex/wikitex-decruft.sh
# Database:
DATABASE = wikidb
# Database user:
DBUSER = wikiuser
# Database password (escape any @'s as \@):
DBPASS = password
# Who should receive cron's results (can be blank)
MAILTO = root
# Sudo
# Web server's user:
APACHE = nobody
# WikiTeX's user:
WIKITEX = wikitex
# WikiTeX's host:
HOST = localhost, $(shell hostname)
# End of editable parameters
VERSION = 1.1 BETA 3
SED = sed -e "s@\%VERSION\%@${VERSION}@g;"
GROFF = copying.inc.ms | groff -t -ms -Tascii - >
SUDO = -e "s@\%APACHE\%@${APACHE}@g; s@\%WIKITEX\%@${WIKITEX}@g; s@\%HOST\%@${HOST}@g;s@\%LATEX\%@${LATEX}@g; s@\%DVIPNG\%@${DVIPNG}@g; s@\%MOGRIFY\%@${MOGRIFY}@g; s@\%CONVERT\%@${CONVERT}@g; s@\%LILYPOND\%@${LILYPOND}@g; s@\%GNUPLOT\%@${GNUPLOT}@g; s@\%DOT\%@${DOT}@g; s@\%NEATO\%@${NEATO}@g; s@\%FDP\%@${FDP}@g; s@\%TWOPI\%@${TWOPI}@g; s@\%CIRCO\%@${CIRCO}@g; s@\%SGF2DG\%@${SGF2DG}@g; s@\%TEX\%@${TEX}@g; s@\%METAPOST\%@${METAPOST}@g;"
CRON = -e "s@\%DECRUFT\%@${DECRUFT}@g; s@\%DATABASE\%@${DATABASE}@g; s@\%DBUSER\%@${DBUSER}@g; s@\%DBPASS\%@${DBPASS}@g;"
QUOTA = -e "s@\%PARTITION\%@${PARTITION}@g;"
AUDIT = ${SUDO} ${CRON} ${QUOTA}
EXEC = chmod a+x
DOCS = README NEWS COPYING MANIFEST THANKS
PHPS = Wikitex.php WikitexConstants.php main.php wikitex.ini
PROGS = wikitex.sudoers wikitex.cron wikitex-decruft.sh wikitex-audit.sh wikitex-texmf
all: docs progs
docs: ${DOCS}
progs: ${PHPS} ${PROGS}
README: readme.ms
${SED} ${?} ${GROFF} ${@}
NEWS: news.ms
${SED} ${?} ${GROFF} ${@}
COPYING: copying.ms
${SED} ${?} ${GROFF} ${@}
MANIFEST: manifest.ms
${SED} ${?} ${GROFF} ${@}
THANKS: thanks.ms
${SED} ${?} ${GROFF} ${@}
Wikitex.php: Wikitex.in.php
${SED} ${?} > ${@}
WikitexConstants.php: WikitexConstants.in.php
${SED} ${?} > ${@}
main.php: main.in.php
${SED} ${?} > ${@}
wikitex.ini: wikitex.in.ini
${SED} ${?} > ${@}
docs:
phpdoc -c wikitex
# Forced to forgo ${?} in the following,
# as a change in Makefile can trigger
# recompilation.
${PROGS}: Makefile
wikitex.sudoers: wikitex.in.sudoers
${SED} ${SUDO} wikitex.in.sudoers > ${@}
chmod 440 ${@}
cp -af ${@} /etc/sudoers.d/wikitex
wikitex.cron: wikitex.in.cron
${SED} ${CRON} wikitex.in.cron > ${@}
cp -af ${@} /etc/cron.daily/wikitex
wikitex-decruft.sh: wikitex-decruft.in.sh
${SED} ${CRON} wikitex-decruft.in.sh > ${@}; \
${EXEC} ${@}
wikitex-audit.sh: wikitex-audit.in.sh
${SED} ${AUDIT} wikitex-audit.in.sh > ${@}; \
${EXEC} ${@}
wikitex-texmf:
echo "shell_escape = f" >${@}
echo "openout_any = p" >>${@}
echo "openin_any = p" >>${@}
cp -af ${@} /etc/texmf/texmf.d/04wikitex.cnf
update-texmf
clean-docs:
rm -frv ${DOCS}
clean-progs:
rm -frv ${PROGS} ${PHPS}
clean: clean-progs