From 0faff8720150863ff38132f87ef65721fcb86dc1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 24 Mar 2009 14:01:30 -0700 Subject: distutils-base.bbclass: Move common functionality to distutils-common-base.bbclass Create a new class distutils-common-base.bbclass which holds the common parts that can be used in native and target packages which need to use distutils funtionality. rpm, libxml2, zope are currently using them and needed to use distutils-native-base for native recipes. rpm and libxml need to defer the processing of certain configure parameters which we evaluate using python. So we need to have python-native built before we can process them. Hence we can not use EXTRA_OECONF which is a python variable and gets expanded during parsing recipes and ofcourse we have not yet built python-native. We pass these extra options as a separate shell variable to do_configure which we evaluate when that task is executing. --- recipes/rpm/rpm-4.4.2.3.inc | 96 ++++++++++++++++++++++++++++++++++++ recipes/rpm/rpm-native_4.4.2.3.bb | 5 +- recipes/rpm/rpm_4.4.2.3.bb | 100 ++------------------------------------ 3 files changed, 102 insertions(+), 99 deletions(-) create mode 100644 recipes/rpm/rpm-4.4.2.3.inc (limited to 'recipes/rpm') diff --git a/recipes/rpm/rpm-4.4.2.3.inc b/recipes/rpm/rpm-4.4.2.3.inc new file mode 100644 index 0000000000..eef308f831 --- /dev/null +++ b/recipes/rpm/rpm-4.4.2.3.inc @@ -0,0 +1,96 @@ +DESCRIPTION = "The RPM Package Manager." +HOMEPAGE = "http://rpm.org/" +LICENSE = "LGPL GPL" +PR = "r15" + +SRC_URI = "http://www.rpm.org/releases/rpm-4.4.x/rpm-4.4.2.3.tar.gz \ + file://external-tools.patch;patch=1 \ + file://cross_libpaths.patch;patch=1 \ + file://rpmconfigdir.patch;patch=1 \ + file://weakdeps.patch;patch=1;pnum=0 \ + file://tagsbackport.patch;patch=1;pnum=0 \ + file://missingok.patch;patch=1;pnum=0 \ + file://extcond.patch;patch=1;pnum=0" + +inherit autotools + +S = "${WORKDIR}/rpm-${PV}" + +ARM_INSTRUCTION_SET = "arm" + +acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java" + +PACKAGES += "python-rpm" +FILES_python-rpm = "${libdir}/python*/site-packages/rpm/_*" + +# Handle the db MUTEX settings here, the POSIX library is +# the default - "POSIX/pthreads/library". +# Don't ignore the nice SWP instruction on the ARM: +# These enable the ARM assembler mutex code, this won't +# work with thumb compilation... +ARM_MUTEX = "--with-mutex=ARM/gcc-assembly" +MUTEX = "" +MUTEX_arm = "${ARM_MUTEX}" +MUTEX_armeb = "${ARM_MUTEX}" +EXTRA_OECONF += "${MUTEX}" + +export varprefix = "${localstatedir}" + +do_configure_prepend (){ + EXTRA_RPM_OECONF="--with-python \ + --with-python-incdir=${STAGING_INCDIR}/${PYTHON_DIR} \ + --with-python-libdir=${libdir}/${PYTHON_DIR} \ + --without-apidocs \ + --without-selinux \ + --without-lua \ + --without-dmalloc \ + --without-efence" +} + +do_configure () { + rm ${S}/popt/ -Rf + rm ${S}/db/dist/configure.in -f + cd ${S}/db/dist/aclocal + rm libtool* -f + for i in `ls *.ac`; do + j=`echo $i | sed 's/.ac/.m4/g'` + mv $i $j + done + cd ${S}/db/dist/aclocal_java + for i in `ls *.ac`; do + j=`echo $i | sed 's/.ac/.m4/g'` + mv $i $j + done + cd ${S} + autotools_do_configure ${EXTRA_RPM_OECONF} + cd ${S}/db/dist + . ./RELEASE + # Edit version information we couldn't pre-compute. + sed -i -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" configure + sed -i -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" configure + sed -i -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" configure + sed -i -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" configure + sed -i -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" configure + sed -i -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure + cd ${S}/db3 + ${S}/db3/configure \ + --build=${BUILD_SYS} \ + --host=${HOST_SYS} \ + --target=${TARGET_SYS} \ + --prefix=${prefix} \ + --exec_prefix=${exec_prefix} \ + --bindir=${bindir} \ + --sbindir=${sbindir} \ + --libexecdir=${libexecdir} \ + --datadir=${datadir} \ + --sysconfdir=${sysconfdir} \ + --sharedstatedir=${sharedstatedir} \ + --localstatedir=${localstatedir} \ + --libdir=${libdir} \ + --includedir=${includedir} \ + --oldincludedir=${oldincludedir} \ + --infodir=${infodir} \ + --mandir=${mandir} \ + ${EXTRA_RPM_OECONF} \ + --with-pic +} diff --git a/recipes/rpm/rpm-native_4.4.2.3.bb b/recipes/rpm/rpm-native_4.4.2.3.bb index 935d07723f..287383c8c9 100644 --- a/recipes/rpm/rpm-native_4.4.2.3.bb +++ b/recipes/rpm/rpm-native_4.4.2.3.bb @@ -1,5 +1,6 @@ -require rpm_${PV}.bb -inherit native +inherit native distutils-native-base + +require rpm-${PV}.inc DEPENDS = "beecrypt-native gettext-native zlib-native file-native popt-native python-native" diff --git a/recipes/rpm/rpm_4.4.2.3.bb b/recipes/rpm/rpm_4.4.2.3.bb index 6bdd0edcee..3e673781fa 100644 --- a/recipes/rpm/rpm_4.4.2.3.bb +++ b/recipes/rpm/rpm_4.4.2.3.bb @@ -1,98 +1,4 @@ -DESCRIPTION = "The RPM Package Manager." -HOMEPAGE = "http://rpm.org/" -LICENSE = "LGPL GPL" -DEPENDS = "zlib beecrypt file popt python sed-native" -PR = "r14" - -SRC_URI = "http://www.rpm.org/releases/rpm-4.4.x/rpm-4.4.2.3.tar.gz \ - file://external-tools.patch;patch=1 \ - file://cross_libpaths.patch;patch=1 \ - file://rpmconfigdir.patch;patch=1 \ - file://weakdeps.patch;patch=1;pnum=0 \ - file://tagsbackport.patch;patch=1;pnum=0 \ - file://missingok.patch;patch=1;pnum=0 \ - file://extcond.patch;patch=1;pnum=0" - -inherit autotools gettext distutils-base - -S = "${WORKDIR}/rpm-${PV}" - -ARM_INSTRUCTION_SET = "arm" - -acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java" +inherit distutils-base gettext -PACKAGES += "python-rpm" -FILES_python-rpm = "${libdir}/python*/site-packages/rpm/_*" - -# Handle the db MUTEX settings here, the POSIX library is -# the default - "POSIX/pthreads/library". -# Don't ignore the nice SWP instruction on the ARM: -# These enable the ARM assembler mutex code, this won't -# work with thumb compilation... -ARM_MUTEX = "--with-mutex=ARM/gcc-assembly" -MUTEX = "" -MUTEX_arm = "${ARM_MUTEX}" -MUTEX_armeb = "${ARM_MUTEX}" -EXTRA_OECONF += "${MUTEX}" - -export varprefix = "${localstatedir}" - -do_configure_prepend (){ - EXTRA_OECONF = "--with-python \ - --with-python-incdir=${STAGING_INCDIR}/${PYTHON_DIR} \ - --with-python-libdir=${libdir}/${PYTHON_DIR} \ - --without-apidocs \ - --without-selinux \ - --without-lua \ - --without-dmalloc \ - --without-efence" -} - -do_configure () { - rm ${S}/popt/ -Rf - rm ${S}/db/dist/configure.in -f - cd ${S}/db/dist/aclocal - rm libtool* -f - for i in `ls *.ac`; do - j=`echo $i | sed 's/.ac/.m4/g'` - mv $i $j - done - cd ${S}/db/dist/aclocal_java - for i in `ls *.ac`; do - j=`echo $i | sed 's/.ac/.m4/g'` - mv $i $j - done - cd ${S} - autotools_do_configure - cd ${S}/db/dist - . ./RELEASE - # Edit version information we couldn't pre-compute. - sed -i -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" configure - sed -i -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" configure - sed -i -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" configure - sed -i -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" configure - sed -i -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" configure - sed -i -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure - cd ${S}/db3 - ${S}/db3/configure \ - --build=${BUILD_SYS} \ - --host=${HOST_SYS} \ - --target=${TARGET_SYS} \ - --prefix=${prefix} \ - --exec_prefix=${exec_prefix} \ - --bindir=${bindir} \ - --sbindir=${sbindir} \ - --libexecdir=${libexecdir} \ - --datadir=${datadir} \ - --sysconfdir=${sysconfdir} \ - --sharedstatedir=${sharedstatedir} \ - --localstatedir=${localstatedir} \ - --libdir=${libdir} \ - --includedir=${includedir} \ - --oldincludedir=${oldincludedir} \ - --infodir=${infodir} \ - --mandir=${mandir} \ - ${EXTRA_OECONF} \ - --with-pic - -} +DEPENDS = "zlib beecrypt file popt python sed-native" +require ${PN}-${PV}.inc -- cgit v1.2.3