blob: 87293ad709fe3520ca0eb1b1f8de5f39b778d006 (
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
|
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/vcs-snapshot.eclass,v 1.3 2012/06/07 21:51:48 mgorny Exp $
# @ECLASS: vcs-snapshot.eclass
# @MAINTAINER:
# mgorny@gentoo.org
# @BLURB: support eclass for VCS (github, bitbucket, gitweb) snapshots
# @DESCRIPTION:
# This eclass provides a convenience src_unpack() which does support
# working with snapshots generated by various VCS-es. It unpacks those
# to ${WORKDIR}/${P} rather than the original directory containing
# the commit id.
#
# Note that this eclass handles only unpacking. You need to specify
# SRC_URI yourself, and call any autoreconfiguration as necessary.
# The example does that using autotools-utils eclass.
#
# Right now, the eclass was tested with github, bitbucket and gitweb
# snapshots. Feel free to report snapshotting services which aren't
# working.
# @EXAMPLE:
#
# @CODE
# EAPI=4
# AUTOTOOLS_AUTORECONF=1
# inherit autotools-utils vcs-snapshot
#
# SRC_URI="http://github.com/example/${PN}/tarball/v${PV} -> ${P}.tar.gz"
# @CODE
case ${EAPI:-0} in
0|1) die "EAPI ${EAPI} unsupported.";; # default(), SRC_URI arrows
2|3|4) ;;
*) die "vcs-snapshot.eclass API in EAPI ${EAPI} not yet established."
esac
EXPORT_FUNCTIONS src_unpack
vcs-snapshot_src_unpack() {
default
# github, bitbucket: username-projectname-hash
# gitweb: projectname-tagname-hash
mv *-*-[0-9a-f]*[0-9a-f]/ "${WORKDIR}"/${P} || die
}
|