app-admin/lastpass-cli: serve man from devspace #654846
[gentoo.git] / eclass / obs-download.eclass
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: obs-download.eclass
5 # @MAINTAINER:
6 # maintainer-needed@gentoo.org
7 # @BLURB: Simplifies downloading from openSUSE Build Service.
8 # @DESCRIPTION:
9 # This eclass constructs OBS_URI based on provided project in openSUSE Build
10 # Service and package name. It can be used by packages/eclasses to download
11 # actual files.
12 #
13 # All you need to do in order to use it is set OBS_PROJECT and OBS_PACKAGE and
14 # inherit this eclass. It will provide OBS_URI in return which you will prepend
15 # to your files and use it in SRC_URI. Alternatively you can just set
16 # OPENSUSE_RELEASE and OBS_PACKAGE and it will give you back OBS_URI for
17 # downloading files from obs project corresponding to the specified openSUSE
18 # release.
19
20 # @ECLASS-VARIABLE: OPENSUSE_RELEASE
21 # @DEFAULT_UNSET
22 # @DESCRIPTION:
23 # From which openSUSE realease to take files.
24 # Eg.: 12.1, 12.2, Factory
25
26 # @ECLASS-VARIABLE: OBS_PROJECT
27 # @DEFAULT_UNSET
28 # @DESCRIPTION:
29 # In which obs project pakage is.
30 # This variable does not have to be set and is overridden, if
31 # OPENSUSE_RELEASE is provided.
32
33 # @ECLASS-VARIABLE: OBS_PACKAGE
34 # @DESCRIPTION:
35 # Name of the package we want to take files from.
36 # By default taken from ${PN}.
37
38 [[ -z ${OPENSUSE_RELEASE} ]] || OBS_PROJECT="openSUSE:${OPENSUSE_RELEASE}"
39 [[ -n ${OBS_PROJECT} ]]      || die "OBS_PROJECT not set!"
40 [[ -n ${OBS_PACKAGE} ]]      || OBS_PACKAGE="${PN}"
41
42 OBS_URI="https://api.opensuse.org/public/source/${OBS_PROJECT}/${OBS_PACKAGE}"