1 ======================================
4 ======================================
6 $LastChangedDate: 2015-12-12 04:00:43 +0000 (Sat, 12 Dec 2015) $
13 B. Dependency Overview
14 C. Dependencies in Detail
18 A. Building from a Tarball
19 B. Building the Latest Source under Unix
20 C. Building under Unix in Different Directories
21 D. Installing from a Zip or Installer File under Windows
22 E. Building the Latest Source under Windows
24 III. BUILDING A SUBVERSION SERVER
26 B. Making and Installing the Subversion Server
27 C. Configuring Apache for Subversion
28 D. Running and Testing
29 E. Alternative: 'svnserve' and ra_svn
31 IV. PLATFORM-SPECIFIC ISSUES
35 V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA)
44 This document is written for people who intend to build
45 Subversion from source code. Normally, the only people who do
46 this are Subversion developers and package maintainers.
48 If neither of these labels fits you, we recommend you find an
49 appropriate binary package of Subversion and install that.
50 While the Subversion project doesn't officially release binary
51 packages, a number of volunteers have made such packages
52 available for different operating systems. Most Linux and BSD
53 distributions already have Subversion packages ready to go via
54 standard packaging channels, and other volunteers have built
55 'installers' for both Windows and OS X. Visit this page for
58 http://subversion.apache.org/packages.html
60 For those of you who still wish to build from source, Subversion
61 follows the Unix convention of "./configure && make", but it has
62 a number of dependencies.
65 B. Dependency Overview
67 You'll need the following build tools to compile Subversion:
69 * autoconf 2.59 or later (Unix only)
70 * libtool 1.4 or later (Unix only)
71 * a reasonable C compiler (gcc, Visual Studio, etc.)
74 Subversion also depends on the following third-party libraries:
76 * libapr and libapr-util (REQUIRED for client and server)
78 The Apache Portable Runtime (APR) library provides an
79 abstraction of operating-system level services such as file
80 and network I/O, memory management, and so on. It also
81 provides convenience routines for things like hashtables,
82 checksums, and argument processing. While it was originally
83 developed for the Apache HTTP server, APR is a standalone
84 library used by Subversion and other products. It is a
85 critical dependency for all of Subversion; it's the layer
86 that allows Subversion clients and servers to run on
87 different operating systems.
89 * SQLite (REQUIRED for client and server)
91 Subversion uses SQLite to manage some internal databases.
93 * libz (REQUIRED for client and server)
95 Subversion uses zlib for compressing binary differences.
96 These diff streams are used everywhere -- over the network,
97 in the repository, and in the client's working copy.
99 * libserf (OPTIONAL for client)
101 The Serf library allows the Subversion client to send HTTP
102 requests. This is necessary if you want your client to access
103 a repository served by the Apache HTTP server. There is an
104 alternate 'svnserve' server as well, though, and clients
105 automatically know how to speak the svnserve protocol.
106 Thus it's not strictly necessary for your client to be able
107 to speak HTTP... though we still recommend that your client
108 be built to speak both HTTP and svnserve protocols.
110 * OpenSSL (OPTIONAL for client and server)
112 OpenSSL enables your client to access SSL-encrypted https://
113 URLs (using libserf) in addition to unencrypted http:// URLs.
114 To use SSL with Subversion's WebDAV server, Apache needs to be
115 compiled with OpenSSL as well.
117 * Berkeley DB (OPTIONAL for client and server)
119 There are two different repository 'back-end'
120 implementations. One implementation stores data in a flat
121 filesystem (known as FSFS); the other implementation stores
122 data in a Berkeley DB database (known as BDB). When you
123 create a repository, you have the option of specifying a
124 storage back-end. The Berkeley DB back-end will only be
125 available if the BDB libraries are discovered at compile
126 time. The Berkeley DB back-end has been deprecated and
129 * libsasl (OPTIONAL for client and server)
131 If the Cyrus SASL library is detected at compile time, then
132 the svn client (and svnserve server) will be able to utilize
133 SASL to do various forms of authentication when speaking the
136 * Python, Perl, Java, Ruby (OPTIONAL)
138 Subversion is mostly a collection of C libraries with
139 well-defined APIs, with a small collection of programs that
140 use the APIs. If you want to build Subversion API bindings
141 for other languages, you need to have those languages
142 available at build time.
144 * KDELibs, GNOME Keyring (OPTIONAL for client)
146 Subversion contains optional support for storing passwords in
147 KWallet (KDE 4) or GNOME Keyring.
149 * libmagic (OPTIONAL)
151 If the libmagic library is detected at compile time,
152 it will be used to determine mime-types of binary files
153 which are added to version control. Note that mime-types
154 configured via auto-props or the mime-types-file option
157 * Googlemock aka Gmock (OPTIONAL)
159 This optional package is used by the tests for Subversions'
163 C. Dependencies in Detail
165 Subversion depends on a number of third party tools and libraries.
166 Some of them are only required to run a Subversion server; others
167 are necessary just for a Subversion client. This section explains
168 what other tools and libraries will be required so that Subversion
169 can be built with the set of features you want.
171 On Unix systems, the './configure' script will tell you if you are
172 missing the correct version of any of the required libraries or
173 tools, so if you are in a real hurry to get building, you can skip
174 straight to section II. If you want to gather the pieces you will
175 need before starting out, however, you should read the following.
177 If you're just installing a Subversion client, the Subversion
178 team has created a script that downloads the minimal prerequisite
179 libraries (Apache Portable Runtime, Sqlite, and Zlib). The script,
180 'get-deps.sh', is available in the same directory as this file.
181 When run, it will place 'apr', 'apr-util', 'serf', 'zlib', and
182 'sqlite-amalgamation' directories directly into your unpacked Subversion
183 distribution. With the exception of sqlite-amalgamation, they will
184 still need to be configured, built and installed explicitly, and
185 Subversion's own configure script may need to be told where to find
186 them, if they were not installed in standard system locations.
188 Note: there are optional dependencies (such as openssl, swig, and httpd)
189 which get-deps.sh does not download.
191 Note: Because previous builds of Subversion may have installed older
192 versions of these libraries, you may want to run some of the cleanup
193 commands described in section II.B before installing the following.
196 1. Apache Portable Runtime 1.3 or newer (REQUIRED)
198 Whenever you want to build any part of Subversion, you need the
199 Apache Portable Runtime (APR) and the APR Utility (APR-util)
202 If you do not have a pre-installed APR and APR-util, you will need
203 to get these yourself:
205 http://apr.apache.org/download.cgi
207 On Unix systems, if you already have the APR libraries compiled and do
208 not wish to regenerate them from source code, then Subversion needs to
209 be able to find them.
211 There are a couple of options to "./configure" that tell it where
212 to look for the APR and APR-util libraries. By default it will try
213 to locate the libraries using apr-config and apu-config scripts.
214 These scripts provide all the relevant information for the APR and
215 APR-util installations.
217 If you want to specify the location of the APR library, you can use
218 the "--with-apr=" option of "./configure". It should be able to find
219 the apr-config script in the standard location under that directory
220 (e.g. ${prefix}/bin).
222 Similarly, you can specify the location of APR-util using the
223 "--with-apr-util=" option to "./configure". It will look for the
224 apu-config script relative to that directory.
226 For example, if you want to use the APR libraries you built
227 with the Apache httpd server, you could run:
229 $ ./configure --with-apr=/usr/local/apache2 \
230 --with-apr-util=/usr/local/apache2 ...
232 Be sure to use a native Windows SVN client (as opposed to
233 Cygwin's version) so that the .dsp files get carriage-returns at
234 the ends of their lines. Otherwise Visual Studio will complain
235 that it doesn't recognize the .dsp files.
237 If you use APR libraries checked out from svn in an Unix
238 environment, you need to run the 'buildconf' script in each
239 library's directory, to regenerate the configure scripts and
240 other files required for compiling the libraries:
242 $ cd apr; ./buildconf; ./configure ...; make; make install; cd ..
244 $ cd apr-util; ./buildconf; ./configure ...; make; make install; cd ..
246 Configure build and install both libraries before running Subversion's
252 Subversion's binary-differencing engine depends on zlib for
253 compression. Most Unix systems have libz pre-installed, but
254 if you need it, you can get it from
259 3. autoconf 2.59 or newer (Unix only)
261 This is required only if you plan to build from the latest source
262 (see section II.B). Generally only developers would be doing this.
265 4. libtool 1.4 or newer (Unix only)
267 This is required only if you plan to build from the latest source
270 Note: Some systems (Solaris, for example) require libtool 1.4.3 or
271 newer. The autogen.sh script knows about that.
274 5. Serf library 1.3.4 or newer (OPTIONAL)
276 If you want your client to be able to speak to an Apache
277 server (via a http:// or https:// URL), you must link against
278 serf. Though optional, we strongly recommend this.
280 In order to use ra_serf, you must install serf, and run Subversion's
281 ./configure with the argument --with-serf. If serf is installed in a
282 non-standard place, you should use
284 --with-serf=/path/to/serf/install
288 Serf can be obtained via your system's package distribution
289 system or directly from http://code.google.com/p/serf/.
291 For more information on serf and Subversion's ra_serf, see the file
292 subversion/libsvn_ra_serf/README.
294 6. OpenSSL (OPTIONAL)
296 ### needs some updates. I think serf automagically handles
297 ### finding OpenSSL, but we may need more docco here. and w.r.t
300 The Serf library has support for SSL encryption by relying on the
303 a. Using OpenSSL on the client through Serf
305 On Unix systems, to build Serf with OpenSSL, you need OpenSSL
306 installed on your system, and you must add "--with-ssl" as a
307 "./configure" parameter. If your OpenSSL installation is hard
308 for Serf to find, you may need to use "--with-libs=/path/to/lib"
309 in addition. In particular, on Red Hat (but not Fedora Core) it
310 is necessary to specify "--with-libs=/usr/kerberos" for OpenSSL
311 to be found. You can also specify a path to the zlib library
314 Under Windows, you can specify the paths to these libraries by
315 passing the options --with-zlib and --with-openssl to gen-make.py.
317 b. Using OpenSSL on the Apache server
319 You can also add support for these features to an Apache httpd
320 server to be used for Subversion using the same support libraries.
321 The Subversion build system will not provide them, however. You
322 add them by specifying parameters to the "./configure" script of
323 the Apache Server instead.
325 For getting SSL on your server, you would add the "--enable-ssl"
326 or "--with-ssl=/path/to/lib" option to Apache's "./configure"
327 script. Apache enables zlib support by default, but you can
328 specify a nonstandard location for the library with the
329 "--with-z=/path/to/dir" option. Consult the Apache documentation
330 for more details, and for other modules you may wish to install
331 to enhance your Subversion server.
333 If you don't already have it, you can get a copy of OpenSSL,
334 including instructions for building and packaging on both Unix
335 systems and Windows, at:
337 http://www.openssl.org/
340 7. Berkeley DB 4.X (OPTIONAL)
342 Berkeley DB is needed to build a Subversion server that supports
343 the BDB repository filesystem, or to access a BDB repository on
344 local disk. If you will only use the FSFS repository filesystem,
345 or if you are building a Subversion client that will only speak
346 to remote (networked) repositories, you don't need it.
348 The current recommended version is 4.4.20 or newer, which brings
349 auto-recovery functionality to the Berkeley DB database
352 If you must use an older version of Berkeley DB, we *strongly*
353 recommend using 4.3 or 4.2 over the 4.1 or 4.0 versions. Not
354 only are these significantly faster and more stable, but they
355 also enable Subversion repositories to automatically clean up
356 database journal files to save disk space.
358 You'll need Berkeley DB installed on your system. You can
361 http://www.oracle.com/technology/software/products/berkeley-db/index.html
363 If you have Berkeley DB installed in a place not searched by default
364 for includes and libraries, add something like this:
366 --with-berkeley-db=db.h:/usr/local/include/db4.7:/usr/local/lib/db4.7:db-4.7
368 to your `configure' switches, and the build process will use the
369 Berkeley DB header and library in the named directories. You may
370 need to use a different path, of course. Note that in order for
371 the detection to succeed, the dynamic linker must be able to find
372 the libraries at configure time.
374 If you are on the Windows platform and want to build Subversion,
375 a precompiled version of the Berkeley DB library is available for
376 download at the Subversion web site "Documents & files" area:
378 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688
380 Look in the "Releases > Windows > Windows BDB" section.
383 8. Cyrus SASL library (OPTIONAL)
385 If the Simple Authentication and Security Layer (SASL) library
386 is detected on your system, then the Subversion client and
387 svnserve server can utilize its abilities for various forms of
388 authentication. To learn more about SASL or to get the source
391 http://freshmeat.net/projects/cyrussasl/
394 9. Apache Web Server 2.2.X or newer (OPTIONAL)
396 (http://httpd.apache.org/download.cgi)
398 The Apache httpd server is one of two methods to make your Subversion
399 repository available over a network - the other is a custom server
400 program called svnserve, which requires no extra software packages.
401 Building Subversion, the Apache server, and the modules that Apache
402 needs to communicate with Subversion are complicated enough that there
403 is a whole section at the end of this document that describes how it
404 is done: See section III for details.
407 10. Python 2.7 or newer (http://www.python.org/) (OPTIONAL)
409 If you want to run "make check" or build from the latest source
410 under Unix/Windows as described in section II.B, II.E and III.D,
411 install Python 2.7 or higher on your system. The majority of the
412 test suite is written in Python, as is part of Subversion's build
415 Note that Python 3.x is not supported and most likely won't work.
418 11. Perl 5.8 or newer (Windows only) (OPTIONAL)
420 To build Subversion under any of the MS Windows platforms, you
421 will also need Perl 5.8 or newer to run apr-util's w32locatedb.pl
425 12. SQLite (REQUIRED)
427 Subversion requires SQLite version 3.7.12 or above. You can meet this
428 dependency several ways:
429 * Use an SQLite amalgamation file.
430 * Specify an SQLite installation to use.
431 * Let Subversion find an installed SQLite.
433 To use an SQLite-provided amalgamation, just drop sqlite3.c into
434 Subversion's sqlite-amalgamation/ directory, or point to it with the
435 --with-sqlite configure option. This file also ships with the Subversion
436 dependencies distribution, or you can download it from SQLite:
438 http://www.sqlite.org/download.html
441 13. pkg-config (Unix only, OPTIONAL)
443 Subversion uses pkg-config to find appropriate options used
447 14. D-Bus (Unix only, OPTIONAL)
449 D-Bus is a message bus system. D-Bus is required for support for KWallet
450 and GNOME Keyring. pkg-config is needed to find D-Bus headers and library.
453 15. Qt 4 (Unix only, OPTIONAL)
455 Qt is a cross-platform application framework. QtCore, QtDBus and QtGui
456 modules are required for support for KWallet. pkg-config is needed
457 to find Qt headers and libraries.
460 16. KDELibs 4 (Unix only, OPTIONAL)
462 Subversion contains optional support for storing passwords in KWallet.
463 KDELibs contains core KDE libraries. Subversion uses libkdecore and libkdeui
464 libraries when support for KWallet is enabled. kde4-config is used to get
465 some necessary options. pkg-config, D-Bus and Qt 4 are also required.
466 If you want to build support for KWallet, then pass the '--with-kwallet'
467 option to `configure`. If KDE is installed in a non-standard prefix, then
470 --with-kwallet=/path/to/KDE/prefix
472 17. GLib 2 (Unix only, OPTIONAL)
474 GLib is a general-purpose utility library. GLib is required for support
475 for GNOME Keyring. pkg-config is needed to find GLib headers and library.
478 18. GNOME Keyring (Unix only, OPTIONAL)
480 Subversion contains optional support for storing passwords in GNOME Keyring.
481 pkg-config is needed to find GNOME Keyring headers and library. D-Bus and
482 GLib are also required. If you want to build support for GNOME Keyring,
483 then pass the '--with-gnome-keyring' option to `configure`.
486 19. Ctypesgen (OPTIONAL)
488 Ctypesgen is Python wrapper generator for ctypes. It is used to generate
489 a part of Subversion Ctypes Python bindings (CSVN). If you want to build
490 CSVN, then pass the '--with-ctypesgen' option to `configure`. If ctypesgen.py
491 is installed in a non-standard place, then use:
493 --with-ctypesgen=/path/to/ctypesgen.py
495 For more information on CSVN, see subversion/bindings/ctypes-python/README.
497 20. libmagic (OPTIONAL)
499 Subversion's configure script attempts to find libmagic automatically.
500 If it is installed in a non-standard location, then use:
502 --with-libmagic=/path/to/libmagic/prefix
504 The files include/magic.h and lib/libmagic.so.1.0 (or similar)
505 are expected beneath this prefix directory. If they cannot be
506 found Subversion will be compiled without support for libmagic.
508 If libmagic is installed but support for it should not be compiled
513 If configure should fail when libmagic is not present, but only
514 the default locations should be searched, then use:
518 21. Googlemock (OPTIONAL)
520 Googlemock can be installed and built in-tree by invoking
526 The primary documentation for Subversion is the free book
527 "Version Control with Subversion", a.k.a. "The Subversion Book",
528 obtainable from http://svnbook.red-bean.com/.
530 Various additional documentation exists in the doc/ subdirectory of
531 the Subversion source. See the file doc/README for more information.
538 A. Building from a Tarball
539 ------------------------------
541 1. Building from a Tarball
543 Download the most recent distribution tarball from:
545 http://subversion.apache.org/download/
547 Unpack it, and use the standard GNU procedure to compile:
553 You can also run the full test suite by running 'make check'. Even
554 in successful runs, some tests will report XFAIL; that is normal.
555 Failed runs are indicated by FAIL or XPASS results, or a non-zero exit
556 code from "make check".
559 B. Building the Latest Source under Unix
560 -------------------------------------
562 These instructions assume you have already installed Subversion
563 and checked out a working copy of Subversion's own code --
564 either the latest /trunk code, or some branch or tag. You also
565 need to have already installed whatever prerequisites that
566 version of Subversion requires (if you haven't, the ./configure
567 step should complain).
569 You can discard the directory created by the tarball; you're
570 about to build the latest, greatest Subversion client. This is
571 the procedure Subversion developers use.
573 First off, if you have any Subversion libraries lying around
574 from previous 'make installs', clean them up first!
576 # rm -f /usr/local/lib/libsvn*
577 # rm -f /usr/local/lib/libapr*
578 # rm -f /usr/local/lib/libserf*
580 Start the process by running "autogen.sh":
584 This script will make sure you have all the necessary components
585 available to build Subversion. If any are missing, you will be
586 told where to get them from. (See the 'Dependency Overview' in
589 Note: if the command "autoconf" on your machine does not run
590 autoconf 2.59 or later, but you do have a new enough autoconf
591 available, then you can specify the correct one with the
592 AUTOCONF variable. (The AUTOHEADER variable is similar.) This
593 may be required on Debian GNU/Linux, where "autoconf" is
594 actually a Perl script that attempts to guess which version is
595 required -- because of the interaction between Subversion's and
596 APR's configuration systems, the Perl script may get it wrong.
597 So for example, you might need to do:
599 $ AUTOCONF=autoconf2.59 sh ./autogen.sh
601 Once you've prepared the working copy by running autogen.sh,
602 just follow the usual configuration and build procedure:
608 (Optionally, you might want to pass --enable-maintainer-mode to
609 the ./configure script. This enables debugging symbols in your
610 binaries (among other things) and most Subversion developers use it.)
612 Since the resulting binary depends on shared libraries, the
613 destination library directory must be identified in your
614 operating system's library search path. That is in either
615 /etc/ld.so.conf or $LD_LIBRARY_PATH for Linux systems and in
616 /etc/rc.conf for FreeBSD, followed by a run of the 'ldconfig'
617 program. Check your system documentation for details. By
618 identifying the destination directory, Subversion will be able
619 to dynamically load repository access plugins. If you try to do
620 a checkout and see an error like:
622 subversion/libsvn_ra/ra_loader.c:209: (apr_err=170000)
623 svn: Unrecognized URL scheme 'https://svn.apache.org/repos/asf/subversion/trunk'
625 It probably means that the dynamic loader/linker can't find all
626 of the libsvn_* libraries.
629 C. Building under Unix in Different Directories
630 --------------------------------------------
632 It is possible to configure and build Subversion on Unix in a
633 directory other than the working copy. For example
635 $ svn co https://svn.apache.org/repos/asf/subversion/trunk svn
637 $ # get SQLite amalgamation if required
638 $ chmod +x autogen.sh
642 $ ../svn/configure [...with options as appropriate...]
645 puts the Subversion working copy in the directory svn and builds
646 it in a separate, parallel directory obj.
648 Why would you want to do this? Well there are a number of
651 * You may prefer to avoid "polluting" the working copy with
652 files generated during the build.
654 * You may want to put the build directory and the working
655 copy on different physical disks to improve performance.
657 * You may want to separate source and object code and only
660 * You may want to remote mount the working copy on multiple
661 machines, and build for different machines from the same
664 * You may want to build multiple configurations from the
667 The last reason above is possibly the most useful. For instance
668 you can have separate debug and optimized builds each using the
669 same working copy. Or you may want a client-only build and a
670 client-server build. Using multiple build directories you can
671 rebuild any or all configurations after an edit without the need
672 to either clean and reconfigure, or identify and copy changes
673 into another working copy.
676 D. Installing from a Zip or Installer File under Windows
677 --------------------------------------------------------
679 Of all the ways of getting a Subversion client, this is the
680 easiest. Download a Zip (*.zip) or self-extracting installer
681 (*-setup.exe) file from:
683 http://subversion.apache.org/packages#windows
685 For a Zip file, run your unzipping utility (WinZIP, ZipGenius,
686 UltimateZIP, FreeZIP, whatever) and extract the DLLs and EXEs to
687 a directory of your choice. Included in the download is the SVN
688 client, the SVNADMIN administration tool, and the SVNLOOK
691 Note that if you need support for non-English locales you'll have
692 to set the APR_ICONV_PATH environment variable to the path of the
693 iconv directory in the folder that contains the Subversion install.
695 You may also want to add the bin directory in the Subversion folder
696 to your PATH environment variable so as to not have to use the full
697 path when running Subversion commands.
699 To test the installation, open a DOS box (run either "cmd" or
700 "command" from the Start menu's "Run..." menu option), change to
701 the directory you installed the executables into, and run:
703 C:\test>svn co https://svn.apache.org/repos/asf/subversion/trunk svn
705 This will get the latest Subversion sources and put them into the
708 If using a self-extracting .exe file, just run it instead of
709 unzipping it, to install Subversion.
711 E. Building the Latest Source under Windows
712 ----------------------------------------
716 * Visual Studio 6 and service pack. It can be built with later versions
717 of Visual Studio (Visual Studio.NET 2005-2015, Visual C++ Express
718 2005-2010, Visual Studio Express 2012-2013 and Visual Studio Community
719 2013-2015) but these instructions assume VS6.
720 * A recent Windows SDK. (Not needed with Visual Studio 2005 and later)
721 If you are using Visual Studio 6, you need the latest SDK which
722 is compatible with VC6, which is the one from February 2003.
723 You can get it from MSDN:
724 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
725 * Python 2.7 or higher, downloaded from http://www.python.org/ which is
726 used to generate the project files.
727 Note that Python 3.x is not supported (yet).
728 * Perl 5.8 or higher from http://www.activestate.com/
729 * Awk (from http://www.cs.princeton.edu/~bwk/btl.mirror/awk95.exe) is
730 needed to compile Apache or APR. Note that this is the actual awk
731 program, not an installer - just rename it to awk.exe and it is
733 * Apache apr, apr-util, and optionally apr-iconv libraries, version
734 1.3 or later. Included in both the Subversion dependencies ZIP file
735 and the Apache 2 source zip. If you are building from a Subversion
736 checkout and have not downloaded Apache 2, then get these 3 libraries
737 from http://www.apache.org/dist/apr/.
738 * SQLite 3.7.12 or higher from http://www.sqlite.org/download.html
739 * ZLib 1.2 or higher is required and is included in the Subversion
740 dependencies zip file or can be obtained from http://www.zlib.net/
741 * Either a Subversion client binary from http://subversion.apache.org/ to
742 do the initial checkout of the Subversion source or the zip file
743 source distribution. See the section "Bootstrapping from a Zip or
744 Installer File under Windows" above for more.
745 * A means of unpacking the files, e.g., WinZIP or similar.
749 * [Optional] Apache 2 source, downloaded from
750 http://httpd.apache.org/download.cgi, these instructions assume
751 version 2.0.58. This is only needed for building the Subversion
752 server Apache modules. ### FIXME Apache 2.2 or greater required.
753 * [Optional] Apache 2 msi install file, also from
754 http://httpd.apache.org/download.cgi (required for running the
755 tests). Only needed for testing the server dso modules and if
756 you are using Visual Studio 6.
757 Note that if you are not using Visual Studio 6 (and you want to
758 run and test the server modules) then you must rebuild Apache
759 from source -- do not use the stock MSI since mixing C runtime
760 libraries is not supported.
761 * [Optional] Berkeley DB for backend support of the server
762 components -- versions 4.3.27 and 4.4.20 are available from
763 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688
764 as db-4.3.27-win32.zip and db-4.4.20-win32.zip.
765 For more information see Section I.C.7.
766 * [Optional] Openssl 0.9.7f or higher can be obtained from
767 http://www.openssl.org/source/openssl-0.9.7f.tar.gz
768 * [Optional] A modified version of GNU libintl, called
769 svn-win32-libintl.zip, can be used for displaying localized
770 messages. Available at:
771 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=2627
772 * [Optional] GNU gettext for generating message catalog (.mo)
773 files from message translations. You can get the latest
774 binaries from http://gnuwin32.sourceforge.net/. You'll need the
775 binaries (gettext-0.14.1-bin.zip) and dependencies
776 (gettext-0.14.1-dep.zip).
777 * [Optional] An assembler, e.g., MASM32 from http://www.masm32.com/
778 or nasm which is available from
779 http://www.nasm.us/pub/nasm/releasebuilds/?C=M;O=D
783 The Serf library supports secure connections with OpenSSL and
784 on-the-wire compression with zlib. If you want to use the
785 secure connections feature, you should pass the option
786 "--with-openssl" to the gen-make.py script. See Section I.C.6 for
791 This section describes how to unpack the files to make a build tree.
793 * Make a directory SVN and cd into it.
794 * Either checkout Subversion:
796 svn co https://svn.apache.org/repos/asf/subversion/trunk src-trunk
798 or unpack the zip file distribution and rename the directory to
801 * Install Visual Studio Environment. You either have to tell the
802 installer to register environment variables or run VCVARS32.BAT
803 before building anything. If you are using a newer Visual Studio,
804 use the 'Visual Studio 20xx Command Prompt' on the Start menu.
805 * Install and register a recent Windows Core SDK if you are using
806 Visual Studio 6. This is a quote from the Microsoft February 2003
809 "To register the SDK bin, include, and library directories with
810 Microsoft Visual Studio® version 6.0 and Visual Studio .NET,
811 click Start, point to All Programs, point to Microsoft Platform
812 SDK February 2003, point to Visual Studio Registration, and then
813 click Register PSDK Directories with Visual Studio. This
814 registration process places the SDK bin, include, and library
815 directories at the beginning of the search paths, which ensures
816 that the latest headers and libraries are used when building
817 applications in the IDE. Note that for Visual Studio 6.0
818 integration to succeed, Visual Studio 6.0 must run at least once
819 before you select Register PSDK Directories with Visual
820 Studio. Also note that when this option is run, the IDEs should
823 * Install Python and add it to your path
824 * Install Perl (it should add itself to the path)
825 * Copy AWK (awk95.exe) to awk.exe (e.g. SVN\awk\awk.exe) and add
826 the directory containing it (e.g. SVN\awk) to the path.
827 * [Optional] Install Apache 2 using the msi file if you are going to test
828 the server dso modules and are using Visual Studio 6. You must build
829 and install it from source if you are not using Visual Studio 6 and
830 want to build and/or test the server modules.
831 * [Optional] If you checked out Subversion from the repository and want
832 to build Subversion with http/https access support then install the
833 serf sources into SVN\src-trunk\serf.
834 * [Optional] If you want BDB backend support, extract the Berkeley DB
835 files into SVN\src-trunk\db4-win32. It's a good idea to add
836 SVN\src-trunk\db4-win32\bin to your PATH, so that Subversion can find
837 the Berkeley DB DLLs.
839 [NOTE: This binary package of Berkeley DB is provided for
840 convenience only. Please don't address questions about
841 Berkeley DB that aren't directly related to using Subversion
842 to the project mailing list.]
844 If you build Berkeley DB from the source, you will have to copy
845 the file db-x.x.x\build_win32\db.h to
846 SVN\src-trunk\db4-win32\include, and all the import libraries to
847 SVN\src-trunk\db4-win32\lib. Again, the DLLs should be somewhere in
850 * [Optional] If you want to build the server modules, extract Apache
851 source into SVN\httpd-2.x.x.
852 * If you are building from a checkout of Subversion, and you are NOT
853 building Apache, then you will need the APR libraries. Depending
854 on how you got your version of APR, either:
855 - Extract the APR, APR-util and APR-iconv source distributions into
856 SVN\apr, SVN\apr-util, and SVN\apr-iconv respectively.
858 - Extract the apr, apr-util and apr-iconv directories from the
859 srclib folder in the Apache httpd source into SVN\apr,
860 SVN\apr-util, and SVN\apr-iconv respectively.
861 * Extract the ZLib sources into SVN\zlib if you are not using the zlib
862 included in the dependencies zip file.
863 * [Optional] If you want secure connection (https) client support, or if
864 you are building with enabled support for serf extract openssl into
866 * [Optional] If you want localized message support, extract
867 svn-win32-libintl.zip into SVN\svn-win32-libintl and extract
868 gettext-x.x.x-bin.zip and gettext-x.x.x-dep.zip into
869 SVN\gettext-x.x.x-bin.
870 Add SVN\gettext-x.x.x-bin\bin to your path.
871 * [Optional] Extract MASM32 (only the ML.EXE and ML.ERR files) into
872 SVN\asm (or extract nasm into SVN\asm) and put it in your path.
873 * Download the SQLite amalgemation from
874 http://www.sqlite.org/download.html
875 and extract it into SVN\sqlite-amalgemation.
876 See I.C.12 for alternatives to using the amalgemation package.
878 E.4 Building the Binaries
880 To build the binaries either follow the instructions here or use
881 build\win32\vc6-build.bat.in after editing its default paths to match
882 yours and saving it as vc6-build.bat. The vc6-build.bat does a full build
883 using all options so it requires Apache 2 source and the other optional
886 Start in the SVN directory you created.
888 Set up the environment (commands should be one line even if wrapped here).
892 C:>set BUILD_ROOT=C:\SVN
893 C:>set PYTHONDIR=C:\Python22
894 C:>set AWKDIR=C:\SVN\Awk
895 C:>set ASMDIR=C:\SVN\asm
896 C:>set SDKINC="C:\Program Files\Microsoft SDK\include"
897 C:>set SDKLIB="C:\Program Files\Microsoft SDK\lib"
898 C:>set GETTEXTBIN=C:\SVN\gettext-0.14.1-bin\bin
899 C:>PATH=%PATH%;%BUILD_ROOT%\src-%DIR%\db4-win32;%ASMDIR%;
900 %PYTHONDIR%;%AWKDIR%;%GETTEXTBIN%
901 C:>set INCLUDE=%SDKINC%;%INCLUDE%
902 C:>set LIB=%SDKLIB%;%LIB%
907 C:>perl Configure VC-WIN32
908 [*] C:>call ms\do_masm
909 C:>nmake -f ms\ntdll.mak
914 *Note: Use "call ms\do_nasm" if you have nasm instead of MASM, or
915 "call ms\do_ms" if you don't have an assembler.
919 This step is only required for building the server dso modules.
921 C:>set APACHEDIR=C:\Program Files\Apache Group\Apache2
922 C:>msdev httpd-2.0.58\apache.dsw /MAKE "BuildBin - Win32 Release"
926 If you downloaded APR / APR-UTIL / APR_ICONV by source, you will have to
927 build these libraries first.
928 Building these libraries on Windows is straight forward and in most cases
929 as simple as issuing these two commands:
931 C:>nmake -f Makefile.win
932 C:>nmake -f Makefile.win install
934 Please refere to the build instructions provided by the library source
935 for actual build instructions.
939 If you downloaded the zlib source, you will have to build ZLib first.
940 Building ZLib using Visual Studio should be quite simple. Just open the
941 appropriate solution and build the project zlibstat using the IDE.
943 Please refere to the build instructions provided by the library source
944 for actual build instructions.
946 Note that you'd make sure to define ZLIB_WINAPI in the ZLib config
947 header and move the lib-file into the zlib root-directory.
951 ### Section about serf might be required/useful to add.
952 ### scons is required too and serf needs to be configured prior to be
953 ### able to build Subversion using:
954 ### scons APR=[PATH_TO_APR] APU=[PATH_TO_APU] OPENSSL=[PATH_TO_OPENSSL]
955 ### ZLIB=[PATH_TO_ZLIB] PREFIX=[PATH_TO_SERF_DEST]
963 * If you don't want to build mod_dav_svn, omit the --with-httpd
964 option. The zip file source distribution contains apr, apr-util and
965 apr-iconv in the default build location. If you have downloaded the
966 apr files yourself you will have to tell the generator where to find
967 the APR libraries; the options are --with-apr, --with-apr-util and
969 * If you would like a debug build substitute Debug for Release in
970 the msdev/msbuild commands.
971 * There have been rumors that Subversion on Win32 can be built
972 using the latest cygwin, you probably don't want the zip file source
973 distribution though. ymmv.
974 * The /USEENV switch to msdev makes it take notice of the INCLUDE and
975 LIB environment variables, it also makes it ignore its own lib and
976 include settings so you need to have the Windows SDK lib and include
977 directories in the LIB and INCLUDE environment variables. Do *not*
978 use this switch when starting up the msdev Visual environment. If you
979 wish to build in the Visual environment the SDK lib and include
980 directories must be in the Tools/Options/Directories settings (if you
981 followed the 'Register the SDK with Visual Studio 6' instructions
982 above this has been done for you).
983 * If you are using Visual Studio later than VC6 change -t dsw into
984 -t vcproj and add the --vsnet-version=20xx option on the gen-make.py
986 In this case you will also have to distribute the C runtime dll with
987 the binaries. Also, since Apache/APR do not provide .vcproj files,
988 you will need to convert the Apache/APR .dsp files to .vcproj files
989 with Visual Studio before building -- just open the Apache .dsw file
990 and answer 'Yes To All' when the conversion dialog pops up, or you
991 can open the individual .dsp files and convert them one at a time.
992 The Apache/APR projects required by Subversion are:
993 apr-util\libaprutil.dsp, apr\libapr.dsp,
994 apr-iconv\libapriconv.dsp, apr-util\xml\expat\lib\xml.dsp,
995 apr-iconv\ccs\libapriconv_ccs_modules.dsp, and
996 apr-iconv\ces\libapriconv_ces_modules.dsp.
997 * If the server dso modules are being built and tested Apache must not
998 be running or the copy of the dso modules will fail.
1002 If Apache 2 has been built and the server modules are required then
1003 gen-make.py will already have been run. If the source is from the zip
1004 file, Apache 2 has not been built so gen-make.py must be run:
1006 C:>python gen-make.py -t dsp --with-berkeley-db=db4-win32
1007 --with-openssl=..\openssl-0.9.7f --with-zlib=..\zlib
1008 --with-libintl=..\svn-win32-libintl
1010 Then build subversion:
1012 C:>msdev subversion_msvc.dsw /USEENV /MAKE "__ALL_TESTS__ - Win32 Release"
1015 Or, with Visual C++.NET 2005 or C++ Express 2005:
1017 C:>devenv subversion_vcnet.sln /build "Release" /project "__ALL_TESTS__"
1020 Or, with Visual C++.NET 2008+, C++ Express 2008+, Studio Express 2012+ or
1021 Studio Community 2013+:
1023 C:>msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release
1026 The binaries have now been built.
1028 E.5 Packaging the binaries
1030 You now need to copy the binaries ready to make the release zip
1031 file. You also need to do this to run the tests as the new binaries
1032 need to be in your path. You can use the build/win32/make_dist.py
1033 script in the Subversion source directory to do that.
1035 [TBD: Describe how to do this. Note dependencies on zip, jar, doxygen.]
1037 E.6 Testing the Binaries
1038 [TBD: It's been a long, long while since it was necessary to move
1039 binaries around for testing. win-tests.py does that automagically.
1040 Fix this section accordingly, and probably reorder, putting
1041 the packaging at the end.]
1043 The build process creates the binary test programs but it does not
1044 copy the client tests into the release test area.
1047 C:>mkdir Release\subversion\tests\cmdline
1048 C:>xcopy /S /Y subversion\tests\cmdline Release\subversion\tests\cmdline
1050 If the server dso modules have been built then copy the dso files and
1051 dlls into the Apache modules directory.
1053 C:>copy Release\subversion\mod_dav_svn\mod_dav_svn.so "%APACHEDIR%"\modules
1054 C:>copy Release\subversion\mod_authz_svn\mod_authz_svn.so
1055 "%APACHEDIR%"\modules
1056 C:>copy svn-win32-%VER%\bin\intl.dll "%APACHEDIR%\bin"
1057 C:>copy svn-win32-%VER%\bin\iconv.dll "%APACHEDIR%\bin"
1058 C:>copy svn-win32-%VER%\bin\libdb42.dll "%APACHEDIR%\bin"
1061 Put the svn-win32-trunk\bin directory at the start of your path so
1062 you run the newly built binaries and not another version you might
1065 Then run the client tests:
1067 C:>PATH=%BUILD_ROOT%\svn-win32-%VER%\bin;%PATH%
1069 C:>python win-tests.py -c -r -v
1071 If the server dso modules were built configure Apache to use the
1072 mod_dav_svn and mod_authz_svn modules by making sure these lines appear
1073 uncommented in httpd.conf:
1075 LoadModule dav_module modules/mod_dav.so
1076 LoadModule dav_fs_module modules/mod_dav_fs.so
1077 LoadModule dav_svn_module modules/mod_dav_svn.so
1078 LoadModule authz_svn_module modules/mod_authz_svn.so
1080 And further down the file add location directives to point to the
1081 test repositories. Change the paths to the SVN directory you created
1082 (paths should be on one line even if wrapped here):
1084 <Location /svn-test-work/repositories>
1086 SVNParentPath C:/SVN/src-trunk/Release/subversion/tests/cmdline/
1087 svn-test-work/repositories
1090 <Location /svn-test-work/local_tmp/repos>
1092 SVNPath c:/SVN/src-trunk/Release/subversion/tests/cmdline/
1093 svn-test-work/local_tmp/repos
1096 Then restart Apache and run the tests:
1098 C:>python win-tests.py -c -r -v -u http://localhost
1101 III. BUILDING A SUBVERSION SERVER
1102 ============================
1104 Subversion has two servers you can choose from: svnserve and
1105 Apache. svnserve is a small, lightweight server program that is
1106 automatically compiled when you build Subversion's source. Apache
1107 is a more heavyweight HTTP server, but tends to have more features.
1109 This section primarily focuses on how to build Apache and the
1110 accompanying mod_dav_svn server module for it. If you plan to use
1111 svnserve instead, jump right to section E for a quick explanation.
1114 A. Setting Up Apache
1117 1. Obtaining and Installing Apache 2
1119 Subversion tries to compile against the latest released version
1120 of Apache httpd 2.2+. The easiest thing for you to do is download
1121 a source tarball of the latest release and unpack that.
1123 If you have questions about the Apache httpd 2.2 build, please consult
1124 the httpd install documentation:
1126 http://httpd.apache.org/docs-2.2/install.html
1128 At the top of the httpd tree:
1131 $ ./configure --enable-dav --enable-so --enable-maintainer-mode
1133 The first arg says to build mod_dav.
1135 The second arg says to enable shared module support which is needed
1136 for a typical compile of mod_dav_svn (see below).
1138 The third arg says to include debugging information. If you
1139 built Subversion with --enable-maintainer-mode, then you should
1140 do the same for Apache; there can be problems if one was
1141 compiled with debugging and the other without.
1143 Note: if you have multiple db versions installed on your system,
1144 Apache might link to a different one than Subversion, causing
1145 failures when accessing the repository through Apache. To prevent
1146 this from happening, you have to tell Apache which db version to
1147 use and where to find db. Add --with-dbm=db4 and
1148 --with-berkeley-db=/usr/local/BerkeleyDB.4.2 to the configure
1149 line. Make sure this is the same db as the one Subversion uses.
1150 This note assumes you have installed Berkeley DB 4.2.52
1151 at its default locations. For more info about the db requirement,
1154 You may also want to include other modules in your build. Add
1155 --enable-ssl to turn on SSL support, and --enable-deflate to turn on
1156 compression support, for example. Consult the Apache documentation
1159 All instructions below assume you configured Apache to install
1160 in its default location, /usr/local/apache2/; substitute
1161 appropriately if you chose some other location.
1163 Compile and install apache:
1165 $ make && make install
1168 B. Making and Installing the Subversion Apache Server Module
1169 ---------------------------------------------------------
1171 Go back into your subversion working copy and run ./autogen.sh if
1172 you need to. Then, assuming Apache httpd 2.2 is installed in the
1173 standard location, run:
1177 Note: do *not* configure subversion with "--disable-shared"!
1178 mod_dav_svn *must* be built as a shared library, and it will
1179 look for other libsvn_*.so libraries on your system.
1181 If you see a warning message that the build of mod_dav_svn is
1182 being skipped, this may be because you have Apache httpd 2.x
1183 installed in a non-standard location. You can use the
1184 "--with-apxs=" option to locate the apxs script:
1186 $ ./configure --with-apxs=/usr/local/apache2/bin/apxs
1188 Note: it *is* possible to build mod_dav_svn as a static library
1189 and link it directly into Apache. Possible, but painful. Stick
1190 with the shared library for now; if you can't, then ask.
1192 $ rm /usr/local/lib/libsvn*
1194 If you have old subversion libraries sitting on your system,
1195 libtool will link them instead of the `fresh' ones in your tree.
1196 Remove them before building subversion.
1198 $ make clean && make && make install
1200 After the make install, the Subversion shared libraries are in
1201 /usr/local/lib/. mod_dav_svn.so should be installed in
1202 /usr/local/libexec/ (or elsewhere, such as /usr/local/apache2/modules/,
1203 if you passed --with-apache-libexecdir to configure).
1206 Section II.E explains how to build the server on Windows.
1209 C. Configuring Apache for Subversion
1210 ---------------------------------
1212 The following section is an abbreviated version of the
1213 information in the Subversion Book
1214 (http://svnbook.red-bean.com). Please read chapter 6 for more
1217 The following assumes you have already created a repository.
1218 For documentation on how to do that, see README.
1220 The following also assumes that you have modified
1221 /usr/local/apache2/conf/httpd.conf to reflect your setup.
1222 At a minimum you should look at the User, Group and ServerName
1223 directives. Full details on setting up apache can be found at:
1224 http://httpd.apache.org/docs-2.2/
1226 First, your httpd.conf needs to load the mod_dav_svn module.
1227 If you pass --enable-mod-activation to Subversion's configure,
1228 'make install' target should automatically add this line for you.
1229 In any case, if Apache HTTPD gives you an error like "Unknown
1230 DAV provider: svn", then you may want to verify that this line
1231 exists in your httpd.conf:
1233 LoadModule dav_svn_module modules/mod_dav_svn.so
1235 NOTE: if you built mod_dav as a dynamic module as well, make sure
1236 the above line appears after the one that loads mod_dav.so.
1238 Next, add this to the *bottom* of your httpd.conf:
1240 <Location /svn/repos>
1242 SVNPath /absolute/path/to/repository
1245 This will give anyone unrestricted access to the repository. If
1246 you want limited access, read or write, you add these lines to
1250 AuthName "Subversion repository"
1251 AuthUserFile /my/svn/user/passwd/file
1255 a) For a read/write restricted repository:
1259 b) For a write restricted repository:
1261 <LimitExcept GET PROPFIND OPTIONS REPORT>
1265 c) For separate restricted read and write access:
1267 AuthGroupFile /my/svn/group/file
1269 <LimitExcept GET PROPFIND OPTIONS REPORT>
1270 Require group svn_committers
1273 <Limit GET PROPFIND OPTIONS REPORT>
1274 Require group svn_committers
1275 Require group svn_readers
1278 ### FIXME Tutorials section refers to old 2.0 docs
1279 These are only a few simple examples. For a complete tutorial
1280 on Apache access control, please consider taking a look at the
1281 tutorials found under "Security" on the following page:
1282 http://httpd.apache.org/docs-2.0/misc/tutorials.html
1284 In order for 'svn cp' to work (which is actually implemented as a
1285 DAV COPY command), mod_dav needs to be able to determine the
1286 hostname of the server. A standard way of doing this is to use
1287 Apache's ServerName directive to set the server's hostname. Edit
1288 your /usr/local/apache2/conf/httpd.conf to include:
1290 ServerName svn.myserver.org
1292 If you are using virtual hosting through Apache's NameVirtualHost
1293 directive, you may need to use the ServerAlias directive to specify
1294 additional names that your server is known by.
1296 If you have configured mod_deflate to be in the server, you can enable
1297 compression support for your repository by adding the following line
1298 to your Location block:
1300 SetOutputFilter DEFLATE
1303 NOTE: If you are unfamiliar with an Apache directive, or not exactly
1304 sure about what it does, don't hesitate to look it up in the
1305 documentation: http://httpd.apache.org/docs-2.2/mod/directives.html.
1307 NOTE: Make sure that the user 'nobody' (or whatever UID the
1308 httpd process runs as) has permission to read and write the
1309 Berkeley DB files! This is a very common problem.
1312 D. Running and Testing
1317 $ /usr/local/apache2/bin/apachectl stop
1318 $ /usr/local/apache2/bin/apachectl start
1320 Check /usr/local/apache2/logs/error_log to make sure it started
1323 Try doing a network checkout from the repository:
1325 $ svn co http://localhost/svn/repos wc
1327 The most common reason this might fail is permission problems
1328 reading the repository db files. If the checkout fails, make
1329 sure that the httpd process has permission to read and write to
1330 the repository. You can see all of mod_dav_svn's complaints in
1331 the Apache error logfile, /usr/local/apache2/logs/error_log.
1333 To run the regression test suite for networked Subversion, see
1334 the instructions in subversion/tests/cmdline/README.
1335 For advice about tracing problems, see "Debugging the server" in
1336 http://subversion.apache.org/docs/community-guide/.
1339 E. Alternative: 'svnserve' and ra_svn
1340 -----------------------------------
1342 An alternative network layer is libsvn_ra_svn (on the client
1343 side) and the 'svnserve' process on the server. This is a
1344 simple network layer that speaks a custom protocol over plain
1345 TCP (documented in libsvn_ra_svn/protocol):
1347 $ svnserve -d # becomes a background daemon
1348 $ svn checkout svn://localhost/usr/local/svn/repository
1350 You can use the "-r" option to svnserve to set a logical root
1351 for repositories, and the "-R" option to restrict connections to
1352 read-only access. ("Read-only" is a logical term here; svnserve
1353 still needs write access to the database in this mode, but will
1354 not allow commits or revprop changes.)
1356 'svnserve' has built-in CRAM-MD5 authentication (so you can use
1357 non-system accounts), and can also be tunneled over SSH (so you
1358 can use existing system accounts). It's also capable of using
1359 Cyrus SASL if libsasl2 is detected at ./configure time. Please
1360 read chapter 6 in the Subversion Book
1361 (http://svnbook.red-bean.com) for details on these features.
1365 IV. PLATFORM-SPECIFIC ISSUES
1366 ========================
1371 There is an error in the Windows XP TCP/IP stack which causes
1372 corruption in certain cases. This problem is exposed only
1375 The root of the matter is caused by duplicating file handles
1376 between parent and child processes. The httpd Apache group
1377 explains this a lot better:
1379 http://www.apache.org/dist/httpd/binaries/win32/#xpbug
1381 And there's an item about this in the Subversion FAQ:
1383 http://subversion.apache.org/faq.html#windows-xp-server
1385 The only known workaround for now is to update to Windows XP
1392 [TBD: Describe BDB 4.0.x problem]
1396 V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA)
1397 ========================================================
1399 For Python, Perl and Ruby bindings, see the file
1401 ./subversion/bindings/swig/INSTALL
1403 For Java bindings, see the file
1405 ./subversion/bindings/javahl/README