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