From 85bb816de7181e3d55a45c01e16b6cbc8a47a886 Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Tue, 11 Jun 2013 17:23:06 +0200 Subject: [PATCH] - add rpm. --- .../packagegroup-tizen-commonwayland-core.bb | 4 +- .../recipes-tizen/libxml2/libxml2-extraconf.inc | 3 + .../recipes-tizen/nss/nss-native-extraconf.inc | 6 ++ meta-tizen-ivi/recipes-tizen/rpm/rpm-extraconf.inc | 120 +++++++++++++++++++++ .../recipes-tizen/rpm/rpm/Makefile.am.patch | 16 +++ .../recipes-tizen/rpm/rpm/db3_configure.patch | 27 +++++ .../recipes-tizen/rpm/rpm/db_Makefile.in.patch | 13 +++ .../recipes-tizen/rpm/rpm/db_configure.ac.patch | 13 +++ .../recipes-tizen/rpm/rpm/rpm.spec.patch | 103 ++++++++++++++++++ 9 files changed, 303 insertions(+), 2 deletions(-) create mode 100644 meta-tizen-ivi/recipes-tizen/rpm/rpm/Makefile.am.patch create mode 100644 meta-tizen-ivi/recipes-tizen/rpm/rpm/db3_configure.patch create mode 100644 meta-tizen-ivi/recipes-tizen/rpm/rpm/db_Makefile.in.patch create mode 100644 meta-tizen-ivi/recipes-tizen/rpm/rpm/db_configure.ac.patch create mode 100644 meta-tizen-ivi/recipes-tizen/rpm/rpm/rpm.spec.patch diff --git a/meta-tizen-ivi/recipes-packagegroups/packagegroups/packagegroup-tizen-commonwayland-core.bb b/meta-tizen-ivi/recipes-packagegroups/packagegroups/packagegroup-tizen-commonwayland-core.bb index 89ce9d7..07acbac 100644 --- a/meta-tizen-ivi/recipes-packagegroups/packagegroups/packagegroup-tizen-commonwayland-core.bb +++ b/meta-tizen-ivi/recipes-packagegroups/packagegroups/packagegroup-tizen-commonwayland-core.bb @@ -207,9 +207,9 @@ RDEPENDS_${PN} += "psmisc" RDEPENDS_${PN} += "readline" -#RDEPENDS_${PN} += "rpm" +RDEPENDS_${PN} += "rpm" #RDEPENDS_${PN} += "rpm-installer" -#RDEPENDS_${PN} += "rpm-libs" +RDEPENDS_${PN} += "rpm-libs" RDEPENDS_${PN} += "rfkill" diff --git a/meta-tizen-ivi/recipes-tizen/libxml2/libxml2-extraconf.inc b/meta-tizen-ivi/recipes-tizen/libxml2/libxml2-extraconf.inc index 75d2f2d..f8de27e 100644 --- a/meta-tizen-ivi/recipes-tizen/libxml2/libxml2-extraconf.inc +++ b/meta-tizen-ivi/recipes-tizen/libxml2/libxml2-extraconf.inc @@ -4,6 +4,9 @@ inherit pkgconfig binconfig pythonnative EXTRA_OECONF += "--with-python=yes" + + +export STAGING_INCDIR_NATIVE export STAGING_INCDIR export STAGING_LIBDIR diff --git a/meta-tizen-ivi/recipes-tizen/nss/nss-native-extraconf.inc b/meta-tizen-ivi/recipes-tizen/nss/nss-native-extraconf.inc index e69de29..08781e8 100644 --- a/meta-tizen-ivi/recipes-tizen/nss/nss-native-extraconf.inc +++ b/meta-tizen-ivi/recipes-tizen/nss/nss-native-extraconf.inc @@ -0,0 +1,6 @@ +#DEPENDS += "sqlite-native" +#DEPENDS += "nspr-native" + +#DEPENDS += "gawk-native" +#DEPENDS += "perl-native" +#DEPENDS += "psmisc-native" \ No newline at end of file diff --git a/meta-tizen-ivi/recipes-tizen/rpm/rpm-extraconf.inc b/meta-tizen-ivi/recipes-tizen/rpm/rpm-extraconf.inc index e69de29..dffcab0 100644 --- a/meta-tizen-ivi/recipes-tizen/rpm/rpm-extraconf.inc +++ b/meta-tizen-ivi/recipes-tizen/rpm/rpm-extraconf.inc @@ -0,0 +1,120 @@ +inherit gettext + +acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java" + +export STAGING_INCDIR_NATIVE + +SRC_URI += "file://rpm.spec.patch \ + file://db3_configure.patch \ + file://db_configure.ac.patch \ + file://db_Makefile.in.patch \ + file://Makefile.am.patch \ + " + +do_patch_append () { + echo RLM begining of do_patch + export HOST_SYS + cat ${WORKDIR}/rpm.spec.patch | patch -s -p1 --fuzz=2 + cat ${WORKDIR}/db3_configure.patch | patch -s -p1 --fuzz=2 + cat ${WORKDIR}/db_configure.ac.patch | patch -s -p1 --fuzz=2 + cat ${WORKDIR}/db_Makefile.in.patch | patch -s -p1 --fuzz=2 + cat ${WORKDIR}/Makefile.am.patch | patch -s -p1 --fuzz=2 + cp db3/configure db3/configure.ac + + autotools_do_configure_rpm + mv db3/configure.ac db3/configure + pushd "${S}/db/dist" + autotools_do_configure_rpm + popd + echo RLM end of do_patch +} + +autotools_do_configure_rpm() { + # WARNING: gross hack follows: + # An autotools built package generally needs these scripts, however only + # automake or libtoolize actually install the current versions of them. + # This is a problem in builds that do not use libtool or automake, in the case + # where we -need- the latest version of these scripts. e.g. running a build + # for a package whose autotools are old, on an x86_64 machine, which the old + # config.sub does not support. Work around this by installing them manually + # regardless. + ( for ac in `find ./ -name configure.in -o -name configure.ac`; do + rm -f `dirname $ac`/configure + done ) + if [ -e ./configure.in -o -e ./configure.ac ]; then + olddir=`pwd` + cd . + # Remove any previous copy of the m4 macros + rm -rf ${B}/aclocal-copy/ + ACLOCAL="aclocal --system-acdir=${B}/aclocal-copy/" + if [ x"${acpaths}" = xdefault ]; then + acpaths= + for i in `find . -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \ + grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do + acpaths="$acpaths -I $i" + done + else + acpaths="${acpaths}" + fi + AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"` + automake --version + echo "AUTOV is $AUTOV" + if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then + ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV" + fi + # The aclocal directory could get modified by other processes + # uninstalling data from the sysroot. See Yocto #861 for details. + # We avoid this by taking a copy here and then files cannot disappear. + # We copy native first, then target. This avoids certain races since cp-noerror + # won't overwrite existing files. + mkdir -p ${B}/aclocal-copy/ + if [ -d ${STAGING_DATADIR_NATIVE}/aclocal ]; then + cp-noerror ${STAGING_DATADIR_NATIVE}/aclocal/ ${B}/aclocal-copy/ + fi + if [ -d ${STAGING_DATADIR}/aclocal -a "${STAGING_DATADIR_NATIVE}/aclocal" != "${STAGING_DATADIR}/aclocal" ]; then + cp-noerror ${STAGING_DATADIR}/aclocal/ ${B}/aclocal-copy/ + fi + # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look + # like it was auto-generated. Work around this by blowing it away + # by hand, unless the package specifically asked not to run aclocal. + if ! echo ${EXTRA_AUTORECONF} ${TIZEN_EXTRA_AUTORECONF} | grep -q "aclocal"; then + rm -f aclocal.m4 + fi + if [ -e configure.in ]; then + CONFIGURE_AC=configure.in + else + CONFIGURE_AC=configure.ac + fi + if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then + if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then + : do nothing -- we still have an old unmodified configure.ac + else + bbnote Executing glib-gettextize --force --copy + echo "no" | glib-gettextize --force --copy + fi + else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then + # We'd call gettextize here if it wasn't so broken... + cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ + if [ -d ./po/ ]; then + cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ./po/ + if [ ! -e ./po/remove-potcdate.sin ]; then + cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ./po/ + fi + fi + for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do + for j in `find . -name $i | grep -v aclocal-copy`; do + rm $j + done + done + fi + fi + mkdir -p m4 + if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then + bbnote Executing intltoolize --copy --force --automake + intltoolize --copy --force --automake + fi + bbnote Executing ACLOCAL=\"$ACLOCAL\" autoreconf --verbose --install --force ${EXTRA_AUTORECONF} ${TIZEN_EXTRA_AUTORECONF} $acpaths + ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} ${TIZEN_EXTRA_AUTORECONF} $acpaths || bbfatal "autoreconf execution failed." + cd $olddir + fi +} \ No newline at end of file diff --git a/meta-tizen-ivi/recipes-tizen/rpm/rpm/Makefile.am.patch b/meta-tizen-ivi/recipes-tizen/rpm/rpm/Makefile.am.patch new file mode 100644 index 0000000..c20ac07 --- /dev/null +++ b/meta-tizen-ivi/recipes-tizen/rpm/rpm/Makefile.am.patch @@ -0,0 +1,16 @@ +diff --git a/Makefile.am b/Makefile.am +index 2eba936..bfe2fd7 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -226,9 +226,10 @@ install-exec-hook: + @rm -f $(DESTDIR)$(bindir)/rpmverify + @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify + ++#Need to be rewrite! installplatform use rpm (perhapse use rpm-native?) + install-data-local: + @case "@host_os@" in \ +- solaris*|linux*|darwin*) \ ++ solaris*|torewrite_linux*|darwin*) \ + DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \ + esac + @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp diff --git a/meta-tizen-ivi/recipes-tizen/rpm/rpm/db3_configure.patch b/meta-tizen-ivi/recipes-tizen/rpm/rpm/db3_configure.patch new file mode 100644 index 0000000..d7b9c0b --- /dev/null +++ b/meta-tizen-ivi/recipes-tizen/rpm/rpm/db3_configure.patch @@ -0,0 +1,27 @@ +diff --git a/db3/configure b/db3/configure +index 160b8e8..3289f0c 100755 +--- a/db3/configure ++++ b/db3/configure +@@ -8,9 +8,20 @@ db_dist="${base_path}../db/dist" + rm -f config.cache + + # XXX edit CFLAGS= ... out of invocation args ??? +-ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`" ++#ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`" ++ARGS= + +-CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \ ++for para in "$@"; ++do ++ ++if [[ "${para}" =~ ^([A-Z_]+)\=(.*)$ ]]; ++then ++echo which ${BASH_REMATCH[1]}=\"${BASH_REMATCH[2]}\ , is already in env. ++else ++ARGS="${ARGS} ${para}" ++fi ++done ++$db_dist/configure ${ARGS} \ + --enable-shared --enable-static \ + --with-uniquename=_rpmdb --srcdir=$db_dist + diff --git a/meta-tizen-ivi/recipes-tizen/rpm/rpm/db_Makefile.in.patch b/meta-tizen-ivi/recipes-tizen/rpm/rpm/db_Makefile.in.patch new file mode 100644 index 0000000..a386162 --- /dev/null +++ b/meta-tizen-ivi/recipes-tizen/rpm/rpm/db_Makefile.in.patch @@ -0,0 +1,13 @@ +diff --git a/db-4.8.30/dist/Makefile.in b/db-4.8.30/dist/Makefile.in +index c4b0739..0325c16 100644 +--- a/db-4.8.30/dist/Makefile.in ++++ b/db-4.8.30/dist/Makefile.in +@@ -2,7 +2,7 @@ + + srcdir= @srcdir@/.. + builddir=. +- ++top_builddir = @top_builddir@ + ################################################## + # Installation directories and permissions. + ################################################## diff --git a/meta-tizen-ivi/recipes-tizen/rpm/rpm/db_configure.ac.patch b/meta-tizen-ivi/recipes-tizen/rpm/rpm/db_configure.ac.patch new file mode 100644 index 0000000..fe8199c --- /dev/null +++ b/meta-tizen-ivi/recipes-tizen/rpm/rpm/db_configure.ac.patch @@ -0,0 +1,13 @@ +diff --git a/db-4.8.30/dist/configure.ac b/db-4.8.30/dist/configure.ac +index 4a99779..e6c94da 100644 +--- a/db-4.8.30/dist/configure.ac ++++ b/db-4.8.30/dist/configure.ac +@@ -328,7 +328,7 @@ SOSUFFIX_CONFIG + MODSUFFIX_CONFIG + JMODSUFFIX_CONFIG + +-LIBTOOL="./libtool" ++ + + INSTALLER="\$(LIBTOOL) --mode=install cp -p" + diff --git a/meta-tizen-ivi/recipes-tizen/rpm/rpm/rpm.spec.patch b/meta-tizen-ivi/recipes-tizen/rpm/rpm/rpm.spec.patch new file mode 100644 index 0000000..b6b2b9a --- /dev/null +++ b/meta-tizen-ivi/recipes-tizen/rpm/rpm/rpm.spec.patch @@ -0,0 +1,103 @@ +diff --git a/packaging/rpm.spec b/packaging/rpm.spec +index 2380dd3..acc226b 100644 +--- a/packaging/rpm.spec ++++ b/packaging/rpm.spec +@@ -182,21 +182,49 @@ rm -f rpmdb/db.h + #%patch90 -p1 + %patch100 -p1 + +- + rm -f m4/libtool.m4 + rm -f m4/lt*.m4 + + %build + cp %{SOURCE1001} . +-CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`" +-CFLAGS="%{optflags}" ++CPPFLAGS="$CPPFLAGS -I${STAGING_INCDIR}/nspr4 -I${STAGING_INCDIR}/nss3" ++CFLAGS="%{optflags} -DHAVE_SYSTEM_INCLUDE_FILES" + export CPPFLAGS CFLAGS LDFLAGS + + # Using configure macro has some unwanted side-effects on rpm platform + # setup, use the old-fashioned way for now only defining minimal paths. + + libtoolize -f -c +-./autogen.sh \ ++#export CPPFLAGS ++#export CFLAGS ++#export LDFLAGS ++ ++#pushd db/dist/ ++#autoreconf -i --verbose ++#popd ++ ++#autoreconf -i --verbose ++ ++#./autogen.sh \ ++#./configure \ ++pushd db/dist ++. ./RELEASE ++ ++# Edit version information we couldn't pre-compute. ++sed -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \ ++ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \ ++ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \ ++ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \ ++ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \ ++ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" configure > configure.version ++mv configure.version configure ++ ++chmod 555 configure ++ ++chmod 555 config.guess config.sub install-sh ++popd ++ ++./configure \ + --prefix=%{_prefix} \ + --sysconfdir=%{_sysconfdir} \ + --localstatedir=%{_localstatedir} \ +@@ -207,8 +235,12 @@ libtoolize -f -c + %endif + --with-lua \ + --with-cap \ +- --with-msm +- ++ --with-msm \ ++ --build=%{_build} \ ++ --host=%{_host} \ ++ --target=%{_target_platform} ++ ++ + make %{?_smp_mflags} + + %install +@@ -248,10 +280,7 @@ rm -rf %{buildroot}%{_mandir}/*/man? + %clean + rm -rf %{buildroot} + +-%if %{with check} +-%check +-make check +-%endif ++ + + %remove_docs + rm -rf %{buildroot}/usr/share/man +@@ -271,7 +300,7 @@ fi + exit 0 + + +-%files -f rpm.lang ++%files + %manifest rpm.manifest + %defattr(-,root,root,-) + %doc GROUPS COPYING CREDITS +@@ -305,7 +334,7 @@ exit 0 + %{_libdir}/rpm/rpm2cpio.sh + %{_libdir}/rpm/tgpg + +-%{_libdir}/rpm/platform ++#%{_libdir}/rpm/platform + + %files libs + %manifest rpm.manifest -- 2.7.4