1251881Speter               ======================================
2251881Speter                      INSTALLING SUBVERSION
3251881Speter                          A Quick Guide
4251881Speter               ======================================
5251881Speter
6299742Sdim$LastChangedDate: 2015-12-12 04:00:43 +0000 (Sat, 12 Dec 2015) $
7251881Speter
8251881Speter
9251881SpeterContents:
10251881Speter
11251881Speter     I. INTRODUCTION
12251881Speter       A. Audience
13251881Speter       B. Dependency Overview
14251881Speter       C. Dependencies in Detail
15251881Speter       D. Documentation
16251881Speter
17251881Speter    II. INSTALLATION
18299742Sdim       A. Building from a Tarball
19251881Speter       B. Building the Latest Source under Unix
20251881Speter       C. Building under Unix in Different Directories
21251881Speter       D. Installing from a Zip or Installer File under Windows
22251881Speter       E. Building the Latest Source under Windows
23251881Speter
24251881Speter   III. BUILDING A SUBVERSION SERVER
25251881Speter       A. Setting Up Apache
26251881Speter       B. Making and Installing the Subversion Server
27251881Speter       C. Configuring Apache for Subversion
28251881Speter       D. Running and Testing
29251881Speter       E. Alternative:  'svnserve' and ra_svn
30251881Speter
31251881Speter    IV. PLATFORM-SPECIFIC ISSUES
32251881Speter       A. Windows XP
33251881Speter       B. Mac OS X
34251881Speter
35251881Speter     V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA)
36251881Speter
37251881Speter
38251881Speter
39251881SpeterI.    INTRODUCTION
40251881Speter      ============
41251881Speter
42251881Speter  A. Audience
43251881Speter
44251881Speter      This document is written for people who intend to build
45251881Speter      Subversion from source code.  Normally, the only people who do
46251881Speter      this are Subversion developers and package maintainers.
47251881Speter
48251881Speter      If neither of these labels fits you, we recommend you find an
49251881Speter      appropriate binary package of Subversion and install that.
50251881Speter      While the Subversion project doesn't officially release binary
51251881Speter      packages, a number of volunteers have made such packages
52251881Speter      available for different operating systems.  Most Linux and BSD
53251881Speter      distributions already have Subversion packages ready to go via
54251881Speter      standard packaging channels, and other volunteers have built
55251881Speter      'installers' for both Windows and OS X.  Visit this page for
56251881Speter      package links:
57251881Speter
58251881Speter         http://subversion.apache.org/packages.html
59251881Speter
60251881Speter      For those of you who still wish to build from source, Subversion
61251881Speter      follows the Unix convention of "./configure && make", but it has
62251881Speter      a number of dependencies.
63251881Speter
64251881Speter
65251881Speter  B. Dependency Overview
66251881Speter
67251881Speter      You'll need the following build tools to compile Subversion:
68251881Speter
69251881Speter      * autoconf 2.59 or later (Unix only)
70251881Speter      * libtool 1.4 or later (Unix only)
71251881Speter      * a reasonable C compiler (gcc, Visual Studio, etc.)
72251881Speter
73251881Speter
74251881Speter      Subversion also depends on the following third-party libraries:
75251881Speter
76251881Speter      * libapr and libapr-util (REQUIRED for client and server)
77251881Speter
78251881Speter         The Apache Portable Runtime (APR) library provides an
79251881Speter         abstraction of operating-system level services such as file
80251881Speter         and network I/O, memory management, and so on.  It also
81251881Speter         provides convenience routines for things like hashtables,
82251881Speter         checksums, and argument processing.  While it was originally
83251881Speter         developed for the Apache HTTP server, APR is a standalone
84251881Speter         library used by Subversion and other products.  It is a
85251881Speter         critical dependency for all of Subversion; it's the layer
86251881Speter         that allows Subversion clients and servers to run on
87251881Speter         different operating systems.
88251881Speter
89251881Speter      * SQLite  (REQUIRED for client and server)
90251881Speter
91251881Speter         Subversion uses SQLite to manage some internal databases.
92251881Speter
93251881Speter      * libz  (REQUIRED for client and server)
94251881Speter
95251881Speter         Subversion uses zlib for compressing binary differences.
96251881Speter         These diff streams are used everywhere -- over the network,
97251881Speter         in the repository, and in the client's working copy.
98251881Speter
99251881Speter      * libserf  (OPTIONAL for client)
100251881Speter
101251881Speter         The Serf library allows the Subversion client to send HTTP
102251881Speter         requests.  This is necessary if you want your client to access
103251881Speter         a repository served by the Apache HTTP server.  There is an
104251881Speter         alternate 'svnserve' server as well, though, and clients
105251881Speter         automatically know how to speak the svnserve protocol.
106251881Speter         Thus it's not strictly necessary for your client to be able
107251881Speter         to speak HTTP... though we still recommend that your client
108251881Speter         be built to speak both HTTP and svnserve protocols.
109251881Speter
110251881Speter      * OpenSSL (OPTIONAL for client and server)
111251881Speter
112251881Speter         OpenSSL enables your client to access SSL-encrypted https://
113251881Speter         URLs (using libserf) in addition to unencrypted http:// URLs.
114251881Speter         To use SSL with Subversion's WebDAV server, Apache needs to be
115251881Speter         compiled with OpenSSL as well.
116251881Speter
117251881Speter      * Berkeley DB (OPTIONAL for client and server)
118251881Speter
119251881Speter         There are two different repository 'back-end'
120251881Speter         implementations.  One implementation stores data in a flat
121251881Speter         filesystem (known as FSFS); the other implementation stores
122251881Speter         data in a Berkeley DB database (known as BDB).  When you
123251881Speter         create a repository, you have the option of specifying a
124251881Speter         storage back-end.  The Berkeley DB back-end will only be
125251881Speter         available if the BDB libraries are discovered at compile
126299742Sdim         time.  The Berkeley DB back-end has been deprecated and
127299742Sdim         is not recommend.
128251881Speter
129251881Speter      * libsasl (OPTIONAL for client and server)
130251881Speter
131251881Speter         If the Cyrus SASL library is detected at compile time, then
132251881Speter         the svn client (and svnserve server) will be able to utilize
133251881Speter         SASL to do various forms of authentication when speaking the
134251881Speter         svnserve protocol.
135251881Speter
136251881Speter      * Python, Perl, Java, Ruby  (OPTIONAL)
137251881Speter
138251881Speter         Subversion is mostly a collection of C libraries with
139251881Speter         well-defined APIs, with a small collection of programs that
140251881Speter         use the APIs.  If you want to build Subversion API bindings
141251881Speter         for other languages, you need to have those languages
142251881Speter         available at build time.
143251881Speter
144251881Speter      * KDELibs, GNOME Keyring  (OPTIONAL for client)
145251881Speter
146251881Speter         Subversion contains optional support for storing passwords in
147251881Speter         KWallet (KDE 4) or GNOME Keyring.
148251881Speter
149299742Sdim      * libmagic (OPTIONAL)
150251881Speter
151251881Speter         If the libmagic library is detected at compile time,
152251881Speter         it will be used to determine mime-types of binary files
153251881Speter         which are added to version control. Note that mime-types
154251881Speter         configured via auto-props or the mime-types-file option
155251881Speter         take precedence.
156251881Speter
157299742Sdim      * Googlemock aka Gmock (OPTIONAL)
158299742Sdim
159299742Sdim         This optional package is used by the tests for Subversions'
160299742Sdim         C++ bindings.
161299742Sdim
162299742Sdim
163251881Speter  C. Dependencies in Detail
164251881Speter
165251881Speter      Subversion depends on a number of third party tools and libraries.
166251881Speter      Some of them are only required to run a Subversion server; others
167251881Speter      are necessary just for a Subversion client.  This section explains
168251881Speter      what other tools and libraries will be required so that Subversion
169251881Speter      can be built with the set of features you want.
170251881Speter
171251881Speter      On Unix systems, the './configure' script will tell you if you are
172251881Speter      missing the correct version of any of the required libraries or
173251881Speter      tools, so if you are in a real hurry to get building, you can skip
174251881Speter      straight to section II.  If you want to gather the pieces you will
175251881Speter      need before starting out, however, you should read the following.
176251881Speter
177251881Speter      If you're just installing a Subversion client, the Subversion
178251881Speter      team has created a script that downloads the minimal prerequisite
179251881Speter      libraries (Apache Portable Runtime, Sqlite, and Zlib).  The script,
180251881Speter      'get-deps.sh', is available in the same directory as this file.
181251881Speter      When run, it will place 'apr', 'apr-util', 'serf', 'zlib', and
182251881Speter      'sqlite-amalgamation' directories directly into your unpacked Subversion
183251881Speter      distribution.  With the exception of sqlite-amalgamation, they will
184251881Speter      still need to be configured, built and installed explicitly, and
185251881Speter      Subversion's own configure script may need to be told where to find
186251881Speter      them, if they were not installed in standard system locations.
187251881Speter
188251881Speter      Note: there are optional dependencies (such as openssl, swig, and httpd)
189251881Speter      which get-deps.sh does not download.
190251881Speter
191251881Speter      Note: Because previous builds of Subversion may have installed older
192251881Speter      versions of these libraries, you may want to run some of the cleanup
193251881Speter      commands described in section II.B before installing the following.
194251881Speter
195251881Speter
196299742Sdim      1.  Apache Portable Runtime 1.3 or newer  (REQUIRED)
197251881Speter
198251881Speter      Whenever you want to build any part of Subversion, you need the
199251881Speter      Apache Portable Runtime (APR) and the APR Utility (APR-util)
200251881Speter      libraries.
201251881Speter
202251881Speter      If you do not have a pre-installed APR and APR-util, you will need
203251881Speter      to get these yourself:
204251881Speter
205251881Speter          http://apr.apache.org/download.cgi
206251881Speter
207251881Speter      On Unix systems, if you already have the APR libraries compiled and do
208251881Speter      not wish to regenerate them from source code, then Subversion needs to
209251881Speter      be able to find them.
210251881Speter
211251881Speter      There are a couple of options to "./configure" that tell it where
212251881Speter      to look for the APR and APR-util libraries. By default it will try
213251881Speter      to locate the libraries using apr-config and apu-config scripts.
214251881Speter      These scripts provide all the relevant information for the APR and
215251881Speter      APR-util installations.
216251881Speter
217251881Speter      If you want to specify the location of the APR library, you can use
218251881Speter      the "--with-apr=" option of "./configure". It should be able to find
219251881Speter      the apr-config script in the standard location under that directory
220251881Speter      (e.g. ${prefix}/bin).
221251881Speter
222251881Speter      Similarly, you can specify the location of APR-util using the
223251881Speter      "--with-apr-util=" option to "./configure". It will look for the
224251881Speter      apu-config script relative to that directory.
225251881Speter
226251881Speter      For example, if you want to use the APR libraries you built
227251881Speter      with the Apache httpd server, you could run:
228251881Speter
229251881Speter          $ ./configure --with-apr=/usr/local/apache2 \
230251881Speter            --with-apr-util=/usr/local/apache2  ...
231251881Speter
232251881Speter      Be sure to use a native Windows SVN client (as opposed to
233251881Speter      Cygwin's version) so that the .dsp files get carriage-returns at
234251881Speter      the ends of their lines.  Otherwise Visual Studio will complain
235251881Speter      that it doesn't recognize the .dsp files.
236251881Speter
237251881Speter      If you use APR libraries checked out from svn in an Unix
238251881Speter      environment, you need to run the 'buildconf' script in each
239251881Speter      library's directory, to regenerate the configure scripts and
240251881Speter      other files required for compiling the libraries:
241251881Speter
242251881Speter      $ cd apr; ./buildconf; ./configure ...; make; make install; cd ..
243251881Speter
244251881Speter      $ cd apr-util; ./buildconf; ./configure ...; make; make install; cd ..
245251881Speter
246251881Speter      Configure build and install both libraries before running Subversion's
247251881Speter      configure script.
248251881Speter
249251881Speter
250251881Speter      2. Zlib  (REQUIRED)
251251881Speter
252251881Speter         Subversion's binary-differencing engine depends on zlib for
253251881Speter         compression.   Most Unix systems have libz pre-installed, but
254251881Speter         if you need it, you can get it from
255251881Speter
256299742Sdim            http://www.zlib.net/
257251881Speter
258251881Speter
259251881Speter      3.  autoconf 2.59 or newer (Unix only)
260251881Speter
261251881Speter      This is required only if you plan to build from the latest source
262251881Speter      (see section II.B). Generally only developers would be doing this.
263251881Speter
264251881Speter
265251881Speter      4.  libtool 1.4 or newer (Unix only)
266251881Speter
267251881Speter      This is required only if you plan to build from the latest source
268251881Speter      (see section II.B).
269251881Speter
270251881Speter      Note: Some systems (Solaris, for example) require libtool 1.4.3 or
271251881Speter      newer. The autogen.sh script knows about that.
272251881Speter
273251881Speter
274299742Sdim      5.  Serf library 1.3.4 or newer (OPTIONAL)
275251881Speter
276251881Speter      If you want your client to be able to speak to an Apache
277251881Speter      server (via a http:// or https:// URL), you must link against
278251881Speter      serf.  Though optional, we strongly recommend this.
279251881Speter
280251881Speter      In order to use ra_serf, you must install serf, and run Subversion's
281251881Speter      ./configure with the argument --with-serf.  If serf is installed in a
282251881Speter      non-standard place, you should use
283251881Speter
284251881Speter               --with-serf=/path/to/serf/install
285251881Speter
286251881Speter      instead.
287251881Speter
288251881Speter      Serf can be obtained via your system's package distribution
289251881Speter      system or directly from http://code.google.com/p/serf/.
290251881Speter
291251881Speter      For more information on serf and Subversion's ra_serf, see the file
292251881Speter      subversion/libsvn_ra_serf/README.
293251881Speter
294251881Speter      6. OpenSSL  (OPTIONAL)
295251881Speter
296251881Speter      ### needs some updates. I think serf automagically handles
297251881Speter      ### finding OpenSSL, but we may need more docco here. and w.r.t
298251881Speter      ### zlib.
299251881Speter
300251881Speter      The Serf library has support for SSL encryption by relying on the
301251881Speter      OpenSSL library.
302251881Speter
303251881Speter        a. Using OpenSSL on the client through Serf
304251881Speter
305251881Speter          On Unix systems, to build Serf with OpenSSL, you need OpenSSL
306251881Speter          installed on your system, and you must add "--with-ssl" as a
307251881Speter          "./configure" parameter.  If your OpenSSL installation is hard
308251881Speter          for Serf to find, you may need to use "--with-libs=/path/to/lib"
309251881Speter          in addition.  In particular, on Red Hat (but not Fedora Core) it
310251881Speter          is necessary to specify "--with-libs=/usr/kerberos" for OpenSSL
311251881Speter          to be found.  You can also specify a path to the zlib library
312251881Speter          using "--with-libs".
313251881Speter
314251881Speter          Under Windows, you can specify the paths to these libraries by
315251881Speter          passing the options --with-zlib and --with-openssl to gen-make.py.
316251881Speter
317299742Sdim        b. Using OpenSSL on the Apache server
318251881Speter
319251881Speter          You can also add support for these features to an Apache httpd
320251881Speter          server to be used for Subversion using the same support libraries.
321251881Speter          The Subversion build system will not provide them, however.  You
322251881Speter          add them by specifying parameters to the "./configure" script of
323251881Speter          the Apache Server instead.
324251881Speter
325251881Speter          For getting SSL on your server, you would add the "--enable-ssl"
326251881Speter          or "--with-ssl=/path/to/lib" option to Apache's "./configure"
327251881Speter          script.  Apache enables zlib support by default, but you can
328251881Speter          specify a nonstandard location for the library with the
329251881Speter          "--with-z=/path/to/dir" option.  Consult the Apache documentation
330251881Speter          for more details, and for other modules you may wish to install
331251881Speter          to enhance your Subversion server.
332251881Speter
333251881Speter      If you don't already have it, you can get a copy of OpenSSL,
334251881Speter      including instructions for building and packaging on both Unix
335251881Speter      systems and Windows, at:
336251881Speter
337251881Speter          http://www.openssl.org/
338251881Speter
339251881Speter
340251881Speter      7.  Berkeley DB 4.X  (OPTIONAL)
341251881Speter
342251881Speter      Berkeley DB is needed to build a Subversion server that supports
343251881Speter      the BDB repository filesystem, or to access a BDB repository on
344251881Speter      local disk.  If you will only use the FSFS repository filesystem,
345251881Speter      or if you are building a Subversion client that will only speak
346251881Speter      to remote (networked) repositories, you don't need it.
347251881Speter
348251881Speter      The current recommended version is 4.4.20 or newer, which brings
349251881Speter      auto-recovery functionality to the Berkeley DB database
350251881Speter      environment.
351251881Speter
352251881Speter      If you must use an older version of Berkeley DB, we *strongly*
353251881Speter      recommend using 4.3 or 4.2 over the 4.1 or 4.0 versions.  Not
354251881Speter      only are these significantly faster and more stable, but they
355251881Speter      also enable Subversion repositories to automatically clean up
356251881Speter      database journal files to save disk space.
357251881Speter
358251881Speter      You'll need Berkeley DB installed on your system.  You can
359251881Speter      get it from:
360251881Speter
361251881Speter      http://www.oracle.com/technology/software/products/berkeley-db/index.html
362251881Speter
363251881Speter      If you have Berkeley DB installed in a place not searched by default
364251881Speter      for includes and libraries, add something like this:
365251881Speter
366251881Speter          --with-berkeley-db=db.h:/usr/local/include/db4.7:/usr/local/lib/db4.7:db-4.7
367251881Speter
368251881Speter      to your `configure' switches, and the build process will use the
369251881Speter      Berkeley DB header and library in the named directories.  You may
370251881Speter      need to use a different path, of course.  Note that in order for
371251881Speter      the detection to succeed, the dynamic linker must be able to find
372251881Speter      the libraries at configure time.
373251881Speter
374251881Speter      If you are on the Windows platform and want to build Subversion,
375251881Speter      a precompiled version of the Berkeley DB library is available for
376251881Speter      download at the Subversion web site "Documents & files" area:
377251881Speter
378251881Speter          http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688
379251881Speter
380251881Speter      Look in the "Releases > Windows > Windows BDB" section.
381251881Speter
382251881Speter
383251881Speter      8.  Cyrus SASL library (OPTIONAL)
384251881Speter
385251881Speter      If the Simple Authentication and Security Layer (SASL) library
386251881Speter      is detected on your system, then the Subversion client and
387251881Speter      svnserve server can utilize its abilities for various forms of
388251881Speter      authentication.  To learn more about SASL or to get the source
389251881Speter      code, visit:
390251881Speter
391251881Speter         http://freshmeat.net/projects/cyrussasl/
392251881Speter
393251881Speter
394299742Sdim      9.  Apache Web Server 2.2.X or newer  (OPTIONAL)
395251881Speter
396251881Speter          (http://httpd.apache.org/download.cgi)
397251881Speter
398251881Speter      The Apache httpd server is one of two methods to make your Subversion
399251881Speter      repository available over a network - the other is a custom server
400251881Speter      program called svnserve, which requires no extra software packages.
401251881Speter      Building Subversion, the Apache server, and the modules that Apache
402251881Speter      needs to communicate with Subversion are complicated enough that there
403251881Speter      is a whole section at the end of this document that describes how it
404251881Speter      is done: See section III for details.
405251881Speter
406251881Speter
407299742Sdim      10.  Python 2.7 or newer (http://www.python.org/)  (OPTIONAL)
408251881Speter
409251881Speter      If you want to run "make check" or build from the latest source
410299742Sdim      under Unix/Windows as described in section II.B, II.E and III.D,
411299742Sdim      install Python 2.7 or higher on your system. The majority of the
412299742Sdim      test suite is written in Python, as is part of Subversion's build
413251881Speter      system.
414251881Speter
415299742Sdim      Note that Python 3.x is not supported and most likely won't work.
416251881Speter
417299742Sdim
418251881Speter      11. Perl 5.8 or newer (Windows only)  (OPTIONAL)
419251881Speter
420251881Speter      To build Subversion under any of the MS Windows platforms, you
421251881Speter      will also need Perl 5.8 or newer to run apr-util's w32locatedb.pl
422251881Speter      script.
423251881Speter
424251881Speter
425299742Sdim      12. SQLite  (REQUIRED)
426251881Speter
427299742Sdim      Subversion requires SQLite version 3.7.12 or above.  You can meet this
428299742Sdim      dependency several ways:
429251881Speter        * Use an SQLite amalgamation file.
430251881Speter        * Specify an SQLite installation to use.
431251881Speter        * Let Subversion find an installed SQLite.
432251881Speter
433251881Speter      To use an SQLite-provided amalgamation, just drop sqlite3.c into
434251881Speter      Subversion's sqlite-amalgamation/ directory, or point to it with the
435251881Speter      --with-sqlite configure option.  This file also ships with the Subversion
436251881Speter      dependencies distribution, or you can download it from SQLite:
437251881Speter
438251881Speter          http://www.sqlite.org/download.html
439251881Speter
440251881Speter
441299742Sdim      13. pkg-config  (Unix only, OPTIONAL)
442251881Speter
443251881Speter      Subversion uses pkg-config to find appropriate options used
444251881Speter      at build time.
445251881Speter
446251881Speter
447299742Sdim      14. D-Bus  (Unix only, OPTIONAL)
448251881Speter
449251881Speter      D-Bus is a message bus system. D-Bus is required for support for KWallet
450251881Speter      and GNOME Keyring. pkg-config is needed to find D-Bus headers and library.
451251881Speter
452251881Speter
453299742Sdim      15. Qt 4  (Unix only, OPTIONAL)
454251881Speter
455251881Speter      Qt is a cross-platform application framework. QtCore, QtDBus and QtGui
456251881Speter      modules are required for support for KWallet. pkg-config is needed
457251881Speter      to find Qt headers and libraries.
458251881Speter
459251881Speter
460299742Sdim      16. KDELibs 4  (Unix only, OPTIONAL)
461251881Speter
462251881Speter      Subversion contains optional support for storing passwords in KWallet.
463251881Speter      KDELibs contains core KDE libraries. Subversion uses libkdecore and libkdeui
464251881Speter      libraries when support for KWallet is enabled. kde4-config is used to get
465251881Speter      some necessary options. pkg-config, D-Bus and Qt 4 are also required.
466251881Speter      If you want to build support for KWallet, then pass the '--with-kwallet'
467251881Speter      option to `configure`. If KDE is installed in a non-standard prefix, then
468251881Speter      use:
469251881Speter
470251881Speter          --with-kwallet=/path/to/KDE/prefix
471251881Speter
472299742Sdim      17. GLib 2  (Unix only, OPTIONAL)
473251881Speter
474251881Speter      GLib is a general-purpose utility library. GLib is required for support
475251881Speter      for GNOME Keyring. pkg-config is needed to find GLib headers and library.
476251881Speter
477251881Speter
478299742Sdim      18. GNOME Keyring  (Unix only, OPTIONAL)
479251881Speter
480251881Speter      Subversion contains optional support for storing passwords in GNOME Keyring.
481251881Speter      pkg-config is needed to find GNOME Keyring headers and library. D-Bus and
482251881Speter      GLib are also required. If you want to build support for GNOME Keyring,
483251881Speter      then pass the '--with-gnome-keyring' option to `configure`.
484251881Speter
485251881Speter
486299742Sdim      19. Ctypesgen  (OPTIONAL)
487251881Speter
488251881Speter      Ctypesgen is Python wrapper generator for ctypes. It is used to generate
489251881Speter      a part of Subversion Ctypes Python bindings (CSVN). If you want to build
490251881Speter      CSVN, then pass the '--with-ctypesgen' option to `configure`. If ctypesgen.py
491251881Speter      is installed in a non-standard place, then use:
492251881Speter
493251881Speter          --with-ctypesgen=/path/to/ctypesgen.py
494251881Speter
495251881Speter      For more information on CSVN, see subversion/bindings/ctypes-python/README.
496251881Speter
497299742Sdim      20. libmagic (OPTIONAL)
498251881Speter
499251881Speter      Subversion's configure script attempts to find libmagic automatically.
500251881Speter      If it is installed in a non-standard location, then use:
501251881Speter
502251881Speter        --with-libmagic=/path/to/libmagic/prefix
503251881Speter
504251881Speter      The files include/magic.h and lib/libmagic.so.1.0 (or similar)
505251881Speter      are expected beneath this prefix directory. If they cannot be
506251881Speter      found Subversion will be compiled without support for libmagic.
507251881Speter
508251881Speter      If libmagic is installed but support for it should not be compiled
509251881Speter      in, then use:
510251881Speter      
511251881Speter        --with-libmagic=no
512251881Speter
513251881Speter      If configure should fail when libmagic is not present, but only
514251881Speter      the default locations should be searched, then use:
515251881Speter
516251881Speter        --with-libmagic
517251881Speter
518299742Sdim      21. Googlemock (OPTIONAL)
519299742Sdim
520299742Sdim      Googlemock can be installed and built in-tree by invoking
521299742Sdim
522299742Sdim      $ ./get-dep.sh gmock
523299742Sdim
524251881Speter  D. Documentation
525251881Speter
526251881Speter      The primary documentation for Subversion is the free book
527251881Speter      "Version Control with Subversion", a.k.a. "The Subversion Book",
528251881Speter      obtainable from http://svnbook.red-bean.com/.
529251881Speter
530251881Speter      Various additional documentation exists in the doc/ subdirectory of
531251881Speter      the Subversion source.  See the file doc/README for more information.
532251881Speter
533251881Speter
534251881Speter
535251881SpeterII.   INSTALLATION
536251881Speter      ============
537251881Speter
538299742Sdim  A.  Building from a Tarball
539251881Speter      ------------------------------
540251881Speter
541251881Speter      1.  Building from a Tarball
542251881Speter
543251881Speter      Download the most recent distribution tarball from:
544251881Speter
545251881Speter          http://subversion.apache.org/download/
546251881Speter
547251881Speter      Unpack it, and use the standard GNU procedure to compile:
548251881Speter
549251881Speter          $ ./configure
550251881Speter          $ make
551251881Speter          # make install
552251881Speter
553299742Sdim      You can also run the full test suite by running 'make check'.  Even
554299742Sdim      in successful runs, some tests will report XFAIL; that is normal.
555299742Sdim      Failed runs are indicated by FAIL or XPASS results, or a non-zero exit
556299742Sdim      code from "make check".
557251881Speter
558251881Speter
559251881Speter  B.  Building the Latest Source under Unix
560251881Speter      -------------------------------------
561251881Speter
562251881Speter      These instructions assume you have already installed Subversion
563251881Speter      and checked out a working copy of Subversion's own code --
564251881Speter      either the latest /trunk code, or some branch or tag.  You also
565251881Speter      need to have already installed whatever prerequisites that
566251881Speter      version of Subversion requires (if you haven't, the ./configure
567251881Speter      step should complain).
568251881Speter
569251881Speter      You can discard the directory created by the tarball; you're
570251881Speter      about to build the latest, greatest Subversion client.  This is
571251881Speter      the procedure Subversion developers use.
572251881Speter
573251881Speter      First off, if you have any Subversion libraries lying around
574251881Speter      from previous 'make installs', clean them up first!
575251881Speter
576251881Speter          # rm -f /usr/local/lib/libsvn*
577251881Speter          # rm -f /usr/local/lib/libapr*
578251881Speter          # rm -f /usr/local/lib/libserf*
579251881Speter
580251881Speter      Start the process by running "autogen.sh":
581251881Speter
582251881Speter          $ sh ./autogen.sh
583251881Speter
584251881Speter      This script will make sure you have all the necessary components
585251881Speter      available to build Subversion.  If any are missing, you will be
586299742Sdim      told where to get them from.  (See the 'Dependency Overview' in
587251881Speter      section I.)
588251881Speter
589251881Speter      Note: if the command "autoconf" on your machine does not run
590251881Speter      autoconf 2.59 or later, but you do have a new enough autoconf
591251881Speter      available, then you can specify the correct one with the
592251881Speter      AUTOCONF variable.  (The AUTOHEADER variable is similar.)  This
593251881Speter      may be required on Debian GNU/Linux, where "autoconf" is
594251881Speter      actually a Perl script that attempts to guess which version is
595251881Speter      required -- because of the interaction between Subversion's and
596251881Speter      APR's configuration systems, the Perl script may get it wrong.
597251881Speter      So for example, you might need to do:
598251881Speter
599251881Speter          $ AUTOCONF=autoconf2.59 sh ./autogen.sh
600251881Speter
601251881Speter      Once you've prepared the working copy by running autogen.sh,
602251881Speter      just follow the usual configuration and build procedure:
603251881Speter
604251881Speter          $ ./configure
605251881Speter          $ make
606251881Speter          # make install
607251881Speter
608251881Speter      (Optionally, you might want to pass --enable-maintainer-mode to
609251881Speter      the ./configure script.  This enables debugging symbols in your
610251881Speter      binaries (among other things) and most Subversion developers use it.)
611251881Speter
612251881Speter      Since the resulting binary depends on shared libraries, the
613251881Speter      destination library directory must be identified in your
614251881Speter      operating system's library search path. That is in either
615251881Speter      /etc/ld.so.conf or $LD_LIBRARY_PATH for Linux systems and in
616251881Speter      /etc/rc.conf for FreeBSD, followed by a run of the 'ldconfig'
617251881Speter      program. Check your system documentation for details. By
618251881Speter      identifying the destination directory, Subversion will be able
619251881Speter      to dynamically load repository access plugins.  If you try to do
620251881Speter      a checkout and see an error like:
621251881Speter
622251881Speter      subversion/libsvn_ra/ra_loader.c:209: (apr_err=170000)
623251881Speter      svn: Unrecognized URL scheme 'https://svn.apache.org/repos/asf/subversion/trunk'
624251881Speter
625251881Speter      It probably means that the dynamic loader/linker can't find all
626251881Speter      of the libsvn_* libraries.
627251881Speter
628251881Speter
629251881Speter  C.  Building under Unix in Different Directories
630251881Speter      --------------------------------------------
631251881Speter
632251881Speter      It is possible to configure and build Subversion on Unix in a
633251881Speter      directory other than the working copy. For example
634251881Speter
635251881Speter          $ svn co https://svn.apache.org/repos/asf/subversion/trunk svn
636251881Speter          $ cd svn
637251881Speter          $ # get SQLite amalgamation if required
638251881Speter          $ chmod +x autogen.sh
639251881Speter          $ ./autogen.sh
640251881Speter          $ mkdir ../obj
641251881Speter          $ cd ../obj
642251881Speter          $ ../svn/configure [...with options as appropriate...]
643251881Speter          $ make
644251881Speter
645251881Speter      puts the Subversion working copy in the directory svn and builds
646251881Speter      it in a separate, parallel directory obj.
647251881Speter
648251881Speter      Why would you want to do this? Well there are a number of
649251881Speter      reasons...
650251881Speter
651251881Speter          *  You may prefer to avoid "polluting" the working copy with
652251881Speter             files generated during the build.
653251881Speter
654251881Speter          *  You may want to put the build directory and the working
655251881Speter             copy on different physical disks to improve performance.
656251881Speter
657251881Speter          *  You may want to separate source and object code and only
658251881Speter             backup the source.
659251881Speter
660251881Speter          *  You may want to remote mount the working copy on multiple
661251881Speter             machines, and build for different machines from the same
662251881Speter             working copy.
663251881Speter
664251881Speter          *  You may want to build multiple configurations from the
665251881Speter             same working copy.
666251881Speter
667251881Speter      The last reason above is possibly the most useful.  For instance
668251881Speter      you can have separate debug and optimized builds each using the
669251881Speter      same working copy. Or you may want a client-only build and a
670251881Speter      client-server build. Using multiple build directories you can
671251881Speter      rebuild any or all configurations after an edit without the need
672251881Speter      to either clean and reconfigure, or identify and copy changes
673251881Speter      into another working copy.
674251881Speter
675251881Speter
676251881Speter  D.  Installing from a Zip or Installer File under Windows
677251881Speter      --------------------------------------------------------
678251881Speter
679251881Speter      Of all the ways of getting a Subversion client, this is the
680251881Speter      easiest.  Download a Zip (*.zip) or self-extracting installer
681251881Speter      (*-setup.exe) file from:
682251881Speter
683251881Speter      http://subversion.apache.org/packages#windows
684251881Speter
685251881Speter      For a Zip file, run your unzipping utility (WinZIP, ZipGenius,
686251881Speter      UltimateZIP, FreeZIP, whatever) and extract the DLLs and EXEs to
687251881Speter      a directory of your choice. Included in the download is the SVN
688251881Speter      client, the SVNADMIN administration tool, and the SVNLOOK
689251881Speter      reporting tool.
690251881Speter
691251881Speter      Note that if you need support for non-English locales you'll have
692251881Speter      to set the APR_ICONV_PATH environment variable to the path of the
693251881Speter      iconv directory in the folder that contains the Subversion install.
694251881Speter
695251881Speter      You may also want to add the bin directory in the Subversion folder
696251881Speter      to your PATH environment variable so as to not have to use the full
697251881Speter      path when running Subversion commands.
698251881Speter
699251881Speter      To test the installation, open a DOS box (run either "cmd" or
700251881Speter      "command" from the Start menu's "Run..." menu option), change to
701251881Speter      the directory you installed the executables into, and run:
702251881Speter
703251881Speter          C:\test>svn co https://svn.apache.org/repos/asf/subversion/trunk svn
704251881Speter
705251881Speter      This will get the latest Subversion sources and put them into the
706251881Speter      "svn" subdirectory.
707251881Speter
708251881Speter      If using a self-extracting .exe file, just run it instead of
709251881Speter      unzipping it, to install Subversion.
710251881Speter
711251881Speter  E.  Building the Latest Source under Windows
712251881Speter      ----------------------------------------
713251881Speter
714251881Speter  E.1 Prerequisites
715251881Speter
716251881Speter      * Visual Studio 6 and service pack. It can be built with later versions
717299742Sdim        of Visual Studio (Visual Studio.NET 2005-2015, Visual C++ Express
718299742Sdim        2005-2010, Visual Studio Express 2012-2013 and Visual Studio Community
719299742Sdim        2013-2015) but these instructions assume VS6.
720251881Speter      * A recent Windows SDK. (Not needed with Visual Studio 2005 and later)
721251881Speter        If you are using Visual Studio 6, you need the latest SDK which
722299742Sdim        is compatible with VC6, which is the one from February 2003.
723251881Speter        You can get it from MSDN:
724299742Sdim        https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/e1147034-9b0b-4494-a5bc-6dfebb6b7eb1/download-and-install-microsoft-platform-sdk-febuary-2003-last-version-with-vc6-support?forum=windowssdk
725299742Sdim      * Python 2.7 or higher, downloaded from http://www.python.org/ which is
726251881Speter        used to generate the project files.
727299742Sdim        Note that Python 3.x is not supported (yet).
728251881Speter      * Perl 5.8 or higher from http://www.activestate.com/
729251881Speter      * Awk (from http://www.cs.princeton.edu/~bwk/btl.mirror/awk95.exe) is
730251881Speter        needed to compile Apache or APR.  Note that this is the actual awk
731251881Speter        program, not an installer - just rename it to awk.exe and it is
732251881Speter        ready to use.
733251881Speter      * Apache apr, apr-util, and optionally apr-iconv libraries, version
734299742Sdim        1.3 or later. Included in both the Subversion dependencies ZIP file
735251881Speter        and the Apache 2 source zip.  If you are building from a Subversion
736251881Speter        checkout and have not downloaded Apache 2, then get these 3 libraries
737251881Speter        from http://www.apache.org/dist/apr/.
738299742Sdim      * SQLite 3.7.12 or higher from http://www.sqlite.org/download.html
739251881Speter      * ZLib 1.2 or higher is required and is included in the Subversion
740299742Sdim        dependencies zip file or can be obtained from http://www.zlib.net/
741251881Speter      * Either a Subversion client binary from http://subversion.apache.org/ to
742251881Speter        do the initial checkout of the Subversion source or the zip file
743251881Speter        source distribution. See the section "Bootstrapping from a Zip or
744251881Speter        Installer File under Windows" above for more.
745251881Speter      * A means of unpacking the files, e.g., WinZIP or similar.
746251881Speter
747251881Speter      Additional Options
748251881Speter
749251881Speter      * [Optional] Apache 2 source, downloaded from
750251881Speter        http://httpd.apache.org/download.cgi, these instructions assume
751251881Speter        version 2.0.58.  This is only needed for building the Subversion
752299742Sdim        server Apache modules.  ### FIXME Apache 2.2 or greater required.
753251881Speter      * [Optional] Apache 2 msi install file, also from
754251881Speter        http://httpd.apache.org/download.cgi (required for running the
755251881Speter        tests).  Only needed for testing the server dso modules and if
756251881Speter        you are using Visual Studio 6.
757251881Speter        Note that if you are not using Visual Studio 6 (and you want to
758251881Speter        run and test the server modules) then you must rebuild Apache
759251881Speter        from source -- do not use the stock MSI since mixing C runtime
760251881Speter        libraries is not supported.
761251881Speter      * [Optional] Berkeley DB for backend support of the server
762251881Speter        components -- versions 4.3.27 and 4.4.20 are available from
763251881Speter        http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688
764251881Speter        as db-4.3.27-win32.zip and db-4.4.20-win32.zip.
765299742Sdim        For more information see Section I.C.7.
766251881Speter      * [Optional] Openssl 0.9.7f or higher can be obtained from
767251881Speter        http://www.openssl.org/source/openssl-0.9.7f.tar.gz
768251881Speter      * [Optional] A modified version of GNU libintl, called
769251881Speter        svn-win32-libintl.zip, can be used for displaying localized
770251881Speter        messages. Available at:
771251881Speter        http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=2627
772251881Speter      * [Optional] GNU gettext for generating message catalog (.mo)
773251881Speter        files from message translations. You can get the latest
774251881Speter        binaries from http://gnuwin32.sourceforge.net/. You'll need the
775251881Speter        binaries (gettext-0.14.1-bin.zip) and dependencies
776251881Speter        (gettext-0.14.1-dep.zip).
777251881Speter      * [Optional] An assembler, e.g., MASM32 from http://www.masm32.com/
778251881Speter        or nasm which is available from
779251881Speter        http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D
780251881Speter
781251881Speter  E.2 Notes
782251881Speter
783251881Speter      The Serf library supports secure connections with OpenSSL and
784251881Speter      on-the-wire compression with zlib. If you want to use the
785251881Speter      secure connections feature, you should pass the option
786299742Sdim      "--with-openssl" to the gen-make.py script. See Section I.C.6 for
787251881Speter      more details.
788251881Speter
789251881Speter  E.3 Preparation
790251881Speter
791251881Speter      This section describes how to unpack the files to make a build tree.
792251881Speter
793251881Speter      * Make a directory SVN and cd into it.
794251881Speter      * Either checkout Subversion:
795251881Speter
796251881Speter          svn co https://svn.apache.org/repos/asf/subversion/trunk src-trunk
797251881Speter
798251881Speter        or unpack the zip file distribution and rename the directory to
799251881Speter        src-trunk.
800251881Speter
801251881Speter      * Install Visual Studio Environment. You either have to tell the
802251881Speter        installer to register environment variables or run VCVARS32.BAT
803251881Speter        before building anything.  If you are using a newer Visual Studio,
804299742Sdim        use the 'Visual Studio 20xx Command Prompt' on the Start menu.
805251881Speter      * Install and register a recent Windows Core SDK if you are using
806251881Speter        Visual Studio 6. This is a quote from the Microsoft February 2003
807251881Speter        SDK documentation:
808251881Speter
809251881Speter       "To register the SDK bin, include, and library directories with
810251881Speter        Microsoft Visual Studio�� version 6.0 and Visual Studio .NET,
811251881Speter        click Start, point to All Programs, point to Microsoft Platform
812251881Speter        SDK February 2003, point to Visual Studio Registration, and then
813251881Speter        click Register PSDK Directories with Visual Studio. This
814251881Speter        registration process places the SDK bin, include, and library
815251881Speter        directories at the beginning of the search paths, which ensures
816251881Speter        that the latest headers and libraries are used when building
817251881Speter        applications in the IDE. Note that for Visual Studio 6.0
818251881Speter        integration to succeed, Visual Studio 6.0 must run at least once
819251881Speter        before you select Register PSDK Directories with Visual
820251881Speter        Studio. Also note that when this option is run, the IDEs should
821251881Speter        not be running."
822251881Speter
823251881Speter      * Install Python and add it to your path
824251881Speter      * Install Perl (it should add itself to the path)
825251881Speter      * Copy AWK (awk95.exe) to awk.exe (e.g. SVN\awk\awk.exe) and add
826251881Speter        the directory containing it (e.g. SVN\awk) to the path.
827299742Sdim      * [Optional] Install Apache 2 using the msi file if you are going to test
828299742Sdim        the server dso modules and are using Visual Studio 6.  You must build
829251881Speter        and install it from source if you are not using Visual Studio 6 and
830251881Speter        want to build and/or test the server modules.
831299742Sdim      * [Optional] If you checked out Subversion from the repository and want
832299742Sdim        to build Subversion with http/https access support then install the
833299742Sdim        serf sources into SVN\src-trunk\serf.
834299742Sdim      * [Optional] If you want BDB backend support, extract the Berkeley DB
835299742Sdim        files into SVN\src-trunk\db4-win32. It's a good idea to add
836251881Speter        SVN\src-trunk\db4-win32\bin to your PATH, so that Subversion can find
837251881Speter        the Berkeley DB DLLs.
838251881Speter
839251881Speter        [NOTE: This binary package of Berkeley DB is provided for
840251881Speter            convenience only. Please don't address questions about
841251881Speter            Berkeley DB that aren't directly related to using Subversion
842251881Speter            to the project mailing list.]
843251881Speter
844251881Speter        If you build Berkeley DB from the source, you will have to copy
845251881Speter        the file db-x.x.x\build_win32\db.h to
846251881Speter        SVN\src-trunk\db4-win32\include, and all the import libraries to
847251881Speter        SVN\src-trunk\db4-win32\lib. Again, the DLLs should be somewhere in
848251881Speter        your path.
849251881Speter
850299742Sdim      * [Optional] If you want to build the server modules, extract Apache
851299742Sdim        source into SVN\httpd-2.x.x.
852251881Speter      * If you are building from a checkout of Subversion, and you are NOT
853251881Speter        building Apache, then you will need the APR libraries.  Depending
854251881Speter        on how you got your version of APR, either:
855251881Speter          - Extract the APR, APR-util and APR-iconv source distributions into
856251881Speter            SVN\apr, SVN\apr-util, and SVN\apr-iconv respectively.
857251881Speter        Or:
858251881Speter          - Extract the apr, apr-util and apr-iconv directories from the
859251881Speter            srclib folder in the Apache httpd source into SVN\apr,
860251881Speter            SVN\apr-util, and SVN\apr-iconv respectively.
861251881Speter      * Extract the ZLib sources into SVN\zlib if you are not using the zlib
862251881Speter        included in the dependencies zip file.
863299742Sdim      * [Optional] If you want secure connection (https) client support, or if
864299742Sdim        you are building with enabled support for serf extract openssl into
865299742Sdim        SVN\openssl-x.x.x
866299742Sdim      * [Optional] If you want localized message support, extract
867299742Sdim        svn-win32-libintl.zip into SVN\svn-win32-libintl and extract
868299742Sdim        gettext-x.x.x-bin.zip and gettext-x.x.x-dep.zip into
869299742Sdim        SVN\gettext-x.x.x-bin.
870251881Speter        Add SVN\gettext-x.x.x-bin\bin to your path.
871251881Speter      * [Optional] Extract MASM32 (only the ML.EXE and ML.ERR files) into
872251881Speter        SVN\asm (or extract nasm into SVN\asm) and put it in your path.
873299742Sdim      * Download the SQLite amalgemation from
874299742Sdim        http://www.sqlite.org/download.html
875299742Sdim        and extract it into SVN\sqlite-amalgemation.
876299742Sdim        See I.C.12 for alternatives to using the amalgemation package.
877251881Speter
878251881Speter  E.4 Building the Binaries
879251881Speter
880251881Speter      To build the binaries either follow the instructions here or use
881251881Speter      build\win32\vc6-build.bat.in after editing its default paths to match
882251881Speter      yours and saving it as vc6-build.bat.  The vc6-build.bat does a full build
883251881Speter      using all options so it requires Apache 2 source and the other optional
884251881Speter      components.
885251881Speter
886251881Speter      Start in the SVN directory you created.
887251881Speter
888251881Speter      Set up the environment (commands should be one line even if wrapped here).
889251881Speter
890251881Speter      C:>set VER=trunk
891251881Speter      C:>set DIR=trunk
892299742Sdim      C:>set BUILD_ROOT=C:\SVN
893251881Speter      C:>set PYTHONDIR=C:\Python22
894251881Speter      C:>set AWKDIR=C:\SVN\Awk
895251881Speter      C:>set ASMDIR=C:\SVN\asm
896299742Sdim      C:>set SDKINC="C:\Program Files\Microsoft SDK\include"
897299742Sdim      C:>set SDKLIB="C:\Program Files\Microsoft SDK\lib"
898251881Speter      C:>set GETTEXTBIN=C:\SVN\gettext-0.14.1-bin\bin
899299742Sdim      C:>PATH=%PATH%;%BUILD_ROOT%\src-%DIR%\db4-win32;%ASMDIR%;
900251881Speter              %PYTHONDIR%;%AWKDIR%;%GETTEXTBIN%
901251881Speter      C:>set INCLUDE=%SDKINC%;%INCLUDE%
902251881Speter      C:>set LIB=%SDKLIB%;%LIB%
903251881Speter
904251881Speter      OpenSSL
905251881Speter
906251881Speter      C:>cd openssl-0.9.7f
907251881Speter      C:>perl Configure VC-WIN32
908251881Speter  [*] C:>call ms\do_masm
909251881Speter      C:>nmake -f ms\ntdll.mak
910251881Speter      C:>cd out32dll
911251881Speter      C:>call ..\ms\test
912251881Speter      C:>cd ..\..
913251881Speter
914251881Speter      *Note: Use "call ms\do_nasm" if you have nasm instead of MASM, or
915251881Speter             "call ms\do_ms" if you don't have an assembler.
916251881Speter
917251881Speter      Apache 2
918251881Speter
919251881Speter      This step is only required for building the server dso modules.
920251881Speter
921251881Speter      C:>set APACHEDIR=C:\Program Files\Apache Group\Apache2
922251881Speter      C:>msdev httpd-2.0.58\apache.dsw /MAKE "BuildBin - Win32 Release"
923251881Speter
924299742Sdim      APR
925299742Sdim
926299742Sdim      If you downloaded APR / APR-UTIL / APR_ICONV by source, you will have to
927299742Sdim      build these libraries first.
928299742Sdim      Building these libraries on Windows is straight forward and in most cases
929299742Sdim      as simple as issuing these two commands:
930299742Sdim
931299742Sdim      C:>nmake -f Makefile.win
932299742Sdim      C:>nmake -f Makefile.win install
933299742Sdim
934299742Sdim      Please refere to the build instructions provided by the library source
935299742Sdim      for actual build instructions.
936299742Sdim
937299742Sdim      ZLib
938299742Sdim
939299742Sdim      If you downloaded the zlib source, you will have to build ZLib first.
940299742Sdim      Building ZLib using Visual Studio should be quite simple. Just open the
941299742Sdim      appropriate solution and build the project zlibstat using the IDE.
942299742Sdim
943299742Sdim      Please refere to the build instructions provided by the library source
944299742Sdim      for actual build instructions.
945299742Sdim
946299742Sdim      Note that you'd make sure to define ZLIB_WINAPI in the ZLib config
947299742Sdim      header and move the lib-file into the zlib root-directory.
948299742Sdim
949299742Sdim      Serf
950299742Sdim
951299742Sdim      ### Section about serf might be required/useful to add.
952299742Sdim      ### scons is required too and serf needs to be configured prior to be
953299742Sdim      ### able to build Subversion using:
954299742Sdim      ### scons APR=[PATH_TO_APR] APU=[PATH_TO_APU] OPENSSL=[PATH_TO_OPENSSL]
955299742Sdim      ### ZLIB=[PATH_TO_ZLIB] PREFIX=[PATH_TO_SERF_DEST]
956299742Sdim      ### scons check
957299742Sdim      ### scons install
958299742Sdim
959251881Speter      Subversion
960251881Speter
961251881Speter      Things to note:
962251881Speter
963251881Speter      * If you don't want to build mod_dav_svn, omit the --with-httpd
964251881Speter        option.  The zip file source distribution contains apr, apr-util and
965251881Speter        apr-iconv in the default build location. If you have downloaded the
966251881Speter        apr files yourself you will have to tell the generator where to find
967251881Speter        the APR libraries; the options are --with-apr, --with-apr-util and
968251881Speter        --with-apr-iconv.
969251881Speter      * If you would like a debug build substitute Debug for Release in
970299742Sdim        the msdev/msbuild commands.
971251881Speter      * There have been rumors that Subversion on Win32 can be built
972251881Speter        using the latest cygwin, you probably don't want the zip file source
973251881Speter        distribution though. ymmv.
974251881Speter      * The /USEENV switch to msdev makes it take notice of the INCLUDE and
975251881Speter        LIB environment variables, it also makes it ignore its own lib and
976251881Speter        include settings so you need to have the Windows SDK lib and include
977251881Speter        directories in the LIB and INCLUDE environment variables.  Do *not*
978251881Speter        use this switch when starting up the msdev Visual environment.  If you
979251881Speter        wish to build in the Visual environment the SDK lib and include
980251881Speter        directories must be in the Tools/Options/Directories settings (if you
981251881Speter        followed the 'Register the SDK with Visual Studio 6' instructions
982251881Speter        above this has been done for you).
983299742Sdim      * If you are using Visual Studio later than VC6 change -t dsw into
984299742Sdim        -t vcproj and add the --vsnet-version=20xx option on the gen-make.py
985299742Sdim        command.
986251881Speter        In this case you will also have to distribute the C runtime dll with
987251881Speter        the binaries.  Also, since Apache/APR do not provide .vcproj files,
988251881Speter        you will need to convert the Apache/APR .dsp files to .vcproj files
989251881Speter        with Visual Studio before building -- just open the Apache .dsw file
990251881Speter        and answer 'Yes To All' when the conversion dialog pops up, or you
991251881Speter        can open the individual .dsp files and convert them one at a time.
992251881Speter        The Apache/APR projects required by Subversion are:
993251881Speter        apr-util\libaprutil.dsp, apr\libapr.dsp,
994251881Speter        apr-iconv\libapriconv.dsp, apr-util\xml\expat\lib\xml.dsp,
995251881Speter        apr-iconv\ccs\libapriconv_ccs_modules.dsp, and
996251881Speter        apr-iconv\ces\libapriconv_ces_modules.dsp.
997251881Speter      * If the server dso modules are being built and tested Apache must not
998251881Speter        be running or the copy of the dso modules will fail.
999251881Speter
1000251881Speter      C:>cd src-%DIR%
1001251881Speter
1002251881Speter      If Apache 2 has been built and the server modules are required then
1003251881Speter      gen-make.py will already have been run. If the source is from the zip
1004251881Speter      file, Apache 2 has not been built so gen-make.py must be run:
1005251881Speter
1006251881Speter      C:>python gen-make.py -t dsp --with-berkeley-db=db4-win32
1007251881Speter          --with-openssl=..\openssl-0.9.7f --with-zlib=..\zlib
1008251881Speter          --with-libintl=..\svn-win32-libintl
1009251881Speter
1010251881Speter      Then build subversion:
1011251881Speter
1012251881Speter      C:>msdev subversion_msvc.dsw /USEENV /MAKE "__ALL_TESTS__ - Win32 Release"
1013251881Speter      C:>cd ..
1014251881Speter
1015299742Sdim      Or, with Visual C++.NET 2005 or C++ Express 2005:
1016251881Speter
1017251881Speter      C:>devenv subversion_vcnet.sln /build "Release" /project "__ALL_TESTS__"
1018251881Speter      C:>cd ..
1019251881Speter
1020299742Sdim      Or, with Visual C++.NET 2008+, C++ Express 2008+, Studio Express 2012+ or
1021299742Sdim      Studio Community 2013+:
1022251881Speter
1023251881Speter      C:>msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release
1024251881Speter      C:>cd ..
1025251881Speter
1026251881Speter      The binaries have now been built.
1027251881Speter
1028251881Speter  E.5 Packaging the binaries
1029251881Speter
1030251881Speter      You now need to copy the binaries ready to make the release zip
1031251881Speter      file. You also need to do this to run the tests as the new binaries
1032251881Speter      need to be in your path. You can use the build/win32/make_dist.py
1033251881Speter      script in the Subversion source directory to do that.
1034251881Speter
1035251881Speter      [TBD: Describe how to do this. Note dependencies on zip, jar, doxygen.]
1036251881Speter
1037251881Speter  E.6 Testing the Binaries
1038251881Speter      [TBD: It's been a long, long while since it was necessary to move
1039251881Speter            binaries around for testing. win-tests.py does that automagically.
1040251881Speter            Fix this section accordingly, and probably reorder, putting
1041251881Speter            the packaging at the end.]
1042251881Speter
1043251881Speter      The build process creates the binary test programs but it does not
1044251881Speter      copy the client tests into the release test area.
1045251881Speter
1046251881Speter      C:>cd src-%DIR%
1047251881Speter      C:>mkdir Release\subversion\tests\cmdline
1048251881Speter      C:>xcopy /S /Y subversion\tests\cmdline Release\subversion\tests\cmdline
1049251881Speter
1050251881Speter      If the server dso modules  have been built then copy the dso files and
1051251881Speter      dlls into the Apache modules directory.
1052251881Speter
1053251881Speter      C:>copy Release\subversion\mod_dav_svn\mod_dav_svn.so "%APACHEDIR%"\modules
1054251881Speter      C:>copy Release\subversion\mod_authz_svn\mod_authz_svn.so
1055251881Speter         "%APACHEDIR%"\modules
1056251881Speter      C:>copy svn-win32-%VER%\bin\intl.dll "%APACHEDIR%\bin"
1057251881Speter      C:>copy svn-win32-%VER%\bin\iconv.dll "%APACHEDIR%\bin"
1058251881Speter      C:>copy svn-win32-%VER%\bin\libdb42.dll "%APACHEDIR%\bin"
1059251881Speter      C:>cd ..
1060251881Speter
1061251881Speter      Put the svn-win32-trunk\bin directory at the start of your path so
1062251881Speter      you run the newly built binaries and not another version you might
1063251881Speter      have installed.
1064251881Speter
1065251881Speter      Then run the client tests:
1066251881Speter
1067299742Sdim      C:>PATH=%BUILD_ROOT%\svn-win32-%VER%\bin;%PATH%
1068251881Speter      C:>cd src-%DIR%
1069251881Speter      C:>python win-tests.py -c -r -v
1070251881Speter
1071251881Speter      If the server dso modules were built configure Apache to use the
1072251881Speter      mod_dav_svn and mod_authz_svn modules by making sure these lines appear
1073251881Speter      uncommented in httpd.conf:
1074251881Speter
1075251881Speter        LoadModule dav_module         modules/mod_dav.so
1076251881Speter        LoadModule dav_fs_module      modules/mod_dav_fs.so
1077251881Speter        LoadModule dav_svn_module     modules/mod_dav_svn.so
1078251881Speter        LoadModule authz_svn_module   modules/mod_authz_svn.so
1079251881Speter
1080251881Speter      And further down the file add location directives to point to the
1081251881Speter      test repositories. Change the paths to the SVN directory you created
1082251881Speter      (paths should be on one line even if wrapped here):
1083251881Speter
1084251881Speter        <Location /svn-test-work/repositories>
1085251881Speter         DAV svn
1086251881Speter         SVNParentPath C:/SVN/src-trunk/Release/subversion/tests/cmdline/
1087251881Speter                       svn-test-work/repositories
1088251881Speter        </Location>
1089251881Speter
1090251881Speter        <Location /svn-test-work/local_tmp/repos>
1091251881Speter         DAV svn
1092251881Speter         SVNPath c:/SVN/src-trunk/Release/subversion/tests/cmdline/
1093251881Speter                 svn-test-work/local_tmp/repos
1094251881Speter        </Location>
1095251881Speter
1096251881Speter      Then restart Apache and run the tests:
1097251881Speter
1098251881Speter      C:>python win-tests.py -c -r -v -u http://localhost
1099251881Speter      C:>cd ..
1100251881Speter
1101251881SpeterIII.  BUILDING A SUBVERSION SERVER
1102251881Speter      ============================
1103251881Speter
1104251881Speter      Subversion has two servers you can choose from:  svnserve and
1105251881Speter      Apache.  svnserve is a small, lightweight server program that is
1106251881Speter      automatically compiled when you build Subversion's source.  Apache
1107251881Speter      is a more heavyweight HTTP server, but tends to have more features.
1108251881Speter
1109251881Speter      This section primarily focuses on how to build Apache and the
1110251881Speter      accompanying mod_dav_svn server module for it.  If you plan to use
1111251881Speter      svnserve instead, jump right to section E for a quick explanation.
1112251881Speter
1113251881Speter
1114251881Speter  A.  Setting Up Apache
1115251881Speter      -----------------
1116251881Speter
1117251881Speter      1.  Obtaining and Installing Apache 2
1118251881Speter
1119251881Speter      Subversion tries to compile against the latest released version
1120299742Sdim      of Apache httpd 2.2+.  The easiest thing for you to do is download
1121251881Speter      a source tarball of the latest release and unpack that.
1122251881Speter
1123299742Sdim      If you have questions about the Apache httpd 2.2 build, please consult
1124251881Speter      the httpd install documentation:
1125251881Speter
1126299742Sdim          http://httpd.apache.org/docs-2.2/install.html
1127251881Speter
1128251881Speter      At the top of the httpd tree:
1129251881Speter
1130251881Speter          $ ./buildconf
1131251881Speter          $ ./configure --enable-dav --enable-so --enable-maintainer-mode
1132251881Speter
1133251881Speter      The first arg says to build mod_dav.
1134251881Speter
1135251881Speter      The second arg says to enable shared module support which is needed
1136251881Speter      for a typical compile of mod_dav_svn (see below).
1137251881Speter
1138251881Speter      The third arg says to include debugging information.  If you
1139251881Speter      built Subversion with --enable-maintainer-mode, then you should
1140251881Speter      do the same for Apache; there can be problems if one was
1141251881Speter      compiled with debugging and the other without.
1142251881Speter
1143251881Speter      Note: if you have multiple db versions installed on your system,
1144251881Speter      Apache might link to a different one than Subversion, causing
1145251881Speter      failures when accessing the repository through Apache.  To prevent
1146251881Speter      this from happening, you have to tell Apache which db version to
1147251881Speter      use and where to find db.  Add --with-dbm=db4 and
1148251881Speter      --with-berkeley-db=/usr/local/BerkeleyDB.4.2 to the configure
1149251881Speter      line.  Make sure this is the same db as the one Subversion uses.
1150251881Speter      This note assumes you have installed Berkeley DB 4.2.52
1151251881Speter      at its default locations.  For more info about the db requirement,
1152299742Sdim      see section I.C.7.
1153251881Speter
1154251881Speter      You may also want to include other modules in your build. Add
1155251881Speter      --enable-ssl to turn on SSL support, and --enable-deflate to turn on
1156251881Speter      compression support, for example.  Consult the Apache documentation
1157251881Speter      for more details.
1158251881Speter
1159251881Speter      All instructions below assume you configured Apache to install
1160251881Speter      in its default location, /usr/local/apache2/; substitute
1161251881Speter      appropriately if you chose some other location.
1162251881Speter
1163251881Speter      Compile and install apache:
1164251881Speter
1165251881Speter          $ make && make install
1166251881Speter
1167251881Speter
1168251881Speter  B.  Making and Installing the Subversion Apache Server Module
1169251881Speter      ---------------------------------------------------------
1170251881Speter
1171251881Speter      Go back into your subversion working copy and run ./autogen.sh if
1172299742Sdim      you need to.  Then, assuming Apache httpd 2.2 is installed in the
1173251881Speter      standard location, run:
1174251881Speter
1175251881Speter          $ ./configure
1176251881Speter
1177251881Speter      Note: do *not* configure subversion with "--disable-shared"!
1178251881Speter      mod_dav_svn *must* be built as a shared library, and it will
1179251881Speter      look for other libsvn_*.so libraries on your system.
1180251881Speter
1181251881Speter      If you see a warning message that the build of mod_dav_svn is
1182299742Sdim      being skipped, this may be because you have Apache httpd 2.x
1183251881Speter      installed in a non-standard location.  You can use the
1184251881Speter      "--with-apxs=" option to locate the apxs script:
1185251881Speter
1186251881Speter          $ ./configure --with-apxs=/usr/local/apache2/bin/apxs
1187251881Speter
1188251881Speter      Note: it *is* possible to build mod_dav_svn as a static library
1189251881Speter      and link it directly into Apache. Possible, but painful. Stick
1190251881Speter      with the shared library for now; if you can't, then ask.
1191251881Speter
1192251881Speter          $ rm /usr/local/lib/libsvn*
1193251881Speter
1194251881Speter      If you have old subversion libraries sitting on your system,
1195251881Speter      libtool will link them instead of the `fresh' ones in your tree.
1196251881Speter      Remove them before building subversion.
1197251881Speter
1198251881Speter          $ make clean && make && make install
1199251881Speter
1200251881Speter      After the make install, the Subversion shared libraries are in
1201251881Speter      /usr/local/lib/.  mod_dav_svn.so should be installed in
1202262253Speter      /usr/local/libexec/ (or elsewhere, such as /usr/local/apache2/modules/,
1203262253Speter      if you passed --with-apache-libexecdir to configure).
1204251881Speter
1205251881Speter
1206251881Speter      Section II.E explains how to build the server on Windows.
1207251881Speter
1208251881Speter
1209251881Speter  C.  Configuring Apache for Subversion
1210251881Speter      ---------------------------------
1211251881Speter
1212251881Speter      The following section is an abbreviated version of the
1213251881Speter      information in the Subversion Book
1214251881Speter      (http://svnbook.red-bean.com).  Please read chapter 6 for more
1215251881Speter      details.
1216251881Speter
1217251881Speter      The following assumes you have already created a repository.
1218251881Speter      For documentation on how to do that, see README.
1219251881Speter
1220251881Speter      The following also assumes that you have modified
1221251881Speter      /usr/local/apache2/conf/httpd.conf to reflect your setup.
1222251881Speter      At a minimum you should look at the User, Group and ServerName
1223251881Speter      directives.  Full details on setting up apache can be found at:
1224299742Sdim      http://httpd.apache.org/docs-2.2/
1225251881Speter
1226251881Speter      First, your httpd.conf needs to load the mod_dav_svn module.
1227262253Speter      If you pass --enable-mod-activation to Subversion's configure,
1228262253Speter      'make install' target should automatically add this line for you.
1229262253Speter      In any case, if Apache HTTPD gives you an error like "Unknown
1230251881Speter      DAV provider: svn", then you may want to verify that this line
1231251881Speter      exists in your httpd.conf:
1232251881Speter
1233251881Speter         LoadModule dav_svn_module     modules/mod_dav_svn.so
1234251881Speter
1235251881Speter      NOTE: if you built mod_dav as a dynamic module as well, make sure
1236251881Speter      the above line appears after the one that loads mod_dav.so.
1237251881Speter
1238251881Speter      Next, add this to the *bottom* of your httpd.conf:
1239251881Speter
1240251881Speter      <Location /svn/repos>
1241251881Speter          DAV svn
1242251881Speter          SVNPath /absolute/path/to/repository
1243251881Speter      </Location>
1244251881Speter
1245251881Speter      This will give anyone unrestricted access to the repository.  If
1246251881Speter      you want limited access, read or write, you add these lines to
1247251881Speter      the Location block:
1248251881Speter
1249251881Speter          AuthType Basic
1250251881Speter          AuthName "Subversion repository"
1251251881Speter          AuthUserFile /my/svn/user/passwd/file
1252251881Speter
1253251881Speter      And:
1254251881Speter
1255251881Speter          a) For a read/write restricted repository:
1256251881Speter
1257251881Speter             Require valid-user
1258251881Speter
1259251881Speter          b) For a write restricted repository:
1260251881Speter
1261251881Speter             <LimitExcept GET PROPFIND OPTIONS REPORT>
1262251881Speter                 Require valid-user
1263251881Speter             </LimitExcept>
1264251881Speter
1265251881Speter          c) For separate restricted read and write access:
1266251881Speter
1267251881Speter             AuthGroupFile /my/svn/group/file
1268251881Speter
1269251881Speter             <LimitExcept GET PROPFIND OPTIONS REPORT>
1270251881Speter                 Require group svn_committers
1271251881Speter             </LimitExcept>
1272251881Speter
1273251881Speter             <Limit GET PROPFIND OPTIONS REPORT>
1274251881Speter                 Require group svn_committers
1275251881Speter                 Require group svn_readers
1276251881Speter             </Limit>
1277251881Speter
1278299742Sdim      ### FIXME Tutorials section refers to old 2.0 docs
1279251881Speter      These are only a few simple examples.  For a complete tutorial
1280251881Speter      on Apache access control, please consider taking a look at the
1281251881Speter      tutorials found under "Security" on the following page:
1282251881Speter      http://httpd.apache.org/docs-2.0/misc/tutorials.html
1283251881Speter
1284251881Speter      In order for 'svn cp' to work (which is actually implemented as a
1285251881Speter      DAV COPY command), mod_dav needs to be able to determine the
1286251881Speter      hostname of the server.  A standard way of doing this is to use
1287251881Speter      Apache's ServerName directive to set the server's hostname.  Edit
1288251881Speter      your /usr/local/apache2/conf/httpd.conf to include:
1289251881Speter
1290251881Speter      ServerName svn.myserver.org
1291251881Speter
1292251881Speter      If you are using virtual hosting through Apache's NameVirtualHost
1293251881Speter      directive, you may need to use the ServerAlias directive to specify
1294251881Speter      additional names that your server is known by.
1295251881Speter
1296251881Speter      If you have configured mod_deflate to be in the server, you can enable
1297251881Speter      compression support for your repository by adding the following line
1298251881Speter      to your Location block:
1299251881Speter
1300251881Speter          SetOutputFilter DEFLATE
1301251881Speter
1302251881Speter
1303251881Speter      NOTE: If you are unfamiliar with an Apache directive, or not exactly
1304251881Speter      sure about what it does, don't hesitate to look it up in the
1305299742Sdim      documentation: http://httpd.apache.org/docs-2.2/mod/directives.html.
1306251881Speter
1307251881Speter      NOTE: Make sure that the user 'nobody' (or whatever UID the
1308251881Speter      httpd process runs as) has permission to read and write the
1309251881Speter      Berkeley DB files!  This is a very common problem.
1310251881Speter
1311251881Speter
1312251881Speter  D.  Running and Testing
1313251881Speter      -------------------
1314251881Speter
1315251881Speter      Fire up apache 2:
1316251881Speter
1317251881Speter          $ /usr/local/apache2/bin/apachectl stop
1318251881Speter          $ /usr/local/apache2/bin/apachectl start
1319251881Speter
1320251881Speter      Check /usr/local/apache2/logs/error_log to make sure it started
1321251881Speter      up okay.
1322251881Speter
1323251881Speter      Try doing a network checkout from the repository:
1324251881Speter
1325251881Speter          $ svn co http://localhost/svn/repos wc
1326251881Speter
1327251881Speter      The most common reason this might fail is permission problems
1328251881Speter      reading the repository db files.  If the checkout fails, make
1329251881Speter      sure that the httpd process has permission to read and write to
1330251881Speter      the repository.  You can see all of mod_dav_svn's complaints in
1331251881Speter      the Apache error logfile, /usr/local/apache2/logs/error_log.
1332251881Speter
1333251881Speter      To run the regression test suite for networked Subversion, see
1334251881Speter      the instructions in subversion/tests/cmdline/README.
1335251881Speter      For advice about tracing problems, see "Debugging the server" in
1336251881Speter      http://subversion.apache.org/docs/community-guide/.
1337251881Speter
1338251881Speter
1339251881Speter  E.  Alternative:  'svnserve' and ra_svn
1340251881Speter      -----------------------------------
1341251881Speter
1342251881Speter      An alternative network layer is libsvn_ra_svn (on the client
1343251881Speter      side) and the 'svnserve' process on the server.  This is a
1344251881Speter      simple network layer that speaks a custom protocol over plain
1345251881Speter      TCP (documented in libsvn_ra_svn/protocol):
1346251881Speter
1347251881Speter         $ svnserve -d     # becomes a background daemon
1348251881Speter         $ svn checkout svn://localhost/usr/local/svn/repository
1349251881Speter
1350251881Speter      You can use the "-r" option to svnserve to set a logical root
1351251881Speter      for repositories, and the "-R" option to restrict connections to
1352251881Speter      read-only access.  ("Read-only" is a logical term here; svnserve
1353251881Speter      still needs write access to the database in this mode, but will
1354251881Speter      not allow commits or revprop changes.)
1355251881Speter
1356251881Speter      'svnserve' has built-in CRAM-MD5 authentication (so you can use
1357251881Speter      non-system accounts), and can also be tunneled over SSH (so you
1358251881Speter      can use existing system accounts).  It's also capable of using
1359251881Speter      Cyrus SASL if libsasl2 is detected at ./configure time.  Please
1360251881Speter      read chapter 6 in the Subversion Book
1361251881Speter      (http://svnbook.red-bean.com) for details on these features.
1362251881Speter
1363251881Speter
1364251881Speter
1365251881SpeterIV.   PLATFORM-SPECIFIC ISSUES
1366251881Speter      ========================
1367251881Speter
1368251881Speter  A.  Windows XP
1369251881Speter      ----------
1370251881Speter
1371251881Speter      There is an error in the Windows XP TCP/IP stack which causes
1372251881Speter      corruption in certain cases.  This problem is exposed only
1373251881Speter      through ra_dav.
1374251881Speter
1375251881Speter      The root of the matter is caused by duplicating file handles
1376251881Speter      between parent and child processes.  The httpd Apache group
1377251881Speter      explains this a lot better:
1378251881Speter
1379251881Speter          http://www.apache.org/dist/httpd/binaries/win32/#xpbug
1380251881Speter
1381251881Speter      And there's an item about this in the Subversion FAQ:
1382251881Speter
1383251881Speter          http://subversion.apache.org/faq.html#windows-xp-server
1384251881Speter
1385251881Speter      The only known workaround for now is to update to Windows XP
1386251881Speter      SP1 (or higher).
1387251881Speter
1388251881Speter
1389251881Speter  B.  Mac OS X
1390251881Speter      --------
1391251881Speter
1392251881Speter      [TBD: Describe BDB 4.0.x problem]
1393251881Speter
1394251881Speter
1395251881Speter
1396251881SpeterV.    PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA)
1397251881Speter      ========================================================
1398251881Speter
1399251881Speter      For Python, Perl and Ruby bindings, see the file
1400251881Speter
1401251881Speter          ./subversion/bindings/swig/INSTALL
1402251881Speter
1403251881Speter      For Java bindings, see the file
1404251881Speter
1405251881Speter          ./subversion/bindings/javahl/README
1406