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

Contents of /eclass/obs-service.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Tue Oct 2 10:52:31 2012 UTC (21 months, 3 weeks ago) by scarabeus
Branch: MAIN
Changes since 1.4: +2 -7 lines
Always use openSUSE:Tools as project to get updates. Remove obs_package declaration as it is equal to pn.

1 miska 1.2 # Copyright 1999-2012 Gentoo Foundation
2 miska 1.1 # Distributed under the terms of the GNU General Public License v2
3 scarabeus 1.5 # $Header: /var/cvsroot/gentoo-x86/eclass/obs-service.eclass,v 1.4 2012/09/27 16:35:41 axs Exp $
4 miska 1.1
5     # @ECLASS: obs-service.eclass
6     # @MAINTAINER:
7 scarabeus 1.3 # suse@gentoo.org
8 miska 1.1 # @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: ADDITIONAL_FILES
34     # @DEFAULT_UNSET
35     # @DESCRIPTION:
36     # If any additional files are needed.
37    
38     case "${EAPI:-0}" in
39 axs 1.4 4|5) : ;;
40 miska 1.1 *) die "EAPI=${EAPI} is not supported" ;;
41     esac
42    
43     HOMEPAGE="http://en.opensuse.org/openSUSE:OSC"
44     LICENSE="GPL-2"
45     SLOT="0"
46     IUSE=""
47     RDEPEND="dev-util/osc"
48    
49     [[ -n ${OBS_SERVICE_NAME} ]] || OBS_SERVICE_NAME=${PN/obs-service-/}
50 scarabeus 1.5 OBS_PROJECT="openSUSE:Tools"
51 miska 1.1
52     DESCRIPTION="Open Build Service client module - ${OBS_SERVICE_NAME} service"
53    
54     inherit obs-download
55    
56     SRC_URI="${OBS_URI}/${OBS_SERVICE_NAME}"
57     SRC_URI+=" ${OBS_URI}/${OBS_SERVICE_NAME}.service"
58    
59     for i in ${ADDITIONAL_FILES}; do
60     SRC_URI+=" ${OBS_URI}/${i}"
61     done
62    
63 miska 1.2 # @FUNCTION: obs-service_src_unpack
64     # @DESCRIPTION:
65     # Just copy files. Files are not compressed.
66     obs-service_src_unpack() {
67     debug-print-function ${FUNCNAME} "$@"
68     cd "${DISTDIR}"
69     mkdir -p "${S}"
70     cp ${A} "${S}"
71     }
72 miska 1.1
73 miska 1.2 # @FUNCTION: obs-service_src_prepare
74 miska 1.1 # @DESCRIPTION:
75 miska 1.2 # Replaces all /usr/lib/build directories with /usr/share/suse-build to reflect
76     # where suse-build is installed in Gentoo.
77     obs-service_src_prepare() {
78 miska 1.1 debug-print-function ${FUNCNAME} "$@"
79 miska 1.2 debug-print "Replacing all paths to find suse-build in Gentoo"
80     find "${S}" -type f -exec \
81     sed -i 's|/usr/lib/build|/usr/share/suse-build|g' {} +
82 miska 1.1 }
83    
84     # @FUNCTION: obs-service_src_install
85     # @DESCRIPTION:
86     # Does the installation of the downloaded files.
87     obs-service_src_install() {
88     debug-print-function ${FUNCNAME} "$@"
89     debug-print "Installing service \"${OBS_SERVICE_NAME}\""
90     exeinto /usr/lib/obs/service
91 miska 1.2 doexe "${S}"/${OBS_SERVICE_NAME}
92 miska 1.1 insinto /usr/lib/obs/service
93 miska 1.2 doins "${S}"/${OBS_SERVICE_NAME}.service
94 miska 1.1 if [[ -n ${ADDITIONAL_FILES} ]]; then
95     debug-print "Installing following additional files:"
96     debug-print " ${ADDITIONAL_FILES}"
97     exeinto /usr/lib/obs/service/${OBS_SERVICE_NAME}.files
98     for i in ${ADDITIONAL_FILES}; do
99 miska 1.2 doexe "${S}"/${i}
100 miska 1.1 done
101     fi
102     }
103    
104 miska 1.2 EXPORT_FUNCTIONS src_install src_prepare src_unpack

  ViewVC Help
Powered by ViewVC 1.1.20