home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fs.zip / octave / kpathsea / doc / install.tex < prev    next >
Text File  |  2000-01-15  |  44KB  |  1,215 lines

  1. @ifclear version
  2. @defcodeindex cm
  3. @defcodeindex fl
  4. @defcodeindex op
  5. @end ifclear
  6.  
  7. @node Installation
  8. @chapter Installation
  9.  
  10. @cindex installation
  11. @cindex configuration
  12. @cindex compilation
  13.  
  14. @ifset version
  15. (A copy of this chapter is in the distribution file @file{kpathsea/INSTALL}.)
  16. @end ifset
  17.  
  18. The procedure for Kpathsea (and Web2c, etc.) configuration and
  19. installation follows.  If you encounter trouble, see @ref{Common
  20. problems}, a copy of which is in the file @file{kpathsea/BUGS}.
  21.  
  22. @menu
  23. * Simple installation::      If you just want to do it.
  24. * Custom installation::      If you want to change things around.
  25. * Security::                 Who can write what files, etc.
  26. * TeX directory structure::  Managing the horde of TeX input files.
  27. * unixtex.ftp::              Getting software via FTP, on CD-ROM, or on tape.
  28. * Reporting bugs::           Where and how to report bugs.
  29. @end menu
  30.  
  31.  
  32. @node Simple installation
  33. @section Simple installation
  34.  
  35. @cindex simple installation
  36. @cindex installation, simple
  37.  
  38. @cindex precompiled executables, instead of installation
  39. @cindex installation, getting executables instead of
  40. Installing @TeX{} and friends for the first time can be a daunting
  41. experience.  Thus, you may prefer to skip this whole thing and just get
  42. precompiled executables: see @ref{unixtex.ftp}.
  43.  
  44. This section explains what to do if you wish to take the defaults for
  45. everything, and generally to install in the simplest possible way.  Most
  46. steps here refer to corresponding subsection in the next section which
  47. explains how to override defaults and generally gives more details.
  48.  
  49. By default everything will be installed under @file{/usr/local} and the
  50. following discussion assumes this.  However, if you already have @TeX{}
  51. installed, its location is used to derive the directory under which
  52. everything is to be installed.
  53.  
  54. @enumerate
  55. @item
  56. Be sure you have enough disk space: approximately 8 megabytes for the
  57. compressed archives, 15MB for sources, 45MB for compilation, 40MB for
  58. the (initial) installed system (including library files).  @xref{Disk
  59. space}.
  60.  
  61. @item
  62. Retrieve these two distribution archives:
  63. @table @url
  64. @item ftp://ftp.tug.org/tex/texk.tar.gz
  65. These are the sources, which you will be compiling. 
  66.  
  67. @item ftp://ftp.tug.org/tex/texmflib.tar.gz
  68. This is a basic set of input files.  You should unpack it in the
  69. directory @file{/usr/local/share}; doing so will create a @file{texmf}
  70. subdirectory there.
  71. @end table
  72.  
  73. @noindent @xref{Kpathsea application distributions}.
  74.  
  75. @item
  76. When using the default search paths, there is no need to edit any
  77. distribution files. @xref{Changing search paths}.
  78.  
  79. @item
  80. At the top level of the distribution, run @samp{sh configure}.  (If you
  81. have the GNU Bash shell installed, run @samp{bash configure}.)
  82. @xref{Running configure}.
  83.  
  84. @item
  85. @samp{make}. @xref{Running make}.  If you are using a BSD 4.4 system
  86. such as FreeBSD or NetBSD, use GNU make (often installed in
  87. @file{/usr/local/bin}), not the BSD make.
  88.  
  89. If you are using a HP-UX 10 system and the native compiler, specify the
  90. @samp{+u} flag in @code{XCFLAGS}.
  91.  
  92. @item 
  93. @samp{make install}. @xref{Installing files}.
  94.  
  95. @item
  96. @samp{make distclean}. @xref{Cleaning up}.
  97.  
  98. @item
  99. Set up a cron job to rebuild the filename database that makes searching
  100. faster.  This line will rebuild it every midnight:
  101. @example
  102. 0 0 * * * cd /usr/local/share/texmf && @var{/bindir}/mktexlsr
  103. @end example
  104. @xref{Filename database generation}, and @ref{Filename database}.
  105.  
  106. @item
  107. @cindex printer configuration files
  108. @cindex PostScript fonts, additional
  109. @cindex color printers, configuring
  110. If you're installing Dvips, you also need to set up configuration files
  111. for your printers and make any additional PostScript fonts available.
  112. @xref{Installation,,, dvips, Dvips}.  If you have any color printers,
  113. see @ref{Color device configuration,,, dvips, Dvips}.
  114.  
  115. @item
  116. The first time you run a DVI driver, a bunch of PK fonts will be built
  117. by Metafont via @code{mktexpk} (and added to the filename database).
  118. This will take some time.  Don't be alarmed; they will created only this
  119. first time (unless something is wrong with your path definitions).
  120.  
  121. By default, @code{mktexpk} will create these fonts in a hierarchy
  122. under @file{/var/tmp/texfonts}; it simply assumes that @file{/var/tmp}
  123. exists and is globally writable.  If you need a different arrangement,
  124. see @ref{mktex configuration}.
  125.  
  126. @xref{mktex scripts}.
  127.  
  128. @item
  129. @cindex fonts, being created
  130. @pindex mktexpk @r{, initial runs}
  131. @cindex tests, simple
  132. For some simple tests, try @samp{tex story \\bye} and @samp{latex
  133. sample2e}.  Then run @file{xdvi story} or @file{dvips sample2e} on the
  134. resulting DVI files to preview/print the documents.  @xref{Installation
  135. testing}.
  136. @end enumerate
  137.  
  138.  
  139. @node Custom installation
  140. @section Custom installation
  141.  
  142. @cindex custom installation
  143. @cindex installation, customized
  144.  
  145. Most sites need to modify the default installation procedure in some
  146. way, perhaps merely changing the prefix from @samp{/usr/local}, perhaps
  147. adding extra compiler or loader options to work around @code{configure}
  148. bugs.  This section explains how to override default choices.  For
  149. additional distribution-specific information:
  150. @itemize @bullet
  151. @item @file{dviljk/INSTALL}.
  152. @item @xref{Installation,,,dvips,Dvips}.
  153. @item @xref{Installation,,,web2c,Web2c}.
  154. @item @file{xdvik/INSTALL}.
  155. @end itemize
  156.  
  157. @cindex non-Unix operating systems
  158. @cindex Amiga support
  159. @cindex DOS support
  160. @cindex OS/2 support
  161. @cindex VMS support
  162. These instructions are for Unix systems.  Other operating-system
  163. specific distributions have their own instructions.  The code base
  164. itself supports Amiga, DOS, OS/2, and VMS.
  165.  
  166.  
  167. Following are the same steps as in the previous section (which describes
  168. the simplest installation), but with much more detail.
  169.  
  170. @menu
  171. * Disk space::                          
  172. * Kpathsea application distributions::  
  173. * Changing search paths::               
  174. * Running configure::                   
  175. * Running make::                        
  176. * Installing files::                    
  177. * Cleaning up::                         
  178. * Filename database generation::        
  179. * mktex scripts::                     
  180. * Installation testing::               
  181. @end menu
  182.  
  183.  
  184. @node Disk space
  185. @subsection Disk space
  186.  
  187. @cindex disk space, needed
  188. @cindex total disk space
  189. @cindex size of distribution archives
  190. Here is a table showing the disk space needed for each distribution
  191. (described in the next section).  The `(totals)' line reflects the
  192. @samp{texk} source distribution and @samp{texmflib}; the individual
  193. distributions don't enter into it.  Sizes are in megabytes.  All numbers
  194. are approximate.
  195.  
  196. @multitable {distribution} {.tar.gz} {unpacked} {compiled} {installed}
  197. @item Distribution @tab .tar.gz @tab Unpacked @tab Compiled @tab Installed
  198. @item dviljk   @tab   .9 @tab  3.8 @tab
  199. @item dvipsk   @tab   .9 @tab  3.2 @tab
  200. @item xdvik    @tab   .7 @tab  2.5 @tab
  201. @item web2c    @tab  1.3 @tab  5.0 @tab
  202. @item web      @tab  1.9 @tab  6.5 @tab    - @tab -
  203. @item texk     @tab  3.8 @tab 14.1 @tab 43.1 @tab 23.5
  204. @item texmflib @tab  3.8 @tab 15.0 @tab    - @tab 15.0
  205. @item (totals) @tab  7.6 @tab 29.1 @tab 43.1 @tab 38.5
  206. @end multitable
  207.  
  208.  
  209. @node Kpathsea application distributions
  210. @subsection Kpathsea application distributions
  211.  
  212. @cindex distributions, compiling simultaneously
  213. @cindex version number, of Kpathsea
  214. @cindex Kpathsea version number
  215.  
  216. @cindex distributions, not compiling
  217. @cindex NeXT, lacking X11
  218. @cindex X11, lacking on NeXT
  219. The archive @url{ftp://ftp.tug.org/tex/texk.tar.gz} contains all of the
  220. Kpathsea applications I maintain, and the library itself.  For example,
  221. since NeXT does not generally support X11, you'd probably want to skip
  222. @samp{xdvik} (or simply remove it after unpacking @file{texk.tar.gz}.
  223. If you are not interested in all of them, you can also retrieve them
  224. separately:
  225.  
  226. @cindex DVI drivers
  227. @table @file
  228. @item dviljk.tar.gz
  229. @cindex PCL driver
  230. @cindex LaserJet drive
  231. DVI to PCL, for LaserJet printers.
  232.  
  233. @item dvipsk.tar.gz
  234. @cindex PDF generation
  235. @cindex PostScript driver
  236. DVI to PostScript, for previewers, printers, or PDF generation.
  237.  
  238. @item web2c.tar.gz
  239. The software needed to compile @TeX{} and friends.
  240.  
  241. @item web.tar.gz
  242. The original WEB source files, also used in compilation.
  243.  
  244. @item xdvik.tar.gz
  245. @cindex X11 previewer
  246. DVI previewing under the X window system.
  247.  
  248. @end table
  249.  
  250. @cindex Babel
  251. @cindex non-English typesetting
  252. If you want to use the Babel La@TeX{} package for support of non-English
  253. typesetting, you may need to retrieve additional files.  See the file
  254. @file{install.txt} in the Babel distribution.
  255.  
  256.  
  257. @node Changing search paths
  258. @subsection Changing search paths
  259.  
  260. @cindex search paths, changing default
  261. @cindex paths, changing default
  262. @flindex texmf.in@r{, editing}
  263. If the search paths for your installation differ from the standard
  264. @TeX{} directory structure (@pxref{Top,, Introduction, tds, A Directory
  265. Structure for @TeX{} files}), edit the file @file{kpathsea/texmf.in}
  266. as desired, before running @code{configure}.  For example, if you have
  267. all your fonts or macros in one big directory.
  268.  
  269. You may also wish to edit the file @file{mktex.cnf}, either before or
  270. after installation, to control various aspects of @code{mktexpk} and
  271. friends.  @xref{mktex configuration}.
  272.  
  273. You do not need to edit @file{texmf.in} to change the default
  274. top-level or other installation @emph{directories} (only the paths).
  275. You can and should do that when you run @code{configure} (next step).
  276.  
  277. You also do not need to edit @file{texmf.in} if you are willing to
  278. rely on @file{texmf.cnf} at runtime to define the paths, and let the
  279. compile-time default paths be incorrect.  Usually there is no harm in
  280. doing this.
  281.  
  282. The section below explains default generation in more detail.
  283.  
  284. @menu
  285. * Default path features::       
  286. * Default path generation::     
  287. @end menu
  288.  
  289.  
  290. @node Default path features
  291. @subsubsection Default path features
  292.  
  293. @cindex default path features
  294. @cindex features, of default paths
  295.  
  296. The purpose of having all the different files described in the section
  297. above is to avoid having the same information in more than one place. If
  298. you change the installation directories or top-level prefix at
  299. @code{configure}-time, those changes will propagate through the whole
  300. sequence.  And if you change the default paths in @file{texmf.in},
  301. those changes are propagated to the compile-time defaults.
  302.  
  303. The Make definitions are all repeated in several @t{Makefile}'s; but
  304. changing the top-level @file{Makefile} should suffice, as it passes down
  305. all the variable definitions, thus overriding the submakes.  (The
  306. definitions are repeated so you can run Make in the subdirectories, if
  307. you should have occasion to.)
  308.  
  309. @vindex MAKETEX_MODE
  310. @cindex paths, device name included in
  311. By default, the bitmap font paths end with @samp{/$MAKETEX_MODE}, thus
  312. including the device name (usually a Metafont mode name such as
  313. @samp{ljfour}).  This distinguishes two different devices with the same
  314. resolution---a write/white from a write/black 300@dmn{dpi} printer, for
  315. example.
  316.  
  317. @findex kpse_init_prog@r{, and @code{MAKETEX_MODE}}
  318. @flindex proginit.c
  319. However, since most sites don't have this complication, Kpathsea
  320. (specifically, the @code{kpse_init_prog} function in
  321. @file{kpathsea/proginit.c}) has a special case: if the mode has not been
  322. explicitly set by the user (or in a configuration file), it sets
  323. @code{MAKETEX_MODE} to @code{/}.  This makes the default PK path, for
  324. example, expand into @code{@dots{}/pk//}, so fonts will be found even if
  325. there is no subdirectory for the mode (if you arranged things that way
  326. because your site has only one printer, for example) or if the program
  327. is mode-independent (e.g., @code{pktype}).
  328.  
  329. To make the paths independent of the mode, simply edit
  330. @file{texmf.in} before installation, or the installed
  331. @file{texmf.cnf}, and remove the @samp{$MAKETEX_MODE}.
  332.  
  333. @xref{mktex script arguments}, for how this interacts with @code{mktexpk}.
  334.  
  335. @flindex HIER
  336. @flindex kpathsea/HIER
  337. @xref{TeX directory structure,, @TeX{} directory structure}, for a
  338. description of the default arrangement of the input files that comprise
  339. the @TeX{} system.  The file @file{kpathsea/HIER} is a copy of that
  340. section.
  341.  
  342.  
  343. @node Default path generation
  344. @subsubsection Default path generation
  345.  
  346. @cindex default paths, changing
  347. @cindex paths, changing default
  348. @cindex installation, changing default directories
  349. @cindex directories, changing default installation
  350.  
  351. This section describes how the default paths are constructed.
  352.  
  353. You may wish to ignore the whole mess and simply edit @file{texmf.cnf}
  354. after it is installed, perhaps even copying it into place beforehand so
  355. you can complete the installation, if it seems necessary.
  356.  
  357. @cindex default paths, how they're made
  358. To summarize the chain of events that go into defining the default paths:
  359.  
  360. @enumerate
  361. @item
  362. @samp{configure} creates a @file{Makefile} from each @file{Makefile.in}.
  363.  
  364. @item
  365. @flindex texmf.sed
  366. When Make runs in the @file{kpathsea} directory, it creates a file
  367. @file{texmf.sed} that substitutes the Make value of @code{$(var)} for a
  368. string @code{@@var@@}.  The variables in question are the one that
  369. define the installation directories.
  370.  
  371. @item
  372. @flindex texmf.in
  373. @flindex texmf.cnf@r{, generated}
  374. @file{texmf.sed} (together with a little extra magic---see
  375. @file{kpathsea/Makefile}) is applied to @file{texmf.in} to generate
  376. @file{texmf.cnf}.  This is the file that will eventually be installed
  377. and used.
  378.  
  379. @item
  380. @flindex paths.h
  381. The definitions in @file{texmf.cnf} are recast as C @code{#define}'s in
  382. @file{paths.h}.  These values will be the compile-time defaults; they
  383. are not used at runtime unless no @file{texmf.cnf} file can be found.
  384.  
  385. (That's a lie: the compile-time defaults are what any extra @t{:}'s in
  386. @file{texmf.cnf} expand into; but the paths as distributed have no extra
  387. @t{:}'s, and there's no particular reason for them to.)
  388. @end enumerate
  389.  
  390.  
  391. @node Running configure
  392. @subsection Running @code{configure}
  393.  
  394. @flindex configure@r{, running}
  395. @flindex c-auto.in
  396. @flindex Makefile.in
  397. @findex ac_include@r{, Autoconf extension}
  398. @cindex @@@var{var}@@ substitutions
  399. @cindex system dependencies
  400. Run @code{sh configure @var{options}} (in the top-level directory, the
  401. one containing @file{kpathsea/}), possibly using a shell other than
  402. @code{sh} (@pxref{configure shells}).
  403.  
  404. @code{configure} adapts the source distribution to the present system
  405. via @code{#define}'s in @file{*/c-auto.h}, which are created from the
  406. corresponding @file{c-auto.in}.  It also creates a @file{Makefile} from
  407. the corresponding @file{Makefile.in}, doing @samp{@@@var{var}@@} and
  408. @samp{ac_include} substitutions).
  409.  
  410. @flindex README.CONFIGURE
  411. @flindex kpathsea/README.CONFIGURE
  412. @code{configure} is the best place to control the configuration,
  413. compilation, and installed location of the software, either via
  414. command-line options, or by setting environment variables before
  415. invoking it.  For example, you can disable @code{mktexpk} by default
  416. with the option @samp{--disable-mktexpk}.
  417. @xref{configure options}.
  418.  
  419. @menu
  420. * configure shells::            
  421. * configure options::           
  422. * configure environment::
  423. * configure scenarios::         
  424. * Shared library::
  425. @end menu
  426.  
  427.  
  428. @node configure shells
  429. @subsubsection @code{configure} shells
  430.  
  431. @cindex shells and @code{configure}
  432. @pindex bash@r{, recommended for running @code{configure}}
  433.  
  434. If you have Bash, the GNU shell, use it if @code{sh} runs into trouble
  435. (@pxref{Top,,,features,Bash Features}).
  436.  
  437. Most Bourne shell variants other than Bash cannot handle
  438. @code{configure} scripts as generated by GNU Autoconf (@pxref{Top,
  439. Introduction,, autoconf, Autoconf}).  Specifically:
  440. @table @code
  441. @item ksh
  442. @pindex ksh@r{, losing with @code{configure}}
  443. @pindex bsh@r{, ok with @code{configure}}
  444. @cindex Korn shell@r{, losing with @code{configure}}
  445. @cindex AIX shells and @code{configure}
  446. The Korn shell may be installed as @file{/bin/sh} on AIX.
  447. @file{/bin/bsh} may serve instead.
  448.  
  449. @item ash
  450. @pindex ash@r{, losing with @code{configure}}
  451. @cindex NetBSD shells and @code{configure}
  452. @cindex FreeBSD shells and @code{configure}
  453. @cindex Linux shells and @code{configure}
  454. Ash is sometimes installed as @file{/bin/sh} on NetBSD, FreeBSD, and
  455. Linux systems.  @file{/bin/bash} should be available.
  456.  
  457. @item @r{Ultrix} /bin/sh
  458. @cindex DEC shells and @code{configure}
  459. @cindex Ultrix shells and @code{configure}
  460. @pindex sh5@r{, ok with @code{configure}}
  461. @file{/bin/sh} under Ultrix is a DEC-grown shell that is notably
  462. deficient in many ways.  @file{/bin/sh5} may be necessary.
  463. @end table
  464.  
  465.  
  466. @node configure options
  467. @subsubsection @code{configure} options
  468.  
  469. @cindex @code{configure} options
  470.  
  471. For a complete list of all @code{configure} options, run @samp{configure
  472. --help} or see @ref{Invoking configure,, Running @code{configure} scripts,
  473. autoconf, Autoconf}, (a copy is in the file @file{kpathsea/README.CONFIGURE}).
  474. The generic options are listed first in the @samp{--help} output, and
  475. the package-specific options come last.  The environment variables
  476. @code{configure} pays attention to are listed below.
  477.  
  478. Options particularly likely to be useful are @samp{--prefix},
  479. @samp{--datadir}, and the like; see @ref{configure scenarios}.
  480.  
  481. @opindex --with @r{options}
  482. @opindex --enable @r{options}
  483. @cindex configuration of optional features
  484. @cindex options to @code{configure}
  485. This section gives pointers to descriptions of the @samp{--with} and
  486. @samp{--enable} options to @code{configure} that Kpathsea-using programs
  487. accept.
  488.  
  489. @table @samp
  490. @item --without-mktexmf-default
  491. @itemx --without-mktexpk-default
  492. @itemx --without-mktextfm-default
  493. @itemx --with-mktextex-default
  494. Enable or disable the dynamic generation programs.  @xref{mktex
  495. configuration}.
  496.  
  497. @item --enable-shared
  498. @opindex --enable-shared
  499. Build Kpathsea as a shared library, and link against it.  Also build the
  500. usual static library.  @xref{Shared library}.
  501.  
  502. @item --disable-static
  503. @opindex --disable-static
  504. Build only the shared library.   Implies @samp{--enable-shared}.
  505.  
  506. @item --enable-maintainer-mode
  507. @opindex --enable-maintainer-mode
  508. Enables make targets that are useful for the maintainer and likely to be
  509. a pain for anyone else; the makefiles created when this option is
  510. enabled may not work at all for you.  You have been warned.
  511. @end table
  512.  
  513. @node configure environment                           
  514. @subsubsection @code{configure} environment
  515.  
  516. @code{configure} uses the value of the following environment variables in
  517. determining your system's characteristics, and substitutes for them in
  518. @t{Makefile}'s:
  519.  
  520. @vtable @samp
  521. @item CC
  522. @pindex gcc@r{, compiling with}
  523. @pindex cc@r{, compiling with}
  524. The compiler to use: default is @code{gcc} if it's installed, otherwise
  525. @code{cc}.
  526.  
  527. @item CFLAGS
  528. @cindex compiler options, specifying
  529. Options to give the compiler: default is @samp{-g -O2} for @code{gcc},
  530. @samp{-g} otherwise.  @code{CFLAGS} comes after any other options.  You
  531. may need to include @code{-w} here if your compilations commonly have
  532. useless warnings (e.g., @code{NULL redefined}), or @code{configure} may
  533. fail to detect the presence of header files (it takes the messages on
  534. standard error to mean the header file doesn't exist).
  535.  
  536. @item CPPFLAGS
  537. @cindex configuration compiler options
  538. Options to pass to the compiler preprocessor; this matters most for
  539. configuration, not the actual source compilation.  The @code{configure}
  540. script often does only preprocessing (e.g., to check for the existence
  541. of @t{#include} files), and @code{CFLAGS} is not used for this.  You may
  542. need to set this to something like
  543. @samp{-I/usr/local/include/wwwhatever} if you have the libwww library
  544. installed for hyper-xdvik (see @file{xdvik/INSTALL}).
  545.  
  546. @item DEFS
  547. @cindex preprocessor options
  548. Additional preprocessor options, but not used by @code{configure}.
  549. Provided for enabling or disabling program features, as documented in
  550. the various program-specific installation instructions.  @code{DEFS}
  551. comes before any compiler options included by the distribution
  552. @file{Makefile}s or by @code{configure}.
  553.  
  554. @item LDFLAGS
  555. @cindex loader options
  556. Additional options to give to the loader.  @code{LDFLAGS} comes before
  557. any other linker options.
  558.  
  559. @item LIBS
  560. @cindex libraries, specifying additional
  561. Additional libraries to link with.
  562. @end vtable
  563.  
  564.  
  565. @node configure scenarios
  566. @subsubsection @code{configure} scenarios
  567.  
  568. Here are some common installation scenarios:
  569.  
  570. @itemize @bullet
  571. @item
  572. Including X support in Metafont.  This is disabled by default, since
  573. many sites have no use for it, and it's a leading cause of configuration
  574. problems.
  575. @example
  576. configure --with-x-toolkit
  577. @end example
  578.  
  579. @item
  580. @cindex @TeX{} hierarchy, one
  581. Putting the binaries, @TeX{} files, GNU info files, etc.@: into a single
  582. @TeX{} hierarchy, say @file{/texmf}, requires overriding defaults in both
  583. @code{configure} and @code{make}:
  584. @example
  585. configure --prefix=@file{/texmf} --datadir=@file{/texmf}
  586. make texmf=@file{/texmf}
  587. @end example
  588.  
  589. @item
  590. @cindex multiple architectures, compiling on
  591. @cindex architectures, compiling multiple
  592. @cindex symbolic link trees, for multiple architectures
  593. @opindex --srcdir@r{, for building multiple architectures}
  594. @pindex lndir @r{for building symlink trees}
  595. You can compile on multiple architectures simultaneously either by
  596. building symbolic link trees with the @code{lndir} script from the X11
  597. distribution, or with the @samp{--srcdir} option:
  598. @example
  599. configure --srcdir=@var{srcdir}
  600. @end example
  601.  
  602. @item
  603. @cindex multiple architectures, directories for
  604. If you are installing binaries for multiple architectures into a single
  605. hierarchy, you will probably want to override the default @file{bin} and
  606. @file{lib} directories, something like this:
  607. @example
  608. configure --prefix=@var{texmf} --datadir=@var{texmf} \
  609.   --bindir=@var{texmf}/@var{arch}/bin --libdir=@var{texmf}/@var{arch}/lib
  610. make texmf=@var{texmf}
  611. @end example
  612. @pindex depot
  613. @cindex automounter, and configuration
  614. @noindent (Unless you make provisions for architecture-specific files in
  615. other ways, e.g., with Depot or an automounter.)
  616.  
  617. @item
  618. @opindex -O@r{, compiling with}
  619. @opindex -g@r{, compiling without}
  620. @cindex optimization, enabling
  621. @cindex debugging with @samp{-g}, disabling
  622. To compile with optimization (to compile without debugging, remove the
  623. @samp{-g}):
  624. @example
  625. env CFLAGS="-g -O" sh configure @dots{}
  626. @end example
  627. @noindent For a potential problem if you optimize, see @ref{TeX or
  628. Metafont failing,, @TeX{} or Metafont failing}.
  629. @end itemize
  630.   
  631.  
  632. @node Shared library
  633. @subsubsection Shared library
  634.  
  635. @cindex shared library, making
  636.  
  637. @opindex --enable-shared
  638. You can compile Kpathsea as a shared library on a few systems, by
  639. specifying the option @samp{--enable-shared} when you run
  640. @samp{configure}.
  641.  
  642. @cindex code sharing
  643. The main advantage in doing this is that the executables can then share
  644. the code, thus decreasing memory and disk space requirements.
  645.  
  646. On some systems, you can record the location of shared libraries in a
  647. binary, usually by giving certain options to the linker.  Then
  648. individual users do not need to set their system's environment variable
  649. (e.g., @code{LD_LIBRARY_PATH}) to find shared libraries.  If you want to
  650. do this, you will need to add the necessary options to @code{LDFLAGS}
  651. yourself; for example, on Solaris, include something like
  652. @samp{-R$@{prefix@}/lib}, on IRIX or Linux, use
  653. @samp{-rpath$@{prefix@}/lib}.  (Unfortunately, making this happen by
  654. default is very difficult, because of interactions with an existing
  655. installed shared library.)
  656.  
  657. Currently, shared library support is implemented only on Linux, SunOS 4
  658. (Solaris 1), SunOS 5 (Solaris 2), IRIX 5, and IRIX 6.  If you're
  659. interested and willing in adding support for other systems, please see
  660. the @samp{configure} mode in the @file{klibtool} script, especially the
  661. host-specific case statement around line 250.
  662.  
  663.  
  664. @node Running make
  665. @subsection Running @code{make}
  666.  
  667. @pindex make@r{, running}
  668.  
  669. @flindex texmf.cnf@r{, creating}
  670. @flindex paths.h@r{, creating}
  671. @code{make} (still in the top-level directory).  This also creates the
  672. @file{texmf.cnf} and @file{paths.h} files that define the default search
  673. paths, and (by default) the @samp{plain} and @samp{latex} @TeX{} formats.
  674.  
  675. @cindex fallback resolutions, overriding
  676. You can override directory names and other values at @code{make}-time.
  677. @file{make/paths.make} lists the variables most commonly reset.  For
  678. example, @samp{make default_texsizes=600} changes the list of fallback
  679. resolutions.
  680.  
  681. You can also override each of @code{configure}'s environment variables
  682. (@pxref{configure environment}).  The Make variables have the same names.
  683.  
  684. Finally, you can supply additional options via the following variables.
  685. (@code{configure} does not use these.)
  686.  
  687. @vtable @samp
  688. @item XCPPFLAGS
  689. @itemx XDEFS
  690. @cindex preprocessor options, additional
  691. Preprocessor options.
  692.  
  693. @item XCFLAGS
  694. @cindex compiler options, additional
  695. Compiler options.
  696.  
  697. @item XLDFLAGS
  698. @cindex loader options, initial
  699. Loader options (included at beginning of link commands).
  700.  
  701. @item XLOADLIBES
  702. @cindex loader options, final
  703. More loader options (included at end of link commands).
  704.  
  705. @item XMAKEARGS
  706. @cindex Make arguments, additional
  707. Additional Make arguments passed to all sub-@code{make}'s. You may need
  708. to include assignments to the other variables here via @code{XMAKEARGS};
  709. for example: @samp{make XMAKEARGS="CFLAGS=-O XDEFS=-DA4"}.
  710. @end vtable
  711.  
  712. @cindex compiler, changing
  713. @cindex libraries, changing
  714. It's generally a bad idea to use a different compiler (@samp{CC}) or
  715. libraries (@code{LIBS}) for compilation than you did for configuration,
  716. since the values @code{configure} determined may then be incorrect.
  717.  
  718. @cindex universe, BSD vs.@: system V
  719. @cindex BSD universe
  720. @cindex system V universe
  721. @cindex Solaris BSD compatibility, not
  722. @flindex libucb@r{, avoiding}
  723. @flindex ucbinclude@r{, avoiding}
  724. Adding compiler options to change the ``universe'' you are using
  725. (typically BSD vs.@: system V) is generally a cause of trouble.  It's
  726. best to use the native environment, whatever that is; @code{configure}
  727. and the software usually adapt best to that.  In particular, under
  728. Solaris 2.x, you should not use the BSD-compatibility library
  729. (@file{libucb}) or include files (@file{ucbinclude}).
  730.  
  731. @cindex Babel
  732. If you want to use the Babel La@TeX{} package for support of non-English
  733. typesetting, you need to modify some files before making the La@TeX{}
  734. format.  See the file @file{install.txt} in the Babel distribution.
  735.  
  736.  
  737. @node Installing files
  738. @subsection Installing files
  739.  
  740. @cindex installing files
  741.  
  742. The basic command is the usual @code{make install}.  For security
  743. issues, @pxref{Security}.
  744.  
  745. The first time you install any manual in the GNU Info system, you should
  746. add a line (you choose where) to the file @file{dir} in your
  747. @samp{$(infodir)} directory.  Sample text for this is given near the top
  748. of the Texinfo source files (@file{kpathsea/kpathsea.texi},
  749. @file{dvipsk/dvips.texi}, and @file{web2c/doc/web2c.texi}).
  750. If you have a recent version of the GNU Texinfo distribution installed
  751. (@url{ftp://prep.ai.mit.edu/pub/gnu/texinfo-3.9.tar.gz} or later), this
  752. should happen automatically.
  753.  
  754. On the offchance that this is your first Info installation, the
  755. @file{dir} file I use is included in the distribution as
  756. @file{etc/dir-example}.
  757.  
  758. @cindex multiple architectures, installing on
  759. @cindex architecture-(in)dependent files, installing only
  760. @cindex installation, architecture-(in)dependent files only
  761. You may wish to use one of the following targets, especially if you are
  762. installing on multiple architectures:
  763. @itemize @bullet
  764. @item
  765. @findex install-exec @r{Make target}
  766. @code{make install-exec} to install in architecture-dependent
  767. directories, i.e., ones that depend on the @code{$(exec_prefix)} Make
  768. variable.  This includes links to binaries, libraries, etc., not just
  769. ``executables''.
  770.  
  771. @item
  772. @findex install-data @r{Make target}
  773. @code{make install-data} to install in architecture-independent
  774. directories, such as documentation, configuration files, pool files, etc.
  775. @end itemize
  776.  
  777. @cindex AFS
  778. @cindex Andrew File System, installing with
  779. @flindex /afs/@dots{} @r{, installing into}
  780. If you use the Andrew File System, the normal path (e.g.,
  781. @var{prefix}/bin) only gets you to a read-only copy of the files, and
  782. you must specify a different path for installation.  The best way to do this
  783. is by setting the @samp{prefix} variable on the @code{make} command
  784. line.  The sequence becomes something like this:
  785. @example
  786. configure --prefix=/whatever
  787. make
  788. make install prefix=/afs/.@var{system.name}/system/1.3/@@sys/whatever
  789. @end example
  790. @flindex ls-R @r{and AFS}
  791. @cindex relative filenames in @file{ls-R}
  792. @noindent With AFS, you will definitely want to use relative filenames in 
  793. @file{ls-R} (@pxref{Filename database}), not absolute filenames.  This
  794. is done by default, but check anyway.
  795.  
  796.  
  797. @node Cleaning up
  798. @subsection Cleaning up
  799.  
  800. @findex distclean @r{Make target}
  801. The basic command is @code{make distclean}.  This removes all files
  802. created by the build.
  803.  
  804. Alternatively,
  805. @itemize @bullet
  806. @item
  807. @findex mostlyclean @r{Make target}
  808. @code{make mostlyclean} if you intend to compile on another
  809. architecture.  For Web2C, since the generated C files are portable,
  810. they are not removed.  If the @code{lex} vs.@: @code{flex} situation
  811. is going to be different on the next machine, @code{rm
  812. web2c/lex.yy.c}.
  813.  
  814. @item
  815. @findex clean @r{Make target}
  816. @code{make clean} to remove files created by compiling, but leave
  817. configuration files and Makefiles.
  818.  
  819. @item
  820. @findex maintainer-clean @r{Make target}
  821. @code{make maintainer-clean} to remove everything that the Makefiles can
  822. rebuild.  This is more than @samp{distclean} removes, and you should
  823. only use it if you are thoroughly conversant with (and have the necessary
  824. versions of) Autoconf.
  825.  
  826. @item
  827. @findex extraclean @r{Make target}
  828. @code{make extraclean} to remove other junk, e.g., core files, log
  829. files, patch rejects.  This is independent of the other @samp{clean}
  830. targets.
  831. @end itemize
  832.  
  833.  
  834. @node Filename database generation
  835. @subsection Filename database generation
  836.  
  837. @cindex filename database generation
  838. @cindex generation of filename database
  839.  
  840. You will probably want to set up a @code{cron} entry on the appropriate
  841. machine(s) to rebuild the filename database nightly or so, as in:
  842. @example
  843. 0 0 * * * cd @var{texmf} && @var{/bindir}/mktexlsr
  844. @end example
  845. @noindent @xref{Filename database}.
  846.  
  847. Although the @code{mktex@dots{}} scripts make every effort to add
  848. newly-created files on the fly, it can't hurt to make sure you get a
  849. fresh version every so often.
  850.  
  851.  
  852. @node mktex scripts
  853. @subsection @file{mktex} scripts
  854.  
  855. @cindex @file{mktex} scripts
  856. @cindex scripts for file creation
  857.  
  858. @cindex font set, infinite
  859. @cindex dynamic creation of files
  860. @cindex Sauter fonts, and dynamic source creation
  861. @cindex EC fonts, and dynamic source creation
  862. If Kpathsea cannot otherwise find a file, for some file types it is
  863. configured by default to invoke an external program to create it
  864. dynamically (@pxref{mktex configuration}).  This is most useful for
  865. fonts (bitmaps, TFM's, and arbitrarily-sizable Metafont sources such as
  866. the Sauter and EC fonts), since any given document can use fonts never
  867. before referenced.  Trying to build all fonts in advance is therefore
  868. impractical, if not impossible.
  869.  
  870. The script is passed the name of the file to create and possibly other
  871. arguments, as explained below.  It must echo the full pathname of the
  872. file it created (and nothing else) to standard output; it can write
  873. diagnostics to standard error.
  874.  
  875. @menu
  876. * mktex configuration::
  877. * mktex script names::
  878. * mktex script arguments::
  879. @end menu
  880.  
  881.  
  882. @node mktex configuration
  883. @subsubsection @file{mktex} configuration
  884.  
  885. @cindex @file{mktex} script configuration
  886. @cindex configuration of @file{mktex} scripts
  887. @cindex enabling @file{mktex} scripts
  888. @cindex disabling @file{mktex} scripts
  889.  
  890. The following file types can run an external program to create missing
  891. files: @file{pk}, @file{tfm}, @file{mf}, @file{tex}; the scripts are
  892. named @file{mktexpk}, @file{mktextfm}, @file{mktexmf}, and
  893. @file{mktextex}.
  894.  
  895. In the absence of @code{configure} options specifying otherwise,
  896. everything but @file{mktextex} will be enabled by default. The
  897. @code{configure} options to change the defaults are:
  898.  
  899. @cindex @code{configure} options for @file{mktex} scripts
  900. @opindex --without-mktexmf-default
  901. @opindex --without-mktexpk-default
  902. @opindex --without-mktextfm-default
  903. @opindex --with-mktextex-default
  904. @example
  905. --without-mktexmf-default
  906. --without-mktexpk-default
  907. --without-mktextfm-default
  908. --with-mktextex-default
  909. @end example
  910.  
  911. The @code{configure} setting is overridden if the environment variable
  912. or configuration file value named for the script is set; e.g.,
  913. @file{MKTEXPK} (@pxref{mktex script arguments}).
  914.  
  915. @flindex mktex.cnf
  916. @cindex site overrides for @code{mktex@dots{}}
  917. As distributed, all the scripts source a file
  918. @file{texmf/web2c/mktex.cnf} if it exists, so you can override
  919. various defaults.  See @file{mktex.opt}, for instance, which defines
  920. the default mode, resolution, some special directory names, etc.  If you
  921. prefer not to change the distributed scripts, you can simply create
  922. @file{mktex.cnf} with the appropriate definitions (you do not need to
  923. create it if you have nothing to put in it).  @file{mktex.cnf} has no
  924. special syntax; it's an arbitrary Bourne shell script.  The distribution
  925. contains a sample @file{mktex.cnf} for you to copy and modify as you
  926. please (it is not installed anywhere).
  927.  
  928. @flindex mktex.opt
  929. @vindex MT_FEATURES
  930. In addition, you can configure a number of features with the
  931. @code{MT_FEATURES} variable, which you can define:
  932. @itemize @bullet
  933. @item
  934. in @file{mktex.opt}, as just mentioned;
  935.  
  936. @item
  937. by editing the file @file{mktex.opt}, either before @samp{make
  938. install} (in the source hierarchy) or after (in the installed
  939. hierarchy);
  940.  
  941. @item
  942. or in the environment.
  943. @end itemize
  944.  
  945. If none of the options below are enabled, @code{mktexpk},
  946. @code{mktextfm}, and @code{mktexmf} follow the following procedure to
  947. decide where fonts should be installed.  Find the tree where the font's
  948. sources are, and test the permissions of the @samp{fonts} directory of
  949. that tree to determine whether it is writable.  If it is, put the files
  950. in the tree in appropriate locations.  If it isn't writable, see whether
  951. the tree is a system tree (named in @code{SYSTEXMF}).  If so, the
  952. @code{VARTEXFONTS} tree is used.  In all other cases the working
  953. directory is used.
  954.  
  955. The @samp{appendonlydir} option is enabled by default.
  956.  
  957. @vtable @samp
  958. @item appendonlydir
  959. @cindex directories, making append-only
  960. @flindex mktexdir
  961. Tell @code{mktexdir} to create directories append-only, i.e., set
  962. their sticky bit (@pxref{Mode Structure,,, fileutils, GNU File
  963. Utilities}).  This feature is silently ignored on non-Unix platforms
  964. (e.g. Windows/NT and MS-DOS) which don't support similar functionality.
  965. This feature is enabled by default.
  966.  
  967. @item dosnames
  968. @cindex 8.3 filenames, using
  969. @cindex DOS compatible names
  970. @flindex dpi@var{nnn} directories
  971. Use 8.3 names; e.g., @file{dpi600/cmr10.pk} instead of
  972. @file{cmr10.600pk}.  Note that this feature only affects filenames that
  973. would otherwise clash with other TeX-related filenames; @file{mktex}
  974. scripts do nothing about filenames which exceed the 8+3 MS-DOS limits
  975. but remain unique when truncated (by the OS) to these limits, and nether
  976. do the scripts care about possible clashes with files which aren't
  977. related with TeX.  For example, @file{cmr10.600pk} would clash with
  978. @file{cmr10.600gf} and is therefore changed when @samp{dosnames} is in
  979. effect, but @file{mf.pool} and @file{mp.base} don't clash with any
  980. TeX-related files and are therefore unchanged.
  981.  
  982. This feature is turned on by default on MS-DOS.  If you do not wish
  983. @samp{dosnames} to be set on an MS-DOS platform, you need to set the
  984. @code{MT_FEATURES} environment variable to a value that doesn't include
  985. @samp{dosnames}.  You can also change the default setting by editing
  986. @file{mktex.opt}, but only if you use the @file{mktex} shell scripts;
  987. the emulation programs don't consult @file{mktex.opt}.
  988.  
  989. @item fontmaps
  990. @cindex fontmaps
  991. @cindex fontname
  992. Instead of deriving the location of a font in the destination tree from
  993. the location of the sources, the aliases and directory names from the
  994. Fontname distribution are used. (@pxref{Top,, Introduction, fontname,
  995. Fontname}).
  996.  
  997. @item nomode
  998. @cindex mode directory, omitting
  999. Omit the directory level for the mode name; this is fine as long as
  1000. you generate fonts for only one mode.
  1001.  
  1002. @item stripsupplier
  1003. @cindex supplier directory, omitting
  1004. Omit the font supplier name directory level.
  1005.  
  1006. @item striptypeface
  1007. @cindex typeface directory, omitting
  1008. Omit the font typeface name directory level.
  1009.  
  1010. @item strip
  1011. @cindex supplier directory, omitting
  1012. @cindex typeface directory, omitting
  1013. Omit the font supplier and typeface name directory levels.  This feature
  1014. is deprecated in favour of @samp{stripsupplier} and @samp{striptypeface}.
  1015.  
  1016. @item varfonts
  1017. @flindex /var/tmp/texfonts
  1018. @vindex VARTEXFONTS
  1019. @cindex Linux File System Standard
  1020. When this option is enabled, fonts that would otherwise be written in
  1021. system texmf tree go to the @code{VARTEXFONTS} tree instead.  The
  1022. default value in @file{kpathsea/Makefile.in} is
  1023. @file{/var/tmp/texfonts}.  The @cite{Linux File System Standard}
  1024. recommends @file{/var/tex/fonts}.
  1025.  
  1026. @vindex USE_VARTEXFONTS
  1027. The @samp{varfonts} setting in @code{MT_FEATURES} is overridden by the
  1028. @code{USE_VARTEXFONTS} environment variable: if set to @samp{1}, the
  1029. feature is enabled, and if set to @samp{0}, the feature is disabled.
  1030. @end vtable
  1031.  
  1032.  
  1033. @node mktex script names
  1034. @subsubsection @file{mktex} script names
  1035.  
  1036. @cindex @file{mktex} script names
  1037. @cindex names for @file{mktex} scripts
  1038.  
  1039. @flindex tex-make.c
  1040. @vindex kpse_make_specs
  1041. The following table shows the default name of the script for each
  1042. possible file types.  (The source is the variable @code{kpse_make_specs}
  1043. in @file{kpathsea/tex-make.c}.)
  1044.  
  1045. @table @file
  1046. @item mktexpk
  1047. @pindex mktexpk
  1048. Glyph fonts.
  1049.  
  1050. @item mktextex
  1051. @pindex mktextex
  1052. @TeX{} input files.
  1053.  
  1054. @item mktexmf
  1055. @pindex mktexmf
  1056. Metafont input files.
  1057.  
  1058. @item mktextfm
  1059. @pindex mktextfm
  1060. TFM files.
  1061. @end table
  1062.  
  1063. @vindex DVIPSMAKEPK
  1064. @vindex XDVIMAKEPK
  1065. @vindex DVILJMAKEPK
  1066. @noindent These names are overridden by an environment variable specific
  1067. to the program---for example, @code{DVIPSMAKEPK} for Dvipsk.
  1068.  
  1069. @comment next two paragraphs are repeated in dvips.texi
  1070. @flindex missfont.log
  1071. @cindex failed @code{mktex@dots{}} script invocation
  1072. If a @code{mktex@dots{}} script fails, the invocation is appended to a
  1073. file @file{missfont.log} (by default) in the current directory.  You can
  1074. then execute the log file to create the missing files after fixing the
  1075. problem.
  1076.  
  1077. @vindex TEXMFOUTPUT
  1078. @vindex MISSFONT_LOG
  1079. If the current directory is not writable and the environment variable or
  1080. configuration file value @code{TEXMFOUTPUT} is set, its value is
  1081. used.  Otherwise, nothing is written.  The name @samp{missfont.log} is
  1082. overridden by the @code{MISSFONT_LOG} environment variable or
  1083. configuration file value.
  1084.  
  1085.  
  1086. @node mktex script arguments
  1087. @subsubsection @file{mktex} script arguments
  1088.  
  1089. @cindex arguments to @file{mktex}
  1090.  
  1091. The first argument to a @file{mktex} script is always the name
  1092. of the file to be created.
  1093.  
  1094. In the default @file{mktexpk} implementation, additional arguments may
  1095. also be passed:
  1096.  
  1097. @table @samp
  1098. @item --dpi @var{num}
  1099. Sets the resolution of the generated font to @var{num}.
  1100. @item --mfmode @var{name}
  1101. Sets the Metafont mode to @var{name}.
  1102. @item --bdpi @var{num}
  1103. Sets the the ``base dpi'' for the font.  This must match the mode being
  1104. used.
  1105. @item --mag @var{string}
  1106. A ``magstep'' string suitable for the Metafont @code{mag} variable.
  1107. This must match the combination of @var{bdpi} and @var{dpi} being used.
  1108. @item --destdir @var{string}
  1109. A directory name. If the directory is absolute, it is used as-is.
  1110. Otherwise, it is appended to the root destination directory set in the
  1111. script.
  1112. @end table
  1113.  
  1114. @c  The feature mentioned here doesn't seem to be implemented.
  1115. @c  Worse, the variable name clashed with the "switch" used to select
  1116. @c  whether a mktex program is run at all.  However, a dearth of
  1117. @c  complains suggests that no-one was using it anyway.
  1118. @c
  1119. @c @vindex MKTEXPK @r{environment variable}
  1120. @c @cindex specification for @code{mktexpk}
  1121. @c You can change the specification for the arguments passed to the
  1122. @c external script by setting the environment variable named as the script
  1123. @c name, but all capitals---@code{MKTEXPK}, for example.  If you've
  1124. @c changed the script name by setting (say) @code{DVIPSMAKEPK} to
  1125. @c @samp{foo}, then the spec is taken from the environment variable
  1126. @c @code{FOO}.
  1127. @c
  1128. @c The spec can contain any variable references, to the above variables or
  1129. @c any others.  As an example, the default spec for @code{mktexpk} is:
  1130. @c @example
  1131. @c $KPATHSEA_DPI $MAKETEX_BASE_DPI $MAKETEX_MAG $MAKETEX_MODE
  1132. @c @end example
  1133. @c
  1134. @c @noindent The convention of passing the name of the file to be created
  1135. @c as the first argument cannot be changed.
  1136.  
  1137.  
  1138. @node Installation testing 
  1139. @subsection Installation testing
  1140.  
  1141. @cindex testing, post-installation
  1142. @cindex installation testing
  1143.  
  1144. Besides the tests listed in @ref{Simple installation}, you can try
  1145. running @samp{make check}.  This includes the torture tests (trip, trap,
  1146. and mptrap) that come with Web2c (@pxref{Triptrap,,, web2c, Web2c}).
  1147.  
  1148.  
  1149. @node Security
  1150. @section Security
  1151.  
  1152. @cindex security considerations
  1153.  
  1154. None of the programs in the @TeX{} system require any special system
  1155. privileges, so there's no first-level security concern of people gaining
  1156. illegitimate root access.
  1157.  
  1158. @cindex trojan horse attack
  1159. @flindex .rhosts@r{, writable by @TeX{}}
  1160. A @TeX{} document, however, can write to arbitrary files, e.g.,
  1161. @file{~/.rhosts}, and thus an unwitting user who runs @TeX{} on a random
  1162. document is vulnerable to a trojan horse attack.  This loophole is
  1163. closed by default, but you can be permissive if you so desire in
  1164. @file{texmf.cnf}.  @xref{tex invocation,,, web2c, Web2c}.  MetaPost has
  1165. the same issue.
  1166.  
  1167. Dvips, Xdvi, and @TeX{} can also execute shell commands under some
  1168. circumstances.  To disable this, see the @samp{-R} option in @ref{Option
  1169. details,,, dvips, Dvips}, the xdvi man page, and @ref{tex
  1170. invocation,,, web2c, Web2c}, respectively.
  1171.  
  1172. @cindex local cache of fonts
  1173. @cindex cache of fonts, local
  1174. Another security issue arises because it's very useful---almost
  1175. necessary---to make arbitrary fonts on user demand with @code{mktexpk}
  1176. and friends.  Where do these files get installed?  By default, the
  1177. @code{mktexpk} distributed with Kpathsea assumes a world-writable
  1178. @file{/var/tmp} directory; this is a simple and convenient approach, but
  1179. it may not suit your situation because it means that a local cache of
  1180. fonts is created on every machine.
  1181.  
  1182. @cindex globally writable directories
  1183. To avoid this duplication, many people consider a shared, globally
  1184. writable font tree desirable, in spite of the potential security
  1185. problems.  To do this you should change the value of @code{VARTEXFONTS}
  1186. in @file{texmf.cnf} to refer to some globally known directory.
  1187. @xref{mktex configuration}.
  1188.  
  1189. @cindex append-only directories and @code{mktexpk}
  1190. The first restriction you can apply is to make newly-created directories
  1191. under @file{texmf} be append-only with an option in @file{mktex.cnf}.
  1192. @xref{mktex configuration}.
  1193.  
  1194. @cindex group-writable directories
  1195. @cindex setgid scripts
  1196. Another approach is to establish a group (or user) for @TeX{} files,
  1197. make the @file{texmf} tree writable only to that group (or user), and
  1198. make @code{mktexpk} et al.@: setgid to that group (or setuid to that
  1199. user).  Then users must invoke the scripts to install things.  (If
  1200. you're worried about the inevitable security holes in scripts, then you
  1201. could write a C wrapper to exec the script.)
  1202.  
  1203. @cindex file permissions
  1204. @cindex permissions, file
  1205. The @file{mktex@dots{}} scripts install files with the same read and
  1206. write permissions as the directory they are installed in.  The
  1207. executable, sgid, suid, and sticky bits are always cleared.
  1208.  
  1209. @cindex directory permissions
  1210. @cindex permissions, directory
  1211. Any directories created by the @file{mktex@dots{}} scripts have the
  1212. same permissions as their parent directory, unless the
  1213. @code{appendonlydir} feature is used, in which case the sticky bit is
  1214. always set.
  1215.