/[gentoo-x86]/eclass/subversion.eclass
Gentoo

Contents of /eclass/subversion.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Jan 25 12:27:18 2004 UTC (10 years, 10 months ago) by hattya
Branch: MAIN
Initial import

1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 ## --------------------------------------------------------------------------- #
6 # Author: Akinori Hattori <hattya@gentoo.org>
7 #
8 # The subversion eclass is written to fetch the software sources from
9 # subversion repositories like the cvs eclass.
10 #
11 #
12 # Description:
13 # If you use this eclass, the ${S} is ${WORKDIR}/${P}.
14 # It is necessary to define the ESVN_REPOURI variable at least.
15 #
16 ## --------------------------------------------------------------------------- #
17
18
19 ECLASS="subversion"
20 INHERITED="${INHERITED} ${ECLASS}"
21
22 EXPORT_FUNCTIONS src_unpack
23
24 HOMEPAGE="http://subversion.tigris.org/"
25
26
27 ## -- add subversion in DEPEND
28 #
29 newdepend "dev-util/subversion"
30
31
32 ## -- ESVN_STORE_DIR: subversion sources store directory
33 #
34 ESVN_STORE_DIR="${DISTDIR}/svn-src"
35
36
37 ## -- ESVN_FETCH_CMD: subversion fetch command
38 #
39 # default: svn checkout
40 #
41 [ -z "${ESVN_FETCH_CMD}" ] && ESVN_FETCH_CMD="svn checkout"
42
43 ## -- ESVN_UPDATE_CMD: subversion update command
44 #
45 # default: svn update
46 #
47 [ -z "${ESVN_UPDATE_CMD}" ] && ESVN_UPDATE_CMD="svn update"
48
49
50 ## -- ESVN_REPO_URI: repository uri
51 #
52 # e.g. http://foo/trunk, svn://bar/trunk
53 # but currentry support http only.
54 #
55 [ -z "${ESVN_REPO_URI}" ] && ESVN_REPO_URI=""
56
57
58 ## -- ESVN_PROJECT: project name of your ebuild
59 #
60 # subversion eclass will check out the subversion repository like:
61 #
62 # ${ESVN_STORE_DIR}/${ESVN_PROJECT}/${ESVN_REPO_URI##*/}
63 #
64 # so if you define ESVN_REPO_URI as http://svn.collab.net/repo/svn/trunk or
65 # http://svn.collab.net/repo/svn/trunk/. and PN is subversion-svn.
66 # it will check out like:
67 #
68 # ${ESVN_STORE_DIR}/subversion/trunk
69 #
70 # default: ${PN/-svn}.
71 #
72 [ -z "${ESVN_PROJECT}" ] && ESVN_PROJECT="${PN/-svn}"
73
74
75 ## -- ESVN_BOOTSTRAP:
76 #
77 # bootstrap script. like autogen.sh or etc..
78 #
79 [ -z "${ESVN_BOOTSTRAP}" ] && ESVN_BOOTSTRAP=""
80
81
82 ## -- subversion_svn_fetch() ------------------------------------------------- #
83
84 subversion_svn_fetch() {
85
86 # http only...
87 if [ "${ESVN_REPO_URI%%:*}" != "http" ]; then
88 if [ -z "${ESVN_REPO_URI}" ]; then
89 die "subversion.eclass: ESVN_REPO_URI is not empty."
90
91 elif [ "${ESVN_REPO_URI}" = "none" ]; then
92 die "subversion.eclass: ESVN_REPO_URI is not define."
93
94 else
95 die "subversion.eclass: fetch from "${ESVN_REPO_URI%:*}" is not yet implemented."
96
97 fi
98 fi
99
100 if [ ! -d "${ESVN_STORE_DIR}" ]; then
101 mkdir -p "${ESVN_STORE_DIR}"
102 einfo "created store directory: ${ESVN_STORE_DIR}"
103 einfo
104 fi
105
106 cd "${ESVN_STORE_DIR}"
107 addwrite "/etc/subversion"
108 einfo
109
110 if [ -z ${ESVN_REPO_URI##*/} ]; then
111 ESVN_REPO_FIX="${ESVN_REPO_FIX%/}"
112 fi
113
114 ESVN_CO_DIR="${ESVN_PROJECT}/${ESVN_REPO_URI##*/}"
115
116 if [ ! -d "${ESVN_CO_DIR}/.svn" ]; then
117 # first check out
118 einfo "subversion check out start -->"
119 einfo
120 einfo "check out from: ${ESVN_REPO_URI}"
121
122 mkdir -p "${ESVN_PROJECT}"
123 cd "${ESVN_PROJECT}"
124
125 #${ESVN_FETCH_CMD} "${ESVN_REPO_URI}"
126 einfo " stored in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}"
127
128 else
129 # update working copy
130 einfo "subversion update start -->"
131 einfo
132 einfo " update from: ${ESVN_REPO_URI}"
133
134 cd "${ESVN_CO_DIR}"
135 #${ESVN_UPDATE_CMD}
136 einfo " updated in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}"
137 fi
138
139 # copy to the ${WORKDIR}
140 cp -Rf "${ESVN_STORE_DIR}/${ESVN_CO_DIR}" "${WORKDIR}/${P}"
141 einfo
142
143 }
144
145
146 ## -- subversion_bootstrap() ------------------------------------------------ #
147
148 subversion_bootstrap() {
149
150 if [ -n "${ESVN_BOOTSTRAP}" ]; then
151 cd "${WORKDIR}/${P}"
152
153 if [ -x "${ESVN_BOOTSTRAP}" ]; then
154 ./${ESVN_BOOTSTRAP}
155 fi
156
157 fi
158
159 }
160
161
162 ## -- subversion_src_unpack() ------------------------------------------------ #
163
164 subversion_src_unpack() {
165
166 subversion_svn_fetch
167 subversion_bootstrap
168
169 }

  ViewVC Help
Powered by ViewVC 1.1.20