aboutsummaryrefslogtreecommitdiff
blob: 06f17e84779789cf0cd74b31879bc85087dd5025 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0"?>
<guide self="ebuild-writing/functions/src_unpack/svn-sources/">
<chapter>
<title>Subversion Sources</title>

<body>
<p>
As with CVS, an eclass exists for working directly with upstream
Subversion repositories. See `subversion.eclass Reference`_ for a full
list of functions and variables. Also see
the <uri link="::ebuild-writing/functions/src_unpack/cvs-sources"/> 
ection.
</p>
</body>

<section>
<title>Disadvantages of Subversion Sources</title>
<body>

<p>
Note that Subversion ebuilds should <b>not</b> generally be added to
the tree (except under <c>package.mask</c>) for much the same reasons
that live CVS ebuilds should not (see
<uri link="::ebuild-writing/functions/src_unpack/cvs-sources#Disadvantages of CVS Sources"/>). Indeed, there should be even less
impetus to add a live Subversion ebuild than a live CVS ebuild, as
Subversion checkouts are roughly a factor of five larger than an
equivalent CVS checkout.
</p>

<p>
It is safer (and better for the user) to make a snapshot instead. For
example, <c>gentoo-syntax</c> snapshots could be made using:
</p>

<pre>
$ svn export svn://svn.berlios.de/svnroot/repos/gentoo-syntax -r HEAD gentoo-syntax
</pre>
</body>
</section>

<section>
<title>Using Subversion Sources</title>
<body>

<p>
To use a Subversion source, <c>subversion.eclass</c> must be
inherited, and then at least <c>ESVN_REPO_URI</c> must be set. The
following variables are also noteworthy:
</p>

<table>
  <tr>
    <th>Variable</th>
    <th>Purpose</th>
    <th>Example</th>
  </tr>
  <tr>
    <ti><c>ESVN_REPO_URI</c></ti>
    <ti>Server and path (http, https, svn)</ti>
    <ti><c>"svn://svn.example.com/foobar/trunk"</c></ti>
  </tr>
  <tr>
    <ti><c>ESVN_STORE_DIR</c></ti>
    <ti>Unpack location</ti>
    <ti><c>ESVN_STORE_DIR="${DISTDIR}/svn-src"</c></ti>
  </tr>
  <tr>
    <ti><c>ESVN_PROJECT</c></ti>
    <ti>Project name of ebuild</ti>
    <ti><c>ESVN_PROJECT="${PN/-svn}"</c></ti>
  </tr>
  <tr>
    <ti><c>ESVN_BOOTSTRAP</c></ti>
    <ti>Bootstrap command or script</ti>
    <ti><c>ESVN_BOOTSTRAP="autogen.sh"</c></ti>
  </tr>
  <tr>
    <ti><c>ESVN_PATCHES</c></ti>
    <ti>Patches to apply during bootstrap</ti>
    <ti><c>ESVN_PATCHES="${FILESDIR}/*.patch"</c></ti>
  </tr>
</table>

<p>
See the eclass itself and `subversion.eclass Reference`_ for the full
range of options. To perform the actual checkout, use
the <c>subversion_src_unpack</c> function, which calls
both <c>subversion_svn_fetch</c> and <c>subversion_bootstrap</c>
itself.
</p>

<p>
Here is a simple example, based upon the Subversion options in
<c>litu-svn-20040902.ebuild</c>; this approach is sufficient for most
Subversion ebuilds:
</p>

<codesample lang="ebuild">
inherit subversion

ESVN_REPO_URI="http://tao.uab.es/ion/svn/libtu/trunk"
ESVN_PROJECT="libtu-snapshot"
</codesample>

</body>
</section>

</chapter>
</guide>