1 How to install GNU Stow
2 =======================
7 Stow is a collection of Perl scripts and modules. You must have Perl
8 5.6.1 or later in order for it to run. The test suite also requires
9 the `Test::More` and `Test::Output` modules which can be obtained from
10 CPAN. They are also available as packages in some of the GNU/Linux
16 Stow can either be installed via the standard GNU Autotools procedure
17 (`./configure && make install`) or since 2.1.0, via CPAN-style via
20 Advantages of the Autotools approach:
22 - It's arguably more flexible.
24 - It will install the documentation in Info, HTML, man, and PDF
27 Advantages of the `Module::Build` approach:
29 - It's more in keeping with the standard way to distribute CPAN
32 - It performs dependency checking to ensure you have the necessary
33 Perl modules installed.
35 Both approaches are described in detail below. However if you are
36 building from the git repository rather than an official release,
37 you first need to perform some extra steps:
39 Preparatory steps required only when building from git
40 ------------------------------------------------------
42 `configure` and `Makefile` are included in official releases of Stow,
43 but they are deliberately omitted from the git repository because they
44 are autogenerated. Therefore if you are installing directly from git,
45 you first need to generate them as follows.
47 First `cd` to the directory containing the source code (and this
52 If this runs successfully then you are ready to continue with one of
53 the two installation methods below.
55 Basic Installation via `Module::Build`
56 --------------------------------------
58 The steps in building Stow are:
60 1. `cd` to the directory containing the source code (and this file).
62 2. If you are building from an official GNU release tarball, type
63 `./configure && make` to configure stow for your system. If you
64 are building from a CPAN tarball, this step can be skipped.
66 If `make` warns that the Perl module installation directory is
67 not in `@INC`, then you should run:
69 eval `perl -V:siteprefix`
70 ./configure --prefix=$siteprefix && make
72 to avoid a superfluous `use lib` line in your stow executable.
74 3. If you have LaTeX and texinfo installed and want to build a PDF
75 version of the manual, type:
79 4. Type `perl Build.PL`. If you skipped step 3 and see a warning
80 about `manual.pdf` being missing, you can safely ignore it.
82 5. Type `./Build install` to install the various files. As noted
83 above, this installs fewer files than the Autotools installation.
85 Basic Installation via Autotools
86 --------------------------------
88 The steps in building Stow are:
90 1. `cd` to the directory containing the source code (and this file).
92 2. Type `./configure` to configure stow for your system. This step
93 will attempt to locate your copy of perl and set its location in
94 `Makefile.in`. You can use the normal arguments to change the
95 default installation paths (see below); additionally you can use
98 --with-pmdir=/path/to/perl/modules
100 option to manually choose where the Perl modules get installed.
101 However, if you don't, the `configure` script will go to great
102 lengths to try to choose a sensible default.
104 3. Type `make install` to install the various files. If the chosen
105 installation directory for Perl modules is not included in Perl's
106 built-in `@INC` search path, the Makefile rules will automatically
111 line into the generated stow script to ensure that it can always
112 locate the Perl modules without needing to manually set `PERL5LIB`.
114 4. If you have LaTeX and texinfo installed and want to build a PDF
115 version of the manual, type:
122 By default, `make install` will install the package's files in
123 `/usr/local/bin` and `/usr/local/info`. You can specify an
124 installation prefix other than `/usr/local` by giving `configure` the
125 option `--prefix=PATH`.
127 If the package supports it, you can cause programs to be installed
128 with an extra prefix or suffix on their names by giving `configure`
129 the option `--program-prefix=PREFIX` or `--program-suffix=SUFFIX`.
131 Since `stow` is concerned with separating a package's installation
132 tree from its run-time tree, you might want to install `stow` into a
133 directory such as `/usr/local/stow/stow` but have it run out of
134 `/usr/local`. Do this by giving the run-time prefix (e.g.,
135 /usr/local) to configure as described above; then run `make`; then run
136 `make install prefix=/usr/local/stow/stow`. For more information on
137 this technique, see the Stow manual.
139 The configuration system
140 ------------------------
142 The `configure` shell script attempts to guess correct values for
143 various system-dependent variables used during compilation. It uses
144 those values to create a `Makefile` and to create the `stow` script
145 itself, using Makefile.in and stow.in as templates. Finally, it
146 creates a shell script `config.status` that you can run in the future
147 to recreate the current configuration, a file `config.cache` that
148 saves the results of its tests to speed up reconfiguring, and a file
149 `config.log` containing other output.
151 The file `configure.ac` is used to create `configure` by a program
152 called `autoconf`. You only need `configure.ac` if you want to change
153 it or regenerate `configure` using a newer version of `autoconf`.
155 The file `Makefile.am` is used to create `Makefile.in` by a program
156 called `automake`. You only need `Makefile.am` if you want to change
157 it or regenerate `Makefile.in` using a newer version of `automake`.
162 If you want to set default values for `configure` scripts to share,
163 you can create a site shell script called `config.site` that gives
164 default values for variables like `CC`, `cache_file`, and `prefix`.
165 `configure` looks for `PREFIX/share/config.site` if it exists, then
166 `PREFIX/etc/config.site` if it exists. Or, you can set the
167 `CONFIG_SITE` environment variable to the location of the site script.
168 A warning: not all `configure` scripts look for a site script.
173 `configure` recognizes the following options to control how it
177 Use and save the results of the tests in FILE instead of
178 `./config.cache`. Set FILE to `/dev/null` to disable caching, for
179 debugging `configure`.
182 Print a summary of the options to `configure`, and exit.
187 Do not print messages saying which checks are being made.
190 Look for the package's source code in directory DIR. Usually
191 `configure` can determine that directory automatically.
194 Print the version of Autoconf used to generate the `configure`
197 `configure` also accepts some other, not widely useful, options.
199 Cleaning up build files
200 -----------------------
202 You can remove the generated files from the source code directory by
203 typing `make clean`. To also remove the files that `configure`
204 created (so you can compile the package for a different computer),
205 type `make distclean`. There is also a `make maintainer-clean`
206 target, but that is intended mainly for stow's developers. If you use
207 it, you may have to get all sorts of other programs in order to
208 regenerate files that came with the distribution.
210 License for this file
211 ---------------------
213 Copying and distribution of this file, with or without modification,
214 are permitted in any medium without royalty provided the copyright
215 notice and this notice are preserved. This file is offered as-is,
216 without any warranty.