INSTALL revision 299742
1193323Sed ====================================== 2193323Sed INSTALLING SUBVERSION 3193323Sed A Quick Guide 4193323Sed ====================================== 5193323Sed 6193323Sed$LastChangedDate: 2015-12-12 04:00:43 +0000 (Sat, 12 Dec 2015) $ 7193323Sed 8193323Sed 9193323SedContents: 10193323Sed 11193323Sed I. INTRODUCTION 12193323Sed A. Audience 13193323Sed B. Dependency Overview 14193323Sed C. Dependencies in Detail 15193323Sed D. Documentation 16193323Sed 17193323Sed II. INSTALLATION 18193323Sed A. Building from a Tarball 19193323Sed B. Building the Latest Source under Unix 20249423Sdim C. Building under Unix in Different Directories 21249423Sdim D. Installing from a Zip or Installer File under Windows 22218893Sdim E. Building the Latest Source under Windows 23198090Srdivacky 24249423Sdim III. BUILDING A SUBVERSION SERVER 25193323Sed A. Setting Up Apache 26193323Sed B. Making and Installing the Subversion Server 27193323Sed C. Configuring Apache for Subversion 28193323Sed D. Running and Testing 29193323Sed E. Alternative: 'svnserve' and ra_svn 30193323Sed 31193323Sed IV. PLATFORM-SPECIFIC ISSUES 32193323Sed A. Windows XP 33193323Sed B. Mac OS X 34193323Sed 35193323Sed V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA) 36193323Sed 37205218Srdivacky 38193323Sed 39221345SdimI. INTRODUCTION 40193323Sed ============ 41193323Sed 42193323Sed A. Audience 43193323Sed 44193323Sed This document is written for people who intend to build 45193323Sed Subversion from source code. Normally, the only people who do 46193323Sed this are Subversion developers and package maintainers. 47193323Sed 48193323Sed If neither of these labels fits you, we recommend you find an 49193323Sed appropriate binary package of Subversion and install that. 50193323Sed While the Subversion project doesn't officially release binary 51193323Sed packages, a number of volunteers have made such packages 52193323Sed available for different operating systems. Most Linux and BSD 53193323Sed distributions already have Subversion packages ready to go via 54234353Sdim standard packaging channels, and other volunteers have built 55193323Sed 'installers' for both Windows and OS X. Visit this page for 56193323Sed package links: 57193323Sed 58193323Sed http://subversion.apache.org/packages.html 59193323Sed 60193323Sed For those of you who still wish to build from source, Subversion 61193323Sed follows the Unix convention of "./configure && make", but it has 62193323Sed a number of dependencies. 63193323Sed 64193323Sed 65193323Sed B. Dependency Overview 66193323Sed 67193323Sed You'll need the following build tools to compile Subversion: 68193323Sed 69193323Sed * autoconf 2.59 or later (Unix only) 70193323Sed * libtool 1.4 or later (Unix only) 71201360Srdivacky * a reasonable C compiler (gcc, Visual Studio, etc.) 72201360Srdivacky 73201360Srdivacky 74201360Srdivacky Subversion also depends on the following third-party libraries: 75201360Srdivacky 76193323Sed * libapr and libapr-util (REQUIRED for client and server) 77193323Sed 78193323Sed The Apache Portable Runtime (APR) library provides an 79193323Sed abstraction of operating-system level services such as file 80193574Sed and network I/O, memory management, and so on. It also 81193323Sed provides convenience routines for things like hashtables, 82193323Sed checksums, and argument processing. While it was originally 83193323Sed developed for the Apache HTTP server, APR is a standalone 84193323Sed library used by Subversion and other products. It is a 85193323Sed critical dependency for all of Subversion; it's the layer 86193323Sed that allows Subversion clients and servers to run on 87193323Sed different operating systems. 88194178Sed 89193323Sed * SQLite (REQUIRED for client and server) 90193574Sed 91193574Sed Subversion uses SQLite to manage some internal databases. 92193574Sed 93193574Sed * libz (REQUIRED for client and server) 94193323Sed 95193323Sed Subversion uses zlib for compressing binary differences. 96193323Sed These diff streams are used everywhere -- over the network, 97193323Sed in the repository, and in the client's working copy. 98193323Sed 99193323Sed * libserf (OPTIONAL for client) 100193323Sed 101193323Sed The Serf library allows the Subversion client to send HTTP 102194178Sed requests. This is necessary if you want your client to access 103193323Sed a repository served by the Apache HTTP server. There is an 104193574Sed alternate 'svnserve' server as well, though, and clients 105193574Sed automatically know how to speak the svnserve protocol. 106193574Sed Thus it's not strictly necessary for your client to be able 107193574Sed to speak HTTP... though we still recommend that your client 108193323Sed be built to speak both HTTP and svnserve protocols. 109193323Sed 110193323Sed * OpenSSL (OPTIONAL for client and server) 111193323Sed 112193323Sed OpenSSL enables your client to access SSL-encrypted https:// 113193323Sed URLs (using libserf) in addition to unencrypted http:// URLs. 114193323Sed To use SSL with Subversion's WebDAV server, Apache needs to be 115193323Sed compiled with OpenSSL as well. 116193323Sed 117193323Sed * Berkeley DB (OPTIONAL for client and server) 118193574Sed 119193574Sed There are two different repository 'back-end' 120193574Sed implementations. One implementation stores data in a flat 121193574Sed filesystem (known as FSFS); the other implementation stores 122193574Sed data in a Berkeley DB database (known as BDB). When you 123193574Sed create a repository, you have the option of specifying a 124193574Sed storage back-end. The Berkeley DB back-end will only be 125193574Sed available if the BDB libraries are discovered at compile 126193323Sed time. The Berkeley DB back-end has been deprecated and 127193323Sed is not recommend. 128193323Sed 129193323Sed * libsasl (OPTIONAL for client and server) 130193323Sed 131193323Sed If the Cyrus SASL library is detected at compile time, then 132193323Sed the svn client (and svnserve server) will be able to utilize 133193323Sed SASL to do various forms of authentication when speaking the 134193323Sed svnserve protocol. 135193323Sed 136193574Sed * Python, Perl, Java, Ruby (OPTIONAL) 137193574Sed 138193574Sed Subversion is mostly a collection of C libraries with 139193574Sed well-defined APIs, with a small collection of programs that 140193574Sed use the APIs. If you want to build Subversion API bindings 141193574Sed for other languages, you need to have those languages 142193574Sed available at build time. 143193574Sed 144193323Sed * KDELibs, GNOME Keyring (OPTIONAL for client) 145193323Sed 146193323Sed Subversion contains optional support for storing passwords in 147193323Sed KWallet (KDE 4) or GNOME Keyring. 148193323Sed 149203954Srdivacky * libmagic (OPTIONAL) 150193323Sed 151193323Sed If the libmagic library is detected at compile time, 152193323Sed it will be used to determine mime-types of binary files 153198090Srdivacky which are added to version control. Note that mime-types 154198090Srdivacky configured via auto-props or the mime-types-file option 155198090Srdivacky take precedence. 156198090Srdivacky 157193323Sed * Googlemock aka Gmock (OPTIONAL) 158198090Srdivacky 159198090Srdivacky This optional package is used by the tests for Subversions' 160198090Srdivacky C++ bindings. 161198090Srdivacky 162198090Srdivacky 163198090Srdivacky C. Dependencies in Detail 164198090Srdivacky 165198090Srdivacky Subversion depends on a number of third party tools and libraries. 166193323Sed Some of them are only required to run a Subversion server; others 167198090Srdivacky are necessary just for a Subversion client. This section explains 168193323Sed what other tools and libraries will be required so that Subversion 169198090Srdivacky can be built with the set of features you want. 170198090Srdivacky 171198090Srdivacky On Unix systems, the './configure' script will tell you if you are 172193323Sed missing the correct version of any of the required libraries or 173193323Sed tools, so if you are in a real hurry to get building, you can skip 174193323Sed straight to section II. If you want to gather the pieces you will 175193323Sed need before starting out, however, you should read the following. 176207618Srdivacky 177193323Sed If you're just installing a Subversion client, the Subversion 178193574Sed team has created a script that downloads the minimal prerequisite 179193323Sed libraries (Apache Portable Runtime, Sqlite, and Zlib). The script, 180207618Srdivacky 'get-deps.sh', is available in the same directory as this file. 181193323Sed When run, it will place 'apr', 'apr-util', 'serf', 'zlib', and 182193323Sed 'sqlite-amalgamation' directories directly into your unpacked Subversion 183207618Srdivacky distribution. With the exception of sqlite-amalgamation, they will 184207618Srdivacky still need to be configured, built and installed explicitly, and 185207618Srdivacky Subversion's own configure script may need to be told where to find 186207618Srdivacky them, if they were not installed in standard system locations. 187207618Srdivacky 188207618Srdivacky Note: there are optional dependencies (such as openssl, swig, and httpd) 189207618Srdivacky which get-deps.sh does not download. 190193323Sed 191193323Sed Note: Because previous builds of Subversion may have installed older 192193323Sed versions of these libraries, you may want to run some of the cleanup 193193323Sed commands described in section II.B before installing the following. 194194178Sed 195193574Sed 196193323Sed 1. Apache Portable Runtime 1.3 or newer (REQUIRED) 197193323Sed 198193323Sed Whenever you want to build any part of Subversion, you need the 199193574Sed Apache Portable Runtime (APR) and the APR Utility (APR-util) 200193323Sed libraries. 201193323Sed 202193323Sed If you do not have a pre-installed APR and APR-util, you will need 203193323Sed to get these yourself: 204193323Sed 205193323Sed http://apr.apache.org/download.cgi 206193323Sed 207193323Sed On Unix systems, if you already have the APR libraries compiled and do 208193323Sed not wish to regenerate them from source code, then Subversion needs to 209193323Sed be able to find them. 210249423Sdim 211193574Sed There are a couple of options to "./configure" that tell it where 212193323Sed to look for the APR and APR-util libraries. By default it will try 213193323Sed to locate the libraries using apr-config and apu-config scripts. 214193323Sed These scripts provide all the relevant information for the APR and 215193323Sed APR-util installations. 216193323Sed 217193323Sed If you want to specify the location of the APR library, you can use 218194178Sed the "--with-apr=" option of "./configure". It should be able to find 219193323Sed the apr-config script in the standard location under that directory 220193323Sed (e.g. ${prefix}/bin). 221193323Sed 222193323Sed Similarly, you can specify the location of APR-util using the 223193323Sed "--with-apr-util=" option to "./configure". It will look for the 224193323Sed apu-config script relative to that directory. 225193323Sed 226193323Sed For example, if you want to use the APR libraries you built 227193323Sed with the Apache httpd server, you could run: 228193323Sed 229193323Sed $ ./configure --with-apr=/usr/local/apache2 \ 230193323Sed --with-apr-util=/usr/local/apache2 ... 231193323Sed 232193323Sed Be sure to use a native Windows SVN client (as opposed to 233193323Sed Cygwin's version) so that the .dsp files get carriage-returns at 234193323Sed the ends of their lines. Otherwise Visual Studio will complain 235193323Sed that it doesn't recognize the .dsp files. 236193323Sed 237193323Sed If you use APR libraries checked out from svn in an Unix 238193323Sed environment, you need to run the 'buildconf' script in each 239193323Sed library's directory, to regenerate the configure scripts and 240193323Sed other files required for compiling the libraries: 241193323Sed 242193323Sed $ cd apr; ./buildconf; ./configure ...; make; make install; cd .. 243193323Sed 244193323Sed $ cd apr-util; ./buildconf; ./configure ...; make; make install; cd .. 245193323Sed 246193323Sed Configure build and install both libraries before running Subversion's 247193323Sed configure script. 248193323Sed 249193323Sed 250193323Sed 2. Zlib (REQUIRED) 251205218Srdivacky 252193323Sed Subversion's binary-differencing engine depends on zlib for 253193323Sed compression. Most Unix systems have libz pre-installed, but 254193323Sed if you need it, you can get it from 255193323Sed 256193323Sed http://www.zlib.net/ 257193323Sed 258193323Sed 259193323Sed 3. autoconf 2.59 or newer (Unix only) 260193323Sed 261193323Sed This is required only if you plan to build from the latest source 262193323Sed (see section II.B). Generally only developers would be doing this. 263193323Sed 264193323Sed 265193323Sed 4. libtool 1.4 or newer (Unix only) 266193323Sed 267193323Sed This is required only if you plan to build from the latest source 268193323Sed (see section II.B). 269193323Sed 270193323Sed Note: Some systems (Solaris, for example) require libtool 1.4.3 or 271193323Sed newer. The autogen.sh script knows about that. 272193323Sed 273198090Srdivacky 274198090Srdivacky 5. Serf library 1.3.4 or newer (OPTIONAL) 275198090Srdivacky 276198090Srdivacky If you want your client to be able to speak to an Apache 277198090Srdivacky server (via a http:// or https:// URL), you must link against 278193323Sed serf. Though optional, we strongly recommend this. 279193323Sed 280193323Sed In order to use ra_serf, you must install serf, and run Subversion's 281193323Sed ./configure with the argument --with-serf. If serf is installed in a 282193323Sed non-standard place, you should use 283193323Sed 284193323Sed --with-serf=/path/to/serf/install 285193323Sed 286193323Sed instead. 287193323Sed 288193323Sed Serf can be obtained via your system's package distribution 289193323Sed system or directly from http://code.google.com/p/serf/. 290193323Sed 291193323Sed For more information on serf and Subversion's ra_serf, see the file 292193323Sed subversion/libsvn_ra_serf/README. 293193323Sed 294193323Sed 6. OpenSSL (OPTIONAL) 295193323Sed 296198090Srdivacky ### needs some updates. I think serf automagically handles 297198090Srdivacky ### finding OpenSSL, but we may need more docco here. and w.r.t 298198090Srdivacky ### zlib. 299198090Srdivacky 300198090Srdivacky The Serf library has support for SSL encryption by relying on the 301198090Srdivacky OpenSSL library. 302198090Srdivacky 303193323Sed a. Using OpenSSL on the client through Serf 304193323Sed 305193323Sed On Unix systems, to build Serf with OpenSSL, you need OpenSSL 306193323Sed installed on your system, and you must add "--with-ssl" as a 307193323Sed "./configure" parameter. If your OpenSSL installation is hard 308193323Sed for Serf to find, you may need to use "--with-libs=/path/to/lib" 309193323Sed in addition. In particular, on Red Hat (but not Fedora Core) it 310193323Sed is necessary to specify "--with-libs=/usr/kerberos" for OpenSSL 311193323Sed to be found. You can also specify a path to the zlib library 312193323Sed using "--with-libs". 313193323Sed 314193323Sed Under Windows, you can specify the paths to these libraries by 315193323Sed passing the options --with-zlib and --with-openssl to gen-make.py. 316193323Sed 317193323Sed b. Using OpenSSL on the Apache server 318193323Sed 319193323Sed You can also add support for these features to an Apache httpd 320193323Sed server to be used for Subversion using the same support libraries. 321193323Sed The Subversion build system will not provide them, however. You 322193323Sed add them by specifying parameters to the "./configure" script of 323193323Sed the Apache Server instead. 324193323Sed 325205218Srdivacky For getting SSL on your server, you would add the "--enable-ssl" 326205218Srdivacky or "--with-ssl=/path/to/lib" option to Apache's "./configure" 327193323Sed script. Apache enables zlib support by default, but you can 328205218Srdivacky specify a nonstandard location for the library with the 329193323Sed "--with-z=/path/to/dir" option. Consult the Apache documentation 330193323Sed for more details, and for other modules you may wish to install 331193323Sed to enhance your Subversion server. 332193323Sed 333207618Srdivacky If you don't already have it, you can get a copy of OpenSSL, 334207618Srdivacky including instructions for building and packaging on both Unix 335207618Srdivacky systems and Windows, at: 336207618Srdivacky 337193323Sed http://www.openssl.org/ 338193323Sed 339193323Sed 340193323Sed 7. Berkeley DB 4.X (OPTIONAL) 341193323Sed 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. 347 348 The current recommended version is 4.4.20 or newer, which brings 349 auto-recovery functionality to the Berkeley DB database 350 environment. 351 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. 357 358 You'll need Berkeley DB installed on your system. You can 359 get it from: 360 361 http://www.oracle.com/technology/software/products/berkeley-db/index.html 362 363 If you have Berkeley DB installed in a place not searched by default 364 for includes and libraries, add something like this: 365 366 --with-berkeley-db=db.h:/usr/local/include/db4.7:/usr/local/lib/db4.7:db-4.7 367 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. 373 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: 377 378 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688 379 380 Look in the "Releases > Windows > Windows BDB" section. 381 382 383 8. Cyrus SASL library (OPTIONAL) 384 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 389 code, visit: 390 391 http://freshmeat.net/projects/cyrussasl/ 392 393 394 9. Apache Web Server 2.2.X or newer (OPTIONAL) 395 396 (http://httpd.apache.org/download.cgi) 397 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. 405 406 407 10. Python 2.7 or newer (http://www.python.org/) (OPTIONAL) 408 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 413 system. 414 415 Note that Python 3.x is not supported and most likely won't work. 416 417 418 11. Perl 5.8 or newer (Windows only) (OPTIONAL) 419 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 422 script. 423 424 425 12. SQLite (REQUIRED) 426 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. 432 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: 437 438 http://www.sqlite.org/download.html 439 440 441 13. pkg-config (Unix only, OPTIONAL) 442 443 Subversion uses pkg-config to find appropriate options used 444 at build time. 445 446 447 14. D-Bus (Unix only, OPTIONAL) 448 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. 451 452 453 15. Qt 4 (Unix only, OPTIONAL) 454 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. 458 459 460 16. KDELibs 4 (Unix only, OPTIONAL) 461 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 468 use: 469 470 --with-kwallet=/path/to/KDE/prefix 471 472 17. GLib 2 (Unix only, OPTIONAL) 473 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. 476 477 478 18. GNOME Keyring (Unix only, OPTIONAL) 479 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`. 484 485 486 19. Ctypesgen (OPTIONAL) 487 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: 492 493 --with-ctypesgen=/path/to/ctypesgen.py 494 495 For more information on CSVN, see subversion/bindings/ctypes-python/README. 496 497 20. libmagic (OPTIONAL) 498 499 Subversion's configure script attempts to find libmagic automatically. 500 If it is installed in a non-standard location, then use: 501 502 --with-libmagic=/path/to/libmagic/prefix 503 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. 507 508 If libmagic is installed but support for it should not be compiled 509 in, then use: 510 511 --with-libmagic=no 512 513 If configure should fail when libmagic is not present, but only 514 the default locations should be searched, then use: 515 516 --with-libmagic 517 518 21. Googlemock (OPTIONAL) 519 520 Googlemock can be installed and built in-tree by invoking 521 522 $ ./get-dep.sh gmock 523 524 D. Documentation 525 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/. 529 530 Various additional documentation exists in the doc/ subdirectory of 531 the Subversion source. See the file doc/README for more information. 532 533 534 535II. INSTALLATION 536 ============ 537 538 A. Building from a Tarball 539 ------------------------------ 540 541 1. Building from a Tarball 542 543 Download the most recent distribution tarball from: 544 545 http://subversion.apache.org/download/ 546 547 Unpack it, and use the standard GNU procedure to compile: 548 549 $ ./configure 550 $ make 551 # make install 552 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". 557 558 559 B. Building the Latest Source under Unix 560 ------------------------------------- 561 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). 568 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. 572 573 First off, if you have any Subversion libraries lying around 574 from previous 'make installs', clean them up first! 575 576 # rm -f /usr/local/lib/libsvn* 577 # rm -f /usr/local/lib/libapr* 578 # rm -f /usr/local/lib/libserf* 579 580 Start the process by running "autogen.sh": 581 582 $ sh ./autogen.sh 583 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 587 section I.) 588 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: 598 599 $ AUTOCONF=autoconf2.59 sh ./autogen.sh 600 601 Once you've prepared the working copy by running autogen.sh, 602 just follow the usual configuration and build procedure: 603 604 $ ./configure 605 $ make 606 # make install 607 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.) 611 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: 621 622 subversion/libsvn_ra/ra_loader.c:209: (apr_err=170000) 623 svn: Unrecognized URL scheme 'https://svn.apache.org/repos/asf/subversion/trunk' 624 625 It probably means that the dynamic loader/linker can't find all 626 of the libsvn_* libraries. 627 628 629 C. Building under Unix in Different Directories 630 -------------------------------------------- 631 632 It is possible to configure and build Subversion on Unix in a 633 directory other than the working copy. For example 634 635 $ svn co https://svn.apache.org/repos/asf/subversion/trunk svn 636 $ cd svn 637 $ # get SQLite amalgamation if required 638 $ chmod +x autogen.sh 639 $ ./autogen.sh 640 $ mkdir ../obj 641 $ cd ../obj 642 $ ../svn/configure [...with options as appropriate...] 643 $ make 644 645 puts the Subversion working copy in the directory svn and builds 646 it in a separate, parallel directory obj. 647 648 Why would you want to do this? Well there are a number of 649 reasons... 650 651 * You may prefer to avoid "polluting" the working copy with 652 files generated during the build. 653 654 * You may want to put the build directory and the working 655 copy on different physical disks to improve performance. 656 657 * You may want to separate source and object code and only 658 backup the source. 659 660 * You may want to remote mount the working copy on multiple 661 machines, and build for different machines from the same 662 working copy. 663 664 * You may want to build multiple configurations from the 665 same working copy. 666 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. 674 675 676 D. Installing from a Zip or Installer File under Windows 677 -------------------------------------------------------- 678 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: 682 683 http://subversion.apache.org/packages#windows 684 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 689 reporting tool. 690 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. 694 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. 698 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: 702 703 C:\test>svn co https://svn.apache.org/repos/asf/subversion/trunk svn 704 705 This will get the latest Subversion sources and put them into the 706 "svn" subdirectory. 707 708 If using a self-extracting .exe file, just run it instead of 709 unzipping it, to install Subversion. 710 711 E. Building the Latest Source under Windows 712 ---------------------------------------- 713 714 E.1 Prerequisites 715 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 732 ready to use. 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. 746 747 Additional Options 748 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 780 781 E.2 Notes 782 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 787 more details. 788 789 E.3 Preparation 790 791 This section describes how to unpack the files to make a build tree. 792 793 * Make a directory SVN and cd into it. 794 * Either checkout Subversion: 795 796 svn co https://svn.apache.org/repos/asf/subversion/trunk src-trunk 797 798 or unpack the zip file distribution and rename the directory to 799 src-trunk. 800 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 807 SDK documentation: 808 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 821 not be running." 822 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. 838 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.] 843 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 848 your path. 849 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. 857 Or: 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 865 SVN\openssl-x.x.x 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. 877 878 E.4 Building the Binaries 879 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 884 components. 885 886 Start in the SVN directory you created. 887 888 Set up the environment (commands should be one line even if wrapped here). 889 890 C:>set VER=trunk 891 C:>set DIR=trunk 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% 903 904 OpenSSL 905 906 C:>cd openssl-0.9.7f 907 C:>perl Configure VC-WIN32 908 [*] C:>call ms\do_masm 909 C:>nmake -f ms\ntdll.mak 910 C:>cd out32dll 911 C:>call ..\ms\test 912 C:>cd ..\.. 913 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. 916 917 Apache 2 918 919 This step is only required for building the server dso modules. 920 921 C:>set APACHEDIR=C:\Program Files\Apache Group\Apache2 922 C:>msdev httpd-2.0.58\apache.dsw /MAKE "BuildBin - Win32 Release" 923 924 APR 925 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: 930 931 C:>nmake -f Makefile.win 932 C:>nmake -f Makefile.win install 933 934 Please refere to the build instructions provided by the library source 935 for actual build instructions. 936 937 ZLib 938 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. 942 943 Please refere to the build instructions provided by the library source 944 for actual build instructions. 945 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. 948 949 Serf 950 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] 956 ### scons check 957 ### scons install 958 959 Subversion 960 961 Things to note: 962 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 968 --with-apr-iconv. 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 985 command. 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. 999 1000 C:>cd src-%DIR% 1001 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: 1005 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 1009 1010 Then build subversion: 1011 1012 C:>msdev subversion_msvc.dsw /USEENV /MAKE "__ALL_TESTS__ - Win32 Release" 1013 C:>cd .. 1014 1015 Or, with Visual C++.NET 2005 or C++ Express 2005: 1016 1017 C:>devenv subversion_vcnet.sln /build "Release" /project "__ALL_TESTS__" 1018 C:>cd .. 1019 1020 Or, with Visual C++.NET 2008+, C++ Express 2008+, Studio Express 2012+ or 1021 Studio Community 2013+: 1022 1023 C:>msbuild subversion_vcnet.sln /t:__ALL_TESTS__ /p:Configuration=Release 1024 C:>cd .. 1025 1026 The binaries have now been built. 1027 1028 E.5 Packaging the binaries 1029 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. 1034 1035 [TBD: Describe how to do this. Note dependencies on zip, jar, doxygen.] 1036 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.] 1042 1043 The build process creates the binary test programs but it does not 1044 copy the client tests into the release test area. 1045 1046 C:>cd src-%DIR% 1047 C:>mkdir Release\subversion\tests\cmdline 1048 C:>xcopy /S /Y subversion\tests\cmdline Release\subversion\tests\cmdline 1049 1050 If the server dso modules have been built then copy the dso files and 1051 dlls into the Apache modules directory. 1052 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" 1059 C:>cd .. 1060 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 1063 have installed. 1064 1065 Then run the client tests: 1066 1067 C:>PATH=%BUILD_ROOT%\svn-win32-%VER%\bin;%PATH% 1068 C:>cd src-%DIR% 1069 C:>python win-tests.py -c -r -v 1070 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: 1074 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 1079 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): 1083 1084 <Location /svn-test-work/repositories> 1085 DAV svn 1086 SVNParentPath C:/SVN/src-trunk/Release/subversion/tests/cmdline/ 1087 svn-test-work/repositories 1088 </Location> 1089 1090 <Location /svn-test-work/local_tmp/repos> 1091 DAV svn 1092 SVNPath c:/SVN/src-trunk/Release/subversion/tests/cmdline/ 1093 svn-test-work/local_tmp/repos 1094 </Location> 1095 1096 Then restart Apache and run the tests: 1097 1098 C:>python win-tests.py -c -r -v -u http://localhost 1099 C:>cd .. 1100 1101III. BUILDING A SUBVERSION SERVER 1102 ============================ 1103 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. 1108 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. 1112 1113 1114 A. Setting Up Apache 1115 ----------------- 1116 1117 1. Obtaining and Installing Apache 2 1118 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. 1122 1123 If you have questions about the Apache httpd 2.2 build, please consult 1124 the httpd install documentation: 1125 1126 http://httpd.apache.org/docs-2.2/install.html 1127 1128 At the top of the httpd tree: 1129 1130 $ ./buildconf 1131 $ ./configure --enable-dav --enable-so --enable-maintainer-mode 1132 1133 The first arg says to build mod_dav. 1134 1135 The second arg says to enable shared module support which is needed 1136 for a typical compile of mod_dav_svn (see below). 1137 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. 1142 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, 1152 see section I.C.7. 1153 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 1157 for more details. 1158 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. 1162 1163 Compile and install apache: 1164 1165 $ make && make install 1166 1167 1168 B. Making and Installing the Subversion Apache Server Module 1169 --------------------------------------------------------- 1170 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: 1174 1175 $ ./configure 1176 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. 1180 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: 1185 1186 $ ./configure --with-apxs=/usr/local/apache2/bin/apxs 1187 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. 1191 1192 $ rm /usr/local/lib/libsvn* 1193 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. 1197 1198 $ make clean && make && make install 1199 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). 1204 1205 1206 Section II.E explains how to build the server on Windows. 1207 1208 1209 C. Configuring Apache for Subversion 1210 --------------------------------- 1211 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 1215 details. 1216 1217 The following assumes you have already created a repository. 1218 For documentation on how to do that, see README. 1219 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/ 1225 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: 1232 1233 LoadModule dav_svn_module modules/mod_dav_svn.so 1234 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. 1237 1238 Next, add this to the *bottom* of your httpd.conf: 1239 1240 <Location /svn/repos> 1241 DAV svn 1242 SVNPath /absolute/path/to/repository 1243 </Location> 1244 1245 This will give anyone unrestricted access to the repository. If 1246 you want limited access, read or write, you add these lines to 1247 the Location block: 1248 1249 AuthType Basic 1250 AuthName "Subversion repository" 1251 AuthUserFile /my/svn/user/passwd/file 1252 1253 And: 1254 1255 a) For a read/write restricted repository: 1256 1257 Require valid-user 1258 1259 b) For a write restricted repository: 1260 1261 <LimitExcept GET PROPFIND OPTIONS REPORT> 1262 Require valid-user 1263 </LimitExcept> 1264 1265 c) For separate restricted read and write access: 1266 1267 AuthGroupFile /my/svn/group/file 1268 1269 <LimitExcept GET PROPFIND OPTIONS REPORT> 1270 Require group svn_committers 1271 </LimitExcept> 1272 1273 <Limit GET PROPFIND OPTIONS REPORT> 1274 Require group svn_committers 1275 Require group svn_readers 1276 </Limit> 1277 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 1283 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: 1289 1290 ServerName svn.myserver.org 1291 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. 1295 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: 1299 1300 SetOutputFilter DEFLATE 1301 1302 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. 1306 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. 1310 1311 1312 D. Running and Testing 1313 ------------------- 1314 1315 Fire up apache 2: 1316 1317 $ /usr/local/apache2/bin/apachectl stop 1318 $ /usr/local/apache2/bin/apachectl start 1319 1320 Check /usr/local/apache2/logs/error_log to make sure it started 1321 up okay. 1322 1323 Try doing a network checkout from the repository: 1324 1325 $ svn co http://localhost/svn/repos wc 1326 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. 1332 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/. 1337 1338 1339 E. Alternative: 'svnserve' and ra_svn 1340 ----------------------------------- 1341 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): 1346 1347 $ svnserve -d # becomes a background daemon 1348 $ svn checkout svn://localhost/usr/local/svn/repository 1349 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.) 1355 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. 1362 1363 1364 1365IV. PLATFORM-SPECIFIC ISSUES 1366 ======================== 1367 1368 A. Windows XP 1369 ---------- 1370 1371 There is an error in the Windows XP TCP/IP stack which causes 1372 corruption in certain cases. This problem is exposed only 1373 through ra_dav. 1374 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: 1378 1379 http://www.apache.org/dist/httpd/binaries/win32/#xpbug 1380 1381 And there's an item about this in the Subversion FAQ: 1382 1383 http://subversion.apache.org/faq.html#windows-xp-server 1384 1385 The only known workaround for now is to update to Windows XP 1386 SP1 (or higher). 1387 1388 1389 B. Mac OS X 1390 -------- 1391 1392 [TBD: Describe BDB 4.0.x problem] 1393 1394 1395 1396V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA) 1397 ======================================================== 1398 1399 For Python, Perl and Ruby bindings, see the file 1400 1401 ./subversion/bindings/swig/INSTALL 1402 1403 For Java bindings, see the file 1404 1405 ./subversion/bindings/javahl/README 1406