/[gentoo-x86]/eclass/obs-service.eclass
Gentoo

Contents of /eclass/obs-service.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Sep 16 15:49:19 2011 UTC (2 years, 9 months ago) by miska
Branch: MAIN
Two new eclasses to help with obs.

1 miska 1.1 # Copyright 1999-2011 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
4    
5     # @ECLASS: obs-service.eclass
6     # @MAINTAINER:
7     # miska@gentoo.org
8     # @BLURB: Reduces code duplication in the Open Build Service services.
9     # @DESCRIPTION:
10     # This eclass makes it easier to package Open Build Service services. Based on
11     # provided information it will set all needed variables and takes care of
12     # installation.
13     #
14     # @EXAMPLE:
15     # Typical ebuild using obs-service.eclass:
16     #
17     # @CODE
18     # EAPI=4
19     #
20     # inherit obs-service
21     #
22     # KEYWORDS=""
23     #
24     # DEPEND=""
25     # RDEPEND="${DEPEND}"
26     #
27     # @CODE
28    
29     # @ECLASS-VARIABLE: OBS_SERVICE_NAME
30     # @DESCRIPTION:
31     # Name of the service. If not set, it is taken from ${PN}.
32    
33     # @ECLASS-VARIABLE: OPENSUSE_RELEASE
34     # @DESCRIPTION:
35     # From which stable openSUSE realease to take a package.
36    
37     # @ECLASS-VARIABLE: ADDITIONAL_FILES
38     # @DEFAULT_UNSET
39     # @DESCRIPTION:
40     # If any additional files are needed.
41    
42     case "${EAPI:-0}" in
43     4) : ;;
44     *) die "EAPI=${EAPI} is not supported" ;;
45     esac
46    
47     HOMEPAGE="http://en.opensuse.org/openSUSE:OSC"
48     LICENSE="GPL-2"
49     SLOT="0"
50     IUSE=""
51     RDEPEND="dev-util/osc"
52    
53     [[ -n ${OBS_SERVICE_NAME} ]] || OBS_SERVICE_NAME=${PN/obs-service-/}
54     [[ -n ${OPENSUSE_RELEASE} ]] || OBS_PROJECT="openSUSE:Tools"
55    
56     DESCRIPTION="Open Build Service client module - ${OBS_SERVICE_NAME} service"
57     OBS_PACKAGE="obs-service-${OBS_SERVICE_NAME}"
58    
59     inherit obs-download
60    
61     SRC_URI="${OBS_URI}/${OBS_SERVICE_NAME}"
62     SRC_URI+=" ${OBS_URI}/${OBS_SERVICE_NAME}.service"
63    
64     for i in ${ADDITIONAL_FILES}; do
65     SRC_URI+=" ${OBS_URI}/${i}"
66     done
67    
68     S="${WORKDIR}"
69    
70     # @FUNCTION: obs-service_src_configure
71     # @DESCRIPTION:
72     # Does nothing. Files are not compressed.
73     obs-service_src_unpack() {
74     debug-print-function ${FUNCNAME} "$@"
75     }
76    
77     # @FUNCTION: obs-service_src_install
78     # @DESCRIPTION:
79     # Does the installation of the downloaded files.
80     obs-service_src_install() {
81     debug-print-function ${FUNCNAME} "$@"
82     debug-print "Installing service \"${OBS_SERVICE_NAME}\""
83     exeinto /usr/lib/obs/service
84     doexe "${DISTDIR}"/${OBS_SERVICE_NAME}
85     insinto /usr/lib/obs/service
86     doins "${DISTDIR}"/${OBS_SERVICE_NAME}.service
87     if [[ -n ${ADDITIONAL_FILES} ]]; then
88     debug-print "Installing following additional files:"
89     debug-print " ${ADDITIONAL_FILES}"
90     exeinto /usr/lib/obs/service/${OBS_SERVICE_NAME}.files
91     for i in ${ADDITIONAL_FILES}; do
92     doexe "${DISTDIR}"/${i}
93     done
94     fi
95     }
96    
97     EXPORT_FUNCTIONS src_install src_unpack

  ViewVC Help
Powered by ViewVC 1.1.20