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

Contents of /eclass/vcs-snapshot.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Thu Jun 7 21:51:48 2012 UTC (2 years, 2 months ago) by mgorny
Branch: MAIN
Changes since 1.2: +4 -3 lines
Extract to ${WORKDIR}/${P} rather than ${S}.

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

  ViewVC Help
Powered by ViewVC 1.1.20