Michal Hrusecky - 11:18 21.02.12 wrote:
> Hi,
> 
> any objections against following patch? I guess I'm the only one using
> this eclass anyway. So what the patch does. In gentoo we have build
> renamed to avoid clashes and moved to the different directory. More and
> more services are using parts of the build, so instead of patching all
> services, I think it would be better to do it in eclass.

During last checks before commiting I found an error I overlooked
previously due to some changes elsewhere, so here is the latest patch I
want to commit (also incorporates the feedback I received).

-- 
        Michal Hrusecky <mi...@gentoo.org>
? obs-service.eclass.patch
Index: obs-service.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/obs-service.eclass,v
retrieving revision 1.1
diff -u -B -r1.1 obs-service.eclass
--- obs-service.eclass  16 Sep 2011 15:49:19 -0000      1.1
+++ obs-service.eclass  24 Feb 2012 10:19:00 -0000
@@ -65,13 +65,25 @@
        SRC_URI+=" ${OBS_URI}/${i}"
 done
 
-S="${WORKDIR}"
-
-# @FUNCTION: obs-service_src_configure
+# @FUNCTION: obs-service_src_unpack
 # @DESCRIPTION:
 # Does nothing. Files are not compressed.
 obs-service_src_unpack() {
        debug-print-function ${FUNCNAME} "$@"
+       cd "${DISTDIR}"
+       mkdir -p "${S}"
+       cp ${A} "${S}"
+}
+
+# @FUNCTION: obs-service_src_prepare
+# @DESCRIPTION:
+# Replaces all /usr/lib/build directories with /usr/share/suse-build to reflect
+# where suse-build is installed in Gentoo.
+obs-service_src_prepare() {
+       debug-print-function ${FUNCNAME} "$@"
+       debug-print "Replacing all paths to find suse-build in Gentoo"
+       find "${S}" -type f -exec \
+               sed -i 's|/usr/lib/build|/usr/share/suse-build|g' {} +
 }
 
 # @FUNCTION: obs-service_src_install
@@ -81,17 +93,17 @@
        debug-print-function ${FUNCNAME} "$@"
        debug-print "Installing service \"${OBS_SERVICE_NAME}\""
        exeinto /usr/lib/obs/service
-       doexe "${DISTDIR}"/${OBS_SERVICE_NAME}
+       doexe "${S}"/${OBS_SERVICE_NAME}
        insinto /usr/lib/obs/service
-       doins "${DISTDIR}"/${OBS_SERVICE_NAME}.service
+       doins "${S}"/${OBS_SERVICE_NAME}.service
        if [[ -n ${ADDITIONAL_FILES} ]]; then
                debug-print "Installing following additional files:"
                debug-print "   ${ADDITIONAL_FILES}"
                exeinto /usr/lib/obs/service/${OBS_SERVICE_NAME}.files
                for i in ${ADDITIONAL_FILES}; do
-                       doexe "${DISTDIR}"/${i}
+                       doexe "${S}"/${i}
                done
        fi
 }
 
-EXPORT_FUNCTIONS src_install src_unpack
+EXPORT_FUNCTIONS src_install src_prepare src_unpack

Attachment: signature.asc
Description: Digital signature

Reply via email to