/[gentoo-x86]/eclass/vcs-snapshot.eclass
Gentoo

Contents of /eclass/vcs-snapshot.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Mar 19 08:52:49 2012 UTC (2 years, 5 months ago) by mgorny
Branch: MAIN
Changes since 1.1: +2 -2 lines
Fix old eclass name in die-message.

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/vcs-snapshot.eclass,v 1.1 2012/03/19 08:38:45 mgorny Exp $
4
5 # @ECLASS: vcs-snapshot.eclass
6 # @MAINTAINER:
7 # mgorny@gentoo.org
8 # @BLURB: support eclass for VCS (github, bitbucket, gitweb) snapshots
9 # @DESCRIPTION:
10 # This eclass provides a convenience src_unpack() which does support
11 # working with snapshots generated by various VCS-es. It unpacks those
12 # to ${S} rather than the original directory containing commit id.
13 #
14 # Note that this eclass handles only unpacking. You need to specify
15 # SRC_URI yourself, and call any autoreconfiguration as necessary.
16 # The example does that using autotools-utils eclass.
17 #
18 # Right now, the eclass was tested with github, bitbucket and gitweb
19 # snapshots. Feel free to report snapshotting services which aren't
20 # working.
21 # @EXAMPLE:
22 #
23 # @CODE
24 # EAPI=4
25 # AUTOTOOLS_AUTORECONF=1
26 # inherit autotools-utils vcs-snapshot
27 #
28 # SRC_URI="http://github.com/example/${PN}/tarball/v${PV} -> ${P}.tar.gz"
29 # @CODE
30
31 case ${EAPI:-0} in
32 0|1) die "EAPI ${EAPI} unsupported.";; # default(), SRC_URI arrows
33 2|3|4) ;;
34 *) die "vcs-snapshot.eclass API in EAPI ${EAPI} not yet established."
35 esac
36
37 EXPORT_FUNCTIONS src_unpack
38
39 vcs-snapshot_src_unpack() {
40 default
41
42 # github, bitbucket: username-projectname-hash
43 # gitweb: projectname-tagname-hash
44 mv *-*-[0-9a-f]*[0-9a-f]/ "${S}" || die
45 }

  ViewVC Help
Powered by ViewVC 1.1.20