1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: obs-download.eclass
8 # @BLURB: Simplifies downloading from openSUSE Build Service.
10 # This eclass constructs OBS_URI based on provided project in openSUSE Build
11 # Service and package name. It can be used by packages/eclasses to download
14 # All you need to do in order to use it is set OBS_PROJECT and OBS_PACKAGE and
15 # inherit this eclass. It will provide OBS_URI in return which you will prepend
16 # to your files and use it in SRC_URI. Alternatively you can just set
17 # OPENSUSE_RELEASE and OBS_PACKAGE and it will give you back OBS_URI for
18 # downloading files from obs project corresponding to the specified openSUSE
21 # @ECLASS-VARIABLE: OPENSUSE_RELEASE
24 # From which openSUSE realease to take files.
25 # Eg.: 12.1, 12.2, Factory
27 # @ECLASS-VARIABLE: OBS_PROJECT
30 # In which obs project pakage is.
31 # This variable does not have to be set and is overriden, if
32 # OPENSUSE_RELEASE is provided.
34 # @ECLASS-VARIABLE: OBS_PACKAGE
36 # Name of the package we want to take files from.
37 # By default taken from ${PN}.
39 [[ -z ${OPENSUSE_RELEASE} ]] || OBS_PROJECT="openSUSE:${OPENSUSE_RELEASE}"
40 [[ -n ${OBS_PROJECT} ]] || die "OBS_PROJECT not set!"
41 [[ -n ${OBS_PACKAGE} ]] || OBS_PACKAGE="${PN}"
43 OBS_URI="https://api.opensuse.org/public/source/${OBS_PROJECT}/${OBS_PACKAGE}"