M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,54 @@
Upstream-Status: Pending
automake version 1.11.2 has made use of dir variables more strict.
the use of pkglibdir with SCRIPTS & DATA vars results in automake
errors.
This commits uses pkgdatadir & pkgbindir vars instead of pkglibdir
to avoid the strict check errors.
This change also works with automake-1.11.1
Errors fixed:
Makefile.am:103: error: `pkglibdir' is not a legitimate directory for `DATA'
scripts/Makefile.am:47: error: `pkglibdir' is not a legitimate directory for `SCRIPTS'
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2011/12/27
Index: rpm-5.4.0/Makefile.am
===================================================================
--- rpm-5.4.0.orig/Makefile.am
+++ rpm-5.4.0/Makefile.am
@@ -103,13 +103,13 @@ if WITH_PATH_VERSIONED
done
endif
-pkglibdir = @USRLIBRPM@
-pkglib_DATA = rpmpopt macros/macros macros/macros.rpmbuild cpuinfo.yaml
+pkgdatadir = @USRLIBRPM@
+pkgdata_DATA = rpmpopt macros/macros macros/macros.rpmbuild cpuinfo.yaml
-pkgbindir = $(pkglibdir)/bin
+pkgbindir = $(pkgdatadir)/bin
pkgbin_SCRIPTS = install-sh mkinstalldirs
-pkgcfgdir = $(pkglibdir)/macros.d
+pkgcfgdir = $(pkgdatadir)/macros.d
pkgcfg_DATA = \
macros/cmake macros/java macros/libtool macros/mandriva macros/mono \
macros/perl macros/pkgconfig macros/php macros/python macros/ruby \
Index: rpm-5.4.0/scripts/Makefile.am
===================================================================
--- rpm-5.4.0.orig/scripts/Makefile.am
+++ rpm-5.4.0/scripts/Makefile.am
@@ -45,8 +45,8 @@ all:
bin_SCRIPTS = gendiff
-pkglibdir = @USRLIBRPM@
-pkglib_SCRIPTS = \
+pkgbindir = @USRLIBRPM@
+pkgbin_SCRIPTS = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
brp-strip brp-strip-comment-note brp-nobuildrootpath \
brp-strip-shared brp-strip-static-archive brp-sparc64-linux \
@@ -0,0 +1,35 @@
Upstream-Status: Submitted
From: Qing He <qing.he@intel.com>
Subject: [PATCH] rpm 5.4.0: Fix pointer mishandling
In fpLookupSubdir, data returned by hash should be of type
"struct rpmffi_s **" instead of "struct rpmffi_s *" to avoid
segfault.
Signed-off-by: Qing He <qing.he@intel.com>
diff --git a/rpmdb/fprint.c b/rpmdb/fprint.c
index 0e76148..82b8f45 100644
--- a/rpmdb/fprint.c
+++ b/rpmdb/fprint.c
@@ -333,7 +333,7 @@ restart:
*te = '\0';
while (te < se) {
- struct rpmffi_s * recs;
+ struct rpmffi_s ** recs;
int numRecs;
int i;
@@ -346,8 +346,8 @@ restart:
const char * link;
int fx;
- fx = recs[i].fileno;
- fi = recs[i].p->fi;
+ fx = recs[i]->fileno;
+ fi = recs[i]->p->fi;
flink = fi->flinks[fx];
if (!(flink && *flink != '\0'))
continue;
@@ -0,0 +1,26 @@
Upstream-Status: Pending
diff --git a/rpmdb/rpmdb.h b/rpmdb/rpmdb.h
index 0e1bdd7..8b522bb 100644
--- a/rpmdb/rpmdb.h
+++ b/rpmdb/rpmdb.h
@@ -9,6 +9,7 @@
#include <assert.h>
#include <mire.h>
+#include <errno.h>
#include <rpmtypes.h>
#include <rpmtag.h> /* XXX Header typedef */
diff --git a/rpmdb/rpmtag.h b/rpmdb/rpmtag.h
index 8af6480..2166b4c 100644
--- a/rpmdb/rpmtag.h
+++ b/rpmdb/rpmtag.h
@@ -7,6 +7,7 @@
#include <rpmiotypes.h>
#include <rpmsw.h>
+#include <stdint.h>
#ifdef __cplusplus
extern "C" {
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
: ${RPMDEPS:=rpmdeps}
process() {
while read file_name ; do
printf "%s\t" ${file_name}
if [ ! -d $file_name ]; then
printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g')
fi
printf "\n"
done
}
usage() {
echo "$0 {-P|--provides} {-R|--requires} FILE ..."
}
while [ $# -gt 0 ]; do
case "$1" in
--rpmdeps)
RPMDEPS=$2
shift
shift
;;
-R|--requires)
process_type=--requires
shift
;;
-P|--provides)
process_type=--provides
shift
;;
*)
break;
;;
esac
done
if [ -z "$process_type" ]; then
usage
exit 1
fi
if [ $# -gt 0 ]; then
find "$@" | process $process_type
exit $?
fi
process $process_type
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
[ $# -ge 1 ] || {
cat > /dev/null
exit 0
}
case $1 in
-R|--requires)
shift
grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
exit 0
;;
esac
exit 0
@@ -0,0 +1,443 @@
Upstream-Status: Inappropriate [configuration]
Index: rpm-5.1.9/configure.ac
===================================================================
--- rpm-5.1.9.orig/configure.ac 2009-04-18 17:47:02.000000000 +0100
+++ rpm-5.1.9/configure.ac 2010-07-06 14:47:28.985462456 +0100
@@ -643,38 +643,22 @@
dnl look for libc features
PROVIDES_ERRNO=no
AC_MSG_CHECKING(if <netdb.h> defines h_errno)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[printf("%d",h_errno)]])],[PROVIDES_ERRNO=yes],[])
-AC_MSG_RESULT($PROVIDES_ERRNO)
-if test $PROVIDES_ERRNO = yes; then
- AC_DEFINE(HAVE_HERRNO, 1, [ Define as 1 if <netdb.h> defines h_errno])
-fi
+AC_DEFINE(HAVE_HERRNO, 1, [ Define as 1 if <netdb.h> defines h_errno])
dnl If a system doesn't have S_IFSOCK, define it as 0 which will
dnl make S_ISSOCK always return false (nice, eh?)
AC_MSG_CHECKING(if <sys/stat.h> defines S_IFSOCK)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_IFSOCK)]])],[HAS_S_IFSOCK=yes],[HAS_S_IFSOCK=no])
-AC_MSG_RESULT($HAS_S_IFSOCK)
-if test $HAS_S_IFSOCK = yes; then
- AC_DEFINE(HAVE_S_IFSOCK, 1, [Define as 1 if <sys/stat.h> defines S_IFSOCK])
-fi
+AC_DEFINE(HAVE_S_IFSOCK, 1, [Define as 1 if <sys/stat.h> defines S_IFSOCK])
dnl Some Unix's are missing S_ISLNK, S_ISSOCK
AC_MSG_CHECKING(if <sys/stat.h> defines S_ISLNK)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_ISLNK(0755))]])],[HAS_S_ISLNK=yes],[HAS_S_ISLNK=no])
-AC_MSG_RESULT($HAS_S_ISLNK)
-if test $HAS_S_ISLNK = yes; then
- AC_DEFINE(HAVE_S_ISLNK, 1, [Define as 1 if <sys/stat.h> defines S_ISLNK])
-fi
+AC_DEFINE(HAVE_S_ISLNK, 1, [Define as 1 if <sys/stat.h> defines S_ISLNK])
AC_MSG_CHECKING(if <sys/stat.h> defines S_ISSOCK)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[printf("%d", S_ISSOCK(0755))]])],[HAS_S_ISSOCK=yes],[HAS_S_ISSOCK=no])
-AC_MSG_RESULT($HAS_S_ISSOCK)
-if test $HAS_S_ISSOCK = yes; then
- AC_DEFINE(HAVE_S_ISSOCK, 1, [Define as 1 if <sys/stat.h> defines S_ISSOCK])
-fi
+AC_DEFINE(HAVE_S_ISSOCK, 1, [Define as 1 if <sys/stat.h> defines S_ISSOCK])
AC_MSG_CHECKING(if timezone is defined)
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[printf("%ld", timezone)]])],[HAS_TIMEZONE=yes],[HAS_TIMEZONE=no])
+$HAS_TIMEZONE=yes
AC_MSG_RESULT($HAS_TIMEZONE)
dnl check for missing typedefs
@@ -726,53 +710,12 @@
AC_MSG_RESULT(yes)
AC_CHECK_HEADERS([libelf.h gelf.h])
if test ".$ac_cv_header_libelf_h" = .no; then
- dnl # <libelf.h> on Solaris is incompatible with LFS. If we couldn't
- dnl # include <libelf.h>, see if we can when _FILE_OFFSET_BITS is
- dnl # set for non-LFS. Same applies for <gelf.h>, since it probably
- dnl # includes <libelf.h>
- AC_MSG_CHECKING([if libelf.h conflicts with _LARGEFILE_SOURCE])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef _LARGEFILE64_SOURCE
-#undef _LARGEFILE_SOURCE
-#if !defined(_LP64)
-# undef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 32
-#endif
-#include <libelf.h>
- ]], [[
- Elf_Data foo;
- ]])
- ], [
- AC_DEFINE(HAVE_LIBELF_H, 1, [Define to 1 if you have libelf.h])
- ac_cv_header_libelf_h=yes
- AC_DEFINE(LIBELF_H_LFS_CONFLICT, 1, [Define to 1 if libelf.h is incompatible with LFS API])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ])
+ AC_DEFINE(HAVE_LIBELF_H, 1, [Define to 1 if you have libelf.h])
+ ac_cv_header_libelf_h=yes
fi
if test ".$ac_cv_header_gelf_h" = .no; then
- AC_MSG_CHECKING([if gelf.h conflicts with _LARGEFILE_SOURCE])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef _LARGEFILE64_SOURCE
-#undef _LARGEFILE_SOURCE
-#if !defined(_LP64)
-# undef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 32
-#endif
-#include <gelf.h>
- ]], [[
- Elf32_Verdef foo;
- ]])
- ], [
- AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have gelf.h])
- ac_cv_header_gelf_h=yes
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ])
+ AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have gelf.h])
+ ac_cv_header_gelf_h=yes
fi
if test ".$ac_cv_header_gelf_h" = .yes; then
AC_CHECK_LIB([elf], [elf_version], [
@@ -854,78 +797,9 @@
python_version=""
;;
esac
- for python_ver in $python_version ; do
- if test "$python_ver" != "2.x" ; then
- AC_MSG_CHECKING([for Python ${python_ver} API])
- save_CFLAGS="${CFLAGS}"
- for i in "$prefix" "/usr/local" "/usr"; do
- CFLAGS="${save_CFLAGS} -I$i/include/python${python_ver}"
- AC_RUN_IFELSE([AC_LANG_SOURCE(
- [[#include "Python.h"
- main() { exit(strncmp("${python_ver}", PY_VERSION, 3)); } ]])
- ], [
- PYTHON_VERSION="${python_ver}"
- AC_MSG_RESULT(yes)
- PYTHON_PREFIX="${i}"
- break
- ], [
- ], [
- dnl if we're cross compiling, assume the user has a clue
- if test "$withval" = "$python_ver"; then
- PYTHON_VERSION="${python_ver}"
- AC_MSG_RESULT(yes)
- break
- fi
- ])
- done
- CFLAGS="${save_CFLAGS}"
- if test ".$PYTHON_VERSION" == "."; then
- dnl check Mac OS X framework
- save_CFLAGS="${CFLAGS}"
- for f in "~" "" "/System" "/Network"; do
- CFLAGS="${save_CFLAGS} -I$f/Library/Frameworks/Python.framework/Versions/${python_ver}/include/python${python_ver}"
- AC_RUN_IFELSE([AC_LANG_SOURCE(
- [[#include "Python.h"
- main() { exit(strncmp("${python_ver}", PY_VERSION, 3)); } ]])
- ], [
- PYTHON_VERSION="${python_ver}"
- AC_MSG_RESULT([yes (using Python.framework)])
- PYTHON_PREFIX="$f/Library/Frameworks/Python.framework/Versions/${python_ver}"
- break
- ], [
- ])
- done
- CFLAGS="${save_CFLAGS}"
- fi
- if test ".$PYTHON_VERSION" == "."; then
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_CHECKING([for Python 2.x API])
- AC_RUN_IFELSE([AC_LANG_SOURCE(
- [[#include <python/Python.h>
- main() { exit(strncmp("2.", PY_VERSION, 2)); } ]])
- ], [
- PYTHON_VERSION=""
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ], [
- dnl if we're cross compiling, assume the user has a clue
- if test "$withval" = "$python_ver"; then
- PYTHON_VERSION="${python_ver}"
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- ])
- fi
- if test ".$PYTHON_VERSION" != "."; then
- WITH_PYTHON_SUBDIR=python
- WITH_PYTHON_SUBPACKAGE=1
- break
- fi
- done
+ PYTHON_VERSION="${python_ver}"
+ WITH_PYTHON_SUBDIR=python
+ WITH_PYTHON_SUBPACKAGE=1
fi
AC_ARG_WITH(python-inc-dir, AS_HELP_STRING([--with-python-inc-dir=DIR], [directory with Python include files]),
[WITH_PYTHON_INCDIR="$withval"], [WITH_PYTHON_INCDIR="`(python -c 'from distutils.sysconfig import get_python_inc; print get_python_inc()') 2>/dev/null`"])
@@ -1157,15 +1031,8 @@
AC_SUBST(WITH_PCRE_LIBS)
else
dnl # make sure PCRE POSIX API can be really _USED_ by RPM
- LIBS_SAVED="$LIBS"
LIBS="-lpcreposix $LIBS"
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([#include <pcreposix.h>], [(void)regcomp(0, 0, 0)])
- ], [
- AC_DEFINE(WITH_PCRE_POSIX, 1, [Define as 1 if PCRE's POSIX API is available])
- ], [
- LIBS="$LIBS_SAVED"
- ])
+ AC_DEFINE(WITH_PCRE_POSIX, 1, [Define as 1 if PCRE's POSIX API is available])
fi
dnl # enable PCRE native API support for embedded Lua
if test ".$WITH_LUA" = .yes; then
@@ -1234,30 +1101,7 @@
dnl # figure out what root's primary group is
AC_MSG_CHECKING([root's primary group])
-AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <grp.h>
-int main()
-{
- struct passwd *root = NULL;
- struct group *roots_group = NULL;
- FILE * tempfile = NULL;
- root = getpwuid( (uid_t) 0 );
- if (root != NULL) {
- roots_group = getgrgid(root->pw_gid);
- if (roots_group != NULL) {
- tempfile = fopen("conftest_rootg", "w");
- if (tempfile != NULL) {
- fprintf(tempfile, "%s\n", roots_group->gr_name);
- fclose(tempfile);
- exit(0);
- }
- }
- }
- exit(1);
-}]])],[ROOT_GROUP=`cat conftest_rootg`; rm -f conftest_rootg],[ROOT_GROUP="root"],[ROOT_GROUP="root"
-])
+$ROOT_GROUP="root"
AC_MSG_RESULT([$ROOT_GROUP])
AC_SUBST(ROOT_GROUP)
Index: rpm-5.1.9/pcre/configure.ac
===================================================================
--- rpm-5.1.9.orig/pcre/configure.ac 2009-01-14 20:19:31.000000000 +0000
+++ rpm-5.1.9/pcre/configure.ac 2010-07-06 14:51:50.769586089 +0100
@@ -278,34 +278,6 @@
# The files below are C++ header files.
pcre_have_type_traits="0"
pcre_have_bits_type_traits="0"
-if test "x$enable_cpp" = "xyes" -a -n "$CXX"
-then
-AC_LANG_PUSH(C++)
-
-# Older versions of pcre defined pcrecpp::no_arg, but in new versions
-# it's called pcrecpp::RE::no_arg. For backwards ABI compatibility,
-# we want to make one an alias for the other. Different systems do
-# this in different ways. Some systems, for instance, can do it via
-# a linker flag: -alias (for os x 10.5) or -i (for os x <=10.4).
-OLD_LDFLAGS="$LDFLAGS"
-for flag in "-alias,__ZN7pcrecpp2RE6no_argE,__ZN7pcrecpp6no_argE" \
- "-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE"; do
- AC_MSG_CHECKING([for alias support in the linker])
- LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
- # We try to run the linker with this new ld flag. If the link fails,
- # we give up and remove the new flag from LDFLAGS.
- AC_LINK_IFELSE(AC_LANG_PROGRAM([namespace pcrecpp {
- class RE { static int no_arg; };
- int RE::no_arg;
- }],
- []),
- [AC_MSG_RESULT([yes]);
- EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
- break;],
- AC_MSG_RESULT([no]))
-done
-LDFLAGS="$OLD_LDFLAGS"
-
# We could be more clever here, given we're doing AC_SUBST with this
# (eg set a var to be the name of the include file we want). But we're not
# so it's easy to change back to 'regular' autoconf vars if we needed to.
@@ -316,7 +288,6 @@
AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
[pcre_have_type_traits="0"])
-AC_LANG_POP
fi
# Using AC_SUBST eliminates the need to include config.h in a public .h file
AC_SUBST(pcre_have_type_traits)
Index: rpm-5.1.9/db/dist/configure.ac
===================================================================
--- rpm-5.1.9.orig/db/dist/configure.ac 2008-06-15 08:16:21.000000000 +0100
+++ rpm-5.1.9/db/dist/configure.ac 2010-07-06 15:36:39.262461127 +0100
@@ -602,24 +602,6 @@
aux*) AC_LIBOBJ([getopt]);;
esac
-# Linux has a broken O_DIRECT flag, but you can't detect it at configure time.
-# Linux and SGI require buffer alignment we may not match, otherwise writes
-# will fail. Default to not using the O_DIRECT flag.
-if test "$db_cv_o_direct" = "yes"; then
- AC_CACHE_CHECK([for open/O_DIRECT], db_cv_open_o_direct, [
- AC_TRY_LINK([
- #include <sys/types.h>
- #include <fcntl.h>], [
- open("a", O_RDONLY | O_DIRECT, 0);
- ], [db_cv_open_o_direct=yes], [db_cv_open_o_direct=no])])
- if test \
- "$db_cv_o_direct" = "yes" -a "$db_cv_open_o_direct" = "yes"; then
- AC_DEFINE(HAVE_O_DIRECT)
- AH_TEMPLATE(HAVE_O_DIRECT,
- [Define to 1 if you have the O_DIRECT flag.])
- fi
-fi
-
# Check for largefile support.
AC_SYS_LARGEFILE
Index: rpm-5.1.9/xz/configure.ac
===================================================================
--- rpm-5.1.9.orig/xz/configure.ac 2009-02-16 17:07:46.000000000 +0000
+++ rpm-5.1.9/xz/configure.ac 2010-07-06 15:41:22.632467951 +0100
@@ -457,26 +457,9 @@
#endif
])
-# Even if we have byteswap.h, we may lack the specific macros/functions.
-if test x$ac_cv_header_byteswap_h = xyes ; then
- m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
- AC_MSG_CHECKING([if FUNC is available])
- AC_LINK_IFELSE([AC_LANG_SOURCE([
-#include <byteswap.h>
-int
-main(void)
-{
- FUNC[](42);
- return 0;
-}
- ])], [
- AC_DEFINE(HAVE_[]m4_toupper(FUNC), [1],
- [Define to 1 if] FUNC [is available.])
- AC_MSG_RESULT([yes])
- ], [AC_MSG_RESULT([no])])
-
- ])dnl
-fi
+AC_DEFINE(HAVE_BSWAP_16, 1)
+AC_DEFINE(HAVE_BSWAP_32, 1)
+AC_DEFINE(HAVE_BSWAP_64, 1)
###############################################################################
@@ -527,90 +510,16 @@
# xz command line tool uses this to automatically limit its memory usage.
# - sysconf() gives all the needed info on GNU+Linux and Solaris.
# - BSDs use sysctl().
-AC_MSG_CHECKING([how to detect the amount of physical memory])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#include <unistd.h>
-int
-main()
-{
- long i;
- i = sysconf(_SC_PAGESIZE);
- i = sysconf(_SC_PHYS_PAGES);
- return 0;
-}
-]])], [
- AC_DEFINE([HAVE_PHYSMEM_SYSCONF], [1],
+AC_DEFINE([HAVE_PHYSMEM_SYSCONF], [1],
[Define to 1 if the amount of physical memory can be detected
with sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYS_PAGES).])
- AC_MSG_RESULT([sysconf])
-], [
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#include <sys/sysctl.h>
-int
-main()
-{
- int name[2] = { CTL_HW, HW_PHYSMEM };
- unsigned long mem;
- size_t mem_ptr_size = sizeof(mem);
- sysctl(name, 2, &mem, &mem_ptr_size, NULL, NULL);
- return 0;
-}
-]])], [
- AC_DEFINE([HAVE_PHYSMEM_SYSCTL], [1],
- [Define to 1 if the amount of physical memory can be detected
- with sysctl().])
- AC_MSG_RESULT([sysctl])
-], [
- AC_MSG_RESULT([unknown])
-])])
# Check how to find out the number of available CPU cores in the system.
# sysconf(_SC_NPROCESSORS_ONLN) works on most systems, except that BSDs
# use sysctl().
-AC_MSG_CHECKING([how to detect the number of available CPU cores])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#include <unistd.h>
-int
-main()
-{
- long i;
- i = sysconf(_SC_NPROCESSORS_ONLN);
- return 0;
-}
-]])], [
- AC_DEFINE([HAVE_NCPU_SYSCONF], [1],
+AC_DEFINE([HAVE_NCPU_SYSCONF], [1],
[Define to 1 if the number of available CPU cores can be
detected with sysconf(_SC_NPROCESSORS_ONLN).])
- AC_MSG_RESULT([sysconf])
-], [
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif
-#include <sys/sysctl.h>
-int
-main()
-{
- int name[2] = { CTL_HW, HW_NCPU };
- int cpus;
- size_t cpus_size = sizeof(cpus);
- sysctl(name, 2, &cpus, &cpus_size, NULL, NULL);
- return 0;
-}
-]])], [
- AC_DEFINE([HAVE_NCPU_SYSCTL], [1],
- [Define to 1 if the number of available CPU cores can be
- detected with sysctl().])
- AC_MSG_RESULT([sysctl])
-], [
- AC_MSG_RESULT([unknown])
-])])
-
###############################################################################
# If using GCC, set some additional CFLAGS:
@@ -0,0 +1,22 @@
Using the version of autoconf in poky results in:
configure.ac:11: error: m4_divert_push: cannot change diversion to `GROW' inside m4_expand
without this patch.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -ur rpm-5.1.10.orig/configure.ac rpm-5.1.10/configure.ac
--- rpm-5.1.10.orig/configure.ac 2010-08-20 17:12:16.000000000 -0500
+++ rpm-5.1.10/configure.ac 2010-09-03 11:34:44.722097327 -0500
@@ -8,7 +8,7 @@
AC_PREREQ(2.60)
AC_DEFUN([PACKAGE_BUGREPORT_DEFAULT], [rpm-devel@rpm5.org])
-AC_INIT(rpm, [5.1.10], [PACKAGE_BUGREPORT_DEFAULT])
+AC_INIT(rpm, [5.1.10])
PACKAGE_TIMESTAMP="2008" dnl # YYYY[-MM[-DD[ HH[:MM]]]]
AC_MSG_TITLE([RPM Package Manager (RPM)], [$PACKAGE_VERSION])
@@ -0,0 +1,56 @@
Remove the sanity checking from the rpm autogen.sh. This is required because
we may have slightly different, but yet compatible versions. If we do end
up breaking things, we'll deal with it at that time.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -ur rpm-5.4.0.orig/autogen.sh rpm-5.4.0/autogen.sh
--- rpm-5.4.0.orig/autogen.sh 2010-11-02 11:55:53.000000000 -0500
+++ rpm-5.4.0/autogen.sh 2011-01-06 00:15:05.158946295 -0600
@@ -34,12 +34,6 @@
eval $_libtoolize $_libtoolize_args
}
-# requirements sanity check
-[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1
-[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
-[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1
-
for dir in bash beecrypt file neon pcre popt rc syck xar xz; do
if [ -d $dir ]; then
diff -ur rpm-5.4.0.orig/neon/autogen.sh rpm-5.4.0/neon/autogen.sh
--- rpm-5.4.0.orig/neon/autogen.sh 2010-10-30 19:11:33.000000000 -0500
+++ rpm-5.4.0/neon/autogen.sh 2011-01-06 00:15:17.863962139 -0600
@@ -34,12 +34,6 @@
eval $_libtoolize $_libtoolize_args
}
-# requirements sanity check
-[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1
-[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
-[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1
-
echo "---> generate files via GNU libtool (libtoolize)"
libtoolize --quiet --copy --force --install
echo "---> generate files via GNU autoconf (aclocal, autoheader)"
diff -ur rpm-5.4.0.orig/syck/autogen.sh rpm-5.4.0/syck/autogen.sh
--- rpm-5.4.0.orig/syck/autogen.sh 2010-11-02 11:55:56.000000000 -0500
+++ rpm-5.4.0/syck/autogen.sh 2011-01-06 00:15:27.103949601 -0600
@@ -34,12 +34,6 @@
eval $_libtoolize $_libtoolize_args
}
-# requirements sanity check
-[ "`automake --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1
-[ "`autoconf --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
-[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1
-
echo "---> generate files via GNU libtool (libtoolize)"
libtoolize --quiet --copy --force --install
echo "---> generate files via GNU autoconf (aclocal, autoheader)"
@@ -0,0 +1,136 @@
lib/rpmrc.c: Update --target processing to support full GNU canonical arch
Prior to this patch, when using --target, RPM supported the format:
<arch>
<arch>-<os>
<arch>-<os>-gnu
<arch>-<arbitrary items>-<os>
<arch>-<arbitrary items>-<os>-gnu
This patch changes the list of supported items to:
<arch>
<arch>-<os>
<arch>-<os>-gnu
<arch>-<vendor>-<os>
<arch>-<vendor>-<os>-<extension>
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Index: rpm-5.4.0/lib/rpmrc.c
===================================================================
--- rpm-5.4.0.orig/lib/rpmrc.c 2011-08-10 17:04:35.798814821 -0500
+++ rpm-5.4.0/lib/rpmrc.c 2011-08-10 17:33:51.505871895 -0500
@@ -916,8 +916,8 @@
static void rpmRebuildTargetVars(const char ** target, const char ** canontarget)
{
-
- char *ca = NULL, *co = NULL, *ct = NULL;
+ /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */
+ char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL;
int x;
/* Rebuild the compat table to recalculate the current target arch. */
@@ -927,23 +927,60 @@
rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
if (target && *target) {
+ /* GNU canonical format is:
+ * <arch>-<vendor>-<os>[-extension]
+ *
+ * We support the both the GNU canonical format
+ * as well as the traditional RPM formats:
+ * <arch>
+ * <arch>-<os>[-gnu]
+ */
char *c;
/* Set arch and os from specified build target */
ca = xstrdup(*target);
- if ((c = strchr(ca, '-')) != NULL) {
+ if ((c = strchr(ca, '-')) == NULL) {
+ /* Format is <arch> */
+ ;
+ } else {
*c++ = '\0';
-
- if ((co = strrchr(c, '-')) == NULL) {
- co = c;
+ cv = c;
+
+ if ((c = strchr(c, '-')) == NULL) {
+ /* Format is <arch>-<os> */
+ co = cv;
+ cv = NULL;
} else {
- if (!xstrcasecmp(co, "-gnu"))
- *co = '\0';
- if ((co = strrchr(c, '-')) == NULL)
- co = c;
- else
- co++;
+ *c++ = '\0';
+ co = c;
+
+ if ((c = strchr(c, '-')) == NULL) {
+ /* Might be:
+ * <arch>-<vendor>-<os>
+ * <arch>-<os>-gnu
+ */
+ if (!xstrcasecmp(co, "gnu")) {
+ /* Format was <arch>-<os>-gnu */
+ ce = co;
+ co = cv;
+ cv = NULL;
+ }
+ } else {
+ /* Format was <arch>-<vendor>-<os>-<extension> */
+ *c++ = '\0';
+ ce = c;
+ }
}
+ if (cv != NULL) cv = xstrdup(cv);
if (co != NULL) co = xstrdup(co);
+ if (ce != NULL) {
+ /* We need to prefix it with a "-" */
+ char * lce = NULL;
+
+ lce = xmalloc(strlen(ce) + sizeof("-"));
+ sprintf(lce, "-%s", ce);
+
+ ce = lce;
+ }
}
} else {
const char *a = NULL;
@@ -988,8 +1025,16 @@
addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC);
delMacro(NULL, "_target_cpu");
addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC);
+ if (cv) {
+ delMacro(NULL, "_target_vendor");
+ addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC);
+ }
delMacro(NULL, "_target_os");
addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC);
+ if (ce) {
+ delMacro(NULL, "_gnu");
+ addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC);
+ }
if (canontarget)
*canontarget = ct;
@@ -997,8 +1041,12 @@
ct = _free(ct);
ca = _free(ca);
/*@-usereleased@*/
+ cv = _free(cv);
+ /*@-usereleased@*/
co = _free(co);
/*@=usereleased@*/
+ ce = _free(ce);
+ /*@-usereleased@*/
}
void rpmFreeRpmrc(void)
@@ -0,0 +1,19 @@
Upstream-Status: Inappropriate [configuration]
Change cache size to reduce the usage of disk space from 62MB to 26MB.
Signed-off-by: Mei Lei <lei.mei@intel.com>
diff --git a/rpmdb/DB_CONFIG.in b/rpmdb/DB_CONFIG.in
index e0b4689..b64e3a9 100644
--- a/rpmdb/DB_CONFIG.in
+++ b/rpmdb/DB_CONFIG.in
@@ -29,7 +29,7 @@ set_thread_count 64
# ================ Memory Pool
#XXX initializing dbenv with set_cachesize has unimplemented prerequsites
-#set_cachesize 0 1048576 0
+set_cachesize 0 1048576 0
set_mp_mmapsize 268435456
# ================ Locking
@@ -0,0 +1,36 @@
rpmfc.c: Always generate per-file information
Even when the per-file dependency generate is disabled, we want to generate
per file classification and other associated data.
Note: this is a temporary workaround. Eventually we will want to have a way
to seed per-file dependency and other information in order to generate a
package from previously determined information.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff --git a/lib/rpmfc.c b/lib/rpmfc.c
index 0c3befd..9306999 100644
--- a/lib/rpmfc.c
+++ b/lib/rpmfc.c
@@ -1692,7 +1692,6 @@ rpmRC rpmfcGenerateDepends(void * specp, void * pkgp)
/* ... then generate dependencies using %{__find_requires} et al. */
rc = rpmfcGenerateDependsHelper(spec, pkg, fi);
printDeps(pkg->header);
- return rc;
}
/* Generate scriptlet Dependencies. */
@@ -1720,8 +1719,8 @@ rpmRC rpmfcGenerateDepends(void * specp, void * pkgp)
av[ac] = NULL;
fc = rpmfcNew();
- fc->skipProv = !pkg->autoProv;
- fc->skipReq = !pkg->autoReq;
+ fc->skipProv = !pkg->autoProv || !internaldeps;
+ fc->skipReq = !pkg->autoReq || !internaldeps;
fc->tracked = 0;
{ const char * buildRootURL;
@@ -0,0 +1,20 @@
During installation, the libtool relink attempts to link to -lrpm...
The problem is that it hasn't been installed yet! So small change causes
the libtool to instead use the build version.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
--- rpm-5.4.0/lib/Makefile.am.orig
+++ rpm-5.4.0/lib/Makefile.am
@@ -90,6 +90,9 @@
libsql_la_SOURCES = libsql.c
libsql_la_LIBADD = librpm.la $(RPMDB_LDADD_COMMON)
+# pkglib libraries needs to have usrlib libraries already installed!
+install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES
+
install-data-hook:
if !ENABLE_BUILD_LAFILES
-for l in $(usrlib_LTLIBRARIES); do \
@@ -0,0 +1,15 @@
Upstream-Status: Inappropriate [configuration]
diff --git a/rpmdb/DB_CONFIG.in b/rpmdb/DB_CONFIG.in
index 8b94c94..e0b4689 100644
--- a/rpmdb/DB_CONFIG.in
+++ b/rpmdb/DB_CONFIG.in
@@ -4,6 +4,7 @@ set_data_dir .
set_create_dir .
set_lg_dir ./log
set_tmp_dir ./tmp
+set_flags db_log_autoremove on
# -- thread_count must be >= 8
set_thread_count 64
@@ -0,0 +1,18 @@
lib/order.c: Make the dependency loop messages into debug msgs
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -urN rpm-5.4.0.orig/lib/order.c rpm-5.4.0/lib/order.c
--- rpm-5.4.0.orig/lib/order.c 2010-12-13 17:36:39.000000000 -0600
+++ rpm-5.4.0/lib/order.c 2011-08-10 11:11:43.194686332 -0500
@@ -2170,7 +2170,7 @@
const char * dp;
rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS))
? RPMLOG_WARNING : RPMLOG_ERR;
-#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */
+#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_POKY) /* loop-detection-optional-loglevel */
// Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable
msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}");
#endif
@@ -0,0 +1,36 @@
Backport from RPM 5.4.1 CVS, disabled fsync.
Upstream-Status: Backport
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -ur rpm-5.4.0.orig/CHANGES rpm-5.4.0/CHANGES
--- rpm-5.4.0.orig/CHANGES 2010-12-29 07:51:38.000000000 -0600
+++ rpm-5.4.0/CHANGES 2011-02-15 20:54:27.021926840 -0600
@@ -1,4 +1,5 @@
5.4.0 -> 5.4.1:
+ - jbj: remove fsync(2) after file install, its intolerably slow.
5.3.7 -> 5.4.0:
- jbj: remove markReplacedFiles.
diff -ur rpm-5.4.0.orig/lib/fsm.c rpm-5.4.0/lib/fsm.c
--- rpm-5.4.0.orig/lib/fsm.c 2009-12-10 12:52:18.000000000 -0600
+++ rpm-5.4.0/lib/fsm.c 2011-02-15 20:55:04.372938221 -0600
@@ -1017,7 +1017,17 @@
(void) fsmNext(fsm, IOSM_NOTIFY);
}
+#ifdef DYING
+/* Measurements from installing kernel-source package:
+ * +fsync
+ * total: 1 0.000000 MB 640.854524 secs
+ * +fdatasync
+ * total: 1 0.000000 MB 419.983200 secs
+ * w/o fsync/fdsatasync:
+ * total: 1 0.000000 MB 12.492918 secs
+ */
xx = fsync(Fileno(fsm->wfd));
+#endif
if (st->st_size > 0 && (fsm->fdigest || fsm->digest)) {
void * digest = NULL;
@@ -0,0 +1,134 @@
Fix up platform and related sysinfo file loading.
Upstream-Status: Pending
This ensures that RPM knows the compatible set of package types at all times.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -ur rpm-5.4.0.orig/lib/depends.c rpm-5.4.0/lib/depends.c
--- rpm-5.4.0.orig/lib/depends.c 2011-02-15 20:40:13.002849708 -0600
+++ rpm-5.4.0/lib/depends.c 2011-02-15 20:47:05.838981632 -0600
@@ -248,7 +248,7 @@
he->p.ptr = _free(he->p.ptr);
}
-#if defined(RPM_VENDOR_WINDRIVER)
+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_POKY)
/*
* If we're capable of installing multiple colors
* but at least one of the packages are white (0), we
@@ -505,7 +505,7 @@
return 0;
}
-#if defined(RPM_VENDOR_WINDRIVER)
+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_POKY)
/* Is "compat" compatible w/ arch? */
int _isCompatibleArch(const char * arch, const char * compat)
{
@@ -649,7 +649,7 @@
if (arch == NULL || (parch = rpmteA(p)) == NULL)
continue;
-#if defined(RPM_VENDOR_WINDRIVER)
+#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_POKY)
/* XXX hackery for alias matching. */
if (!_isCompatibleArch(arch, parch))
continue;
@@ -815,6 +815,12 @@
return rc;
}
+#if defined(RPM_VENDOR_WINDRIVER)
+#define _ETC_RPM_SYSINFO "%{_etcrpm}/sysinfo"
+#else
+#define _ETC_RPM_SYSINFO SYSCONFIGDIR "/sysinfo"
+#endif
+
/*@only@*/ /*@null@*/ /*@unchecked@*/
static char *sysinfo_path = NULL;
@@ -1296,7 +1302,7 @@
sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL);
if (!(sysinfo_path != NULL && *sysinfo_path == '/')) {
sysinfo_path = _free(sysinfo_path);
- sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo");
+ sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
}
}
diff -ur rpm-5.4.0.orig/lib/rpmds.c rpm-5.4.0/lib/rpmds.c
--- rpm-5.4.0.orig/lib/rpmds.c 2011-02-15 20:40:13.004855352 -0600
+++ rpm-5.4.0/lib/rpmds.c 2011-02-15 20:41:55.598846670 -0600
@@ -1737,7 +1737,7 @@
/*@-observertrans @*/
_sysinfo_path = _free(_sysinfo_path);
/*@=observertrans @*/
- _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO);
+ _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
}
}
/*@=modobserver@*/
diff -ur rpm-5.4.0.orig/lib/rpmrc.c rpm-5.4.0/lib/rpmrc.c
--- rpm-5.4.0.orig/lib/rpmrc.c 2011-02-15 20:40:13.006853913 -0600
+++ rpm-5.4.0/lib/rpmrc.c 2011-02-15 20:44:39.708972391 -0600
@@ -38,7 +38,13 @@
static const char * configTarget = NULL;
/*@observer@*/ /*@unchecked@*/
-static const char * platform = SYSCONFIGDIR "/platform";
+#if defined(RPM_VENDOR_WINDRIVER)
+#define _ETC_RPM_PLATFORM "%{_etcrpm}/platform"
+#else
+#define _ETC_RPM_PLATFORM SYSCONFIGDIR "/platform"
+#endif
+
+static const char * _platform = NULL;
/*@only@*/ /*@relnull@*/ /*@unchecked@*/
void * platpat = NULL;
@@ -685,16 +691,17 @@
int rc;
while (!gotDefaults) {
-#if defined(RPM_VENDOR_WINDRIVER)
- const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL);
-#else
- const char * _platform = platform;
-#endif
+ if (_platform == NULL) {
+ _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL);
+ /* XXX may need to validate path existence somewhen. */
+ if (!(_platform != NULL && *_platform == '/')) {
+ _platform = _free(_platform);
+ _platform = rpmExpand(_ETC_RPM_PLATFORM, NULL);
+ }
+ }
CVOG_t cvog = NULL;
#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
const char *cp;
-#endif
-#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
/* utsname fields on some platforms (like HP-UX) are very small
(just about 8 characters). This is too small for OpenPKG, so cheat! */
rc = uname(&un_real);
@@ -771,9 +778,7 @@
if (cp != NULL && cp != _platform)
cp = _free(cp);
#endif
-#if defined(RPM_VENDOR_WINDRIVER)
_platform = _free(_platform);
-#endif
if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) {
gotDefaults = 1;
@@ -1096,6 +1101,8 @@
#ifdef PREMACROFILES
if (rpmReadRC(PREMACROFILES)) return -1;
+#else
+ if (rpmReadRC(NULL)) return -1;
#endif
/* Reset umask to its default umask(2) value. */
@@ -0,0 +1,159 @@
Enable a cross-install scriptlet helper.
The helper is called from outside of the chroot with the arguments:
<root> <prog> <script> <arg1> [<arg2> ... <argN>]
The helper script is used by oe-core to facilitate shell script actions that
can not be run from within a chroot on a foreign target system during a
cross install.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -ur rpm-5.4.0.orig/lib/psm.c rpm-5.4.0/lib/psm.c
--- rpm-5.4.0.orig/lib/psm.c 2010-12-29 07:42:11.000000000 -0600
+++ rpm-5.4.0/lib/psm.c 2011-11-08 13:38:48.132791154 -0600
@@ -792,6 +792,10 @@
int xx;
int i;
+#ifdef RPM_VENDOR_POKY
+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
+#endif
+
if (psm->sstates != NULL && ix >= 0 && ix < RPMSCRIPT_MAX)
ssp = psm->sstates + ix;
if (ssp != NULL)
@@ -858,14 +862,29 @@
(F_ISSET(psm, UNORDERED) ? "a" : ""));
if (Phe->p.argv == NULL) {
- argv = alloca(5 * sizeof(*argv));
- argv[0] = "/bin/sh";
- argc = 1;
+ argv = alloca(7 * sizeof(*argv));
+ argc = 0;
+ } else {
+ argv = alloca((Phe->c + 6) * sizeof(*argv));
+ argc = 0;
+ }
+
+#ifdef RPM_VENDOR_POKY
+ if (scriptletWrapper && *scriptletWrapper) {
+ argv[argc++] = scriptletWrapper;
+ argv[argc] = rpmtsRootDir(ts);
+ if (!argv[argc] || !*argv[argc])
+ argv[argc] = "/";
+ argc++;
+ }
+#endif
+
+ if (Phe->p.argv == NULL) {
+ argv[argc++] = "/bin/sh";
ldconfig_done = 0;
} else {
- argv = alloca((Phe->c + 4) * sizeof(*argv));
- memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv));
- argc = Phe->c;
+ memcpy((argv + argc), Phe->p.argv, Phe->c * sizeof(*argv));
+ argc += Phe->c;
ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path)
? 1 : 0);
}
@@ -916,7 +935,12 @@
goto exit;
if (rpmIsDebug() &&
- (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash")))
+ (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))
+#ifdef RPM_VENDOR_POKY
+ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/sh"))
+ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/bash"))
+#endif
+ )
{
static const char set_x[] = "set -x\n";
nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd);
@@ -1051,12 +1075,22 @@
{ const char * rootDir = rpmtsRootDir(ts);
if (!rpmtsChrootDone(ts) && rootDir != NULL &&
+#ifdef RPM_VENDOR_POKY
+ !(scriptletWrapper && *scriptletWrapper) &&
+#endif
!(rootDir[0] == '/' && rootDir[1] == '\0'))
{
/*@-modobserver@*/
xx = Chroot(rootDir);
/*@=modobserver@*/
}
+#ifdef RPM_VENDOR_POKY
+ if (!rpmtsChrootDone(ts) && rootDir != NULL &&
+ (scriptletWrapper && *scriptletWrapper) &&
+ !(rootDir[0] == '/' && rootDir[1] == '\0'))
+ xx = Chdir(rootDir);
+ else
+#endif
xx = Chdir("/");
rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"),
psm->stepName, sln, NVRA,
@@ -2961,6 +2995,13 @@
case PSM_SCRIPT: /* Run current package scriptlets. */
/* XXX running %verifyscript/%sanitycheck doesn't have psm->te */
{ rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL);
+
+#ifdef RPM_VENDOR_POKY
+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
+ if (scriptletWrapper && *scriptletWrapper)
+ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
+#endif
+
xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
rc = runInstScript(psm);
if (rc)
@@ -2968,11 +3009,24 @@
else
xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
rpmtsGetRdb(ts)->db_txn = NULL;
+#ifdef RPM_VENDOR_POKY
+ if (scriptletWrapper && *scriptletWrapper)
+ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
+#endif
} break;
case PSM_TRIGGERS:
/* Run triggers in other package(s) this package sets off. */
if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break;
+#ifdef RPM_VENDOR_POKY
+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
+ if (scriptletWrapper && *scriptletWrapper)
+ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
+#endif
rc = runTriggers(psm);
+#ifdef RPM_VENDOR_POKY
+ if (scriptletWrapper && *scriptletWrapper)
+ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
+#endif
break;
case PSM_IMMED_TRIGGERS:
/* Run triggers in this package other package(s) set off. */
@@ -2982,7 +3036,18 @@
F_SET(psm, GOTTRIGGERS);
}
if (psm->triggers != NULL)
+#ifdef RPM_VENDOR_POKY
+ {
+ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
+ if (scriptletWrapper && *scriptletWrapper)
+ rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
+#endif
rc = runImmedTriggers(psm);
+#ifdef RPM_VENDOR_POKY
+ if (scriptletWrapper && *scriptletWrapper)
+ rc = rpmpsmNext(psm, PSM_CHROOT_IN);
+ }
+#endif
break;
case PSM_RPMIO_FLAGS:
@@ -0,0 +1,25 @@
Workaround for a memory leak in --showrc.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -ur rpm-5.4.0.orig/lib/rpmrc.c rpm-5.4.0/lib/rpmrc.c
--- rpm-5.4.0.orig/lib/rpmrc.c 2011-02-15 20:40:13.006853913 -0600
+++ rpm-5.4.0/lib/rpmrc.c 2011-02-15 20:44:39.708972391 -0600
@@ -1216,11 +1223,15 @@
if (DNEVR != NULL)
fprintf(fp, " %s\n", DNEVR+2);
}
+#if 0
(void)rpmdsFree(ds);
ds = NULL;
+#endif
fprintf(fp, "\n");
}
+#if 0
PRCO = rpmdsFreePRCO(PRCO);
+#endif
}
if (rpmIsVerbose()) {
@@ -0,0 +1,31 @@
Increase the maximum number of solver databases!
Previously the max was set to 5, up this to 20... this should be more
then enough for now.. also add an RPM_ERROR message in case we exceed the
new maximum.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -urN rpm-5.4.0.orig/rpmio/rpmbag.c rpm-5.4.0/rpmio/rpmbag.c
--- rpm-5.4.0.orig/rpmio/rpmbag.c 2010-10-17 21:43:55.000000000 -0500
+++ rpm-5.4.0/rpmio/rpmbag.c 2011-02-18 18:46:00.246892502 -0600
@@ -16,7 +16,7 @@
/*@unchecked@*/
int _rpmbag_debug = 0;
-static size_t _maxnsdbp = 5;
+static size_t _maxnsdbp = 20;
static void rpmbagFini(void * _bag)
/*@globals fileSystem @*/
@@ -70,6 +70,8 @@
sdbp[i] = xcalloc(1, sizeof(*sdbp[i]));
sdbp[i]->dbmode = dbmode;
sdbp[i]->_db = _db;
+ } else if (bag && bag->sdbp && bag->nsdbp >= _maxnsdbp) {
+ rpmlog(RPMLOG_ERR, _("Attempted to open more then %d solver databases. Increase _maxnsdbp in rpmio/rpmbag.c\n"), _maxnsdbp);
}
return 0;
@@ -0,0 +1,24 @@
Source: None
Upstream-Status: Pending
Author: Khem Raj <raj.khem@gmail.com>
Date: 2011-03-03
Description:
This patch fixes build issue found when compiling rpm-natibe on ubuntu
11.04-alpha. Problem is that linker does not get correct set of dependent
libraries when linking mtree binary which results in undefined symbols
in librpmio.so. This patch adds correct flags to mtree_LDADD to account
for rpmio deps
Index: rpm-5.4.0/tools/Makefile.am
===================================================================
--- rpm-5.4.0.orig/tools/Makefile.am
+++ rpm-5.4.0/tools/Makefile.am
@@ -169,7 +169,7 @@ grep_LDADD = $(RPMIO_LDADD_COMMON)
mtree_SOURCES = rpmmtree.c
mtree_LDFLAGS = @LDFLAGS_STATIC@ $(LDFLAGS)
-mtree_LDADD = $(RPM_LDADD_COMMON)
+mtree_LDADD = $(RPMIO_LDADD_COMMON)
rpmrepo_SOURCES = rpmrepo.c
rpmrepo_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/scripts -I$(top_builddir)/scripts $(CPPFLAGS)
+51
View File
@@ -0,0 +1,51 @@
#!/bin/sh
pkg=$1
if [ "$pkg" = "" -o ! -e "$pkg" ]; then
echo "no package supplied" 1>&2
exit 1
fi
leadsize=96
o=`expr $leadsize + 8`
set `od -j $o -N 8 -t u1 $pkg`
il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
# echo "sig il: $il dl: $dl"
sigsize=`expr 8 + 16 \* $il + $dl`
o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`
set `od -j $o -N 8 -t u1 $pkg`
il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
# echo "hdr il: $il dl: $dl"
hdrsize=`expr 8 + 16 \* $il + $dl`
o=`expr $o + $hdrsize`
EXTRACTOR="dd if=$pkg ibs=$o skip=1"
COMPRESSION=`($EXTRACTOR |file -) 2>/dev/null`
if echo $COMPRESSION |grep -q gzip; then
DECOMPRESSOR=gunzip
elif echo $COMPRESSION |grep -q bzip2; then
DECOMPRESSOR=bunzip2
elif echo $COMPRESSION |grep -q xz; then
DECOMPRESSOR=unxz
elif echo $COMPRESSION |grep -q cpio; then
DECOMPRESSOR=cat
else
# Most versions of file don't support LZMA, therefore we assume
# anything not detected is LZMA
DECOMPRESSOR=`which unlzma 2>/dev/null`
case "$DECOMPRESSOR" in
/* ) ;;
* ) DECOMPRESSOR=`which lzmash 2>/dev/null`
case "$DECOMPRESSOR" in
/* ) DECOMPRESSOR="lzmash -d -c" ;;
* ) DECOMPRESSOR=cat ;;
esac
;;
esac
fi
$EXTRACTOR 2>/dev/null | $DECOMPRESSOR
@@ -0,0 +1,445 @@
SUMMARY = "The RPM package management system"
DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
package management system capable of installing, uninstalling, \
verifying, querying, and updating software packages. Each software \
package consists of an archive of files along with information about \
the package like its version, a description, etc."
SUMMARY_${PN}-libs = "Libraries for manipulating RPM packages."
DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries."
SUMMARY_${PN}-dev = "Development files for manipulating RPM packages."
DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
development files will simplify the process of writing programs that \
manipulate RPM packages and databases. These files are intended to \
simplify the process of creating graphical package managers or any \
other tools that need an intimate knowledge of RPM packages in order \
to function."
SUMMARY_${PN}-common = "Common RPM paths, scripts, documentation and configuration."
DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \
and configuration common between RPM Package Manager."
SUMMARY_${PN}-build = "Scripts and executable programs used to build packages."
DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \
that are used to build packages using the RPM Package Manager."
SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages."
DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
written in the Python programming language to use the interface \
supplied by the RPM Package Manager libraries."
SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages."
DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \
written in the Perl programming language to use the interface \
supplied by the RPM Package Manager libraries."
SUMMARY_perl-module-rpm-dev = "Development components for perl bindings"
DESCRIPTION_perl-modules-rpm-dev = "Development items such as man pages for use with the Perl \
language bindings."
HOMEPAGE = "http://rpm5.org/"
LICENSE = "LGPL 2.1"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}"
extrarpmdeps = "python perl"
extrarpmdeps_virtclass-native = "file-native"
PR = "r29"
# rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed
# in order to extract the distribution SRPM into a format we can extract...
SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm;extract=rpm-5.4.0.tar.gz \
file://rpm-log-auto-rm.patch \
file://rpm-db-reduce.patch \
file://perfile_rpmdeps.sh \
file://rpm-autogen.patch \
file://rpm-libsql-fix.patch \
file://header-include-fix.patch \
file://rpm-platform.patch \
file://rpm-showrc.patch \
file://rpm-nofsync.patch \
file://rpm-solvedb.patch \
file://rpm-tools-mtree-LDFLAGS.patch \
file://fprint-pointer-fix.patch \
file://rpm-fileclass.patch \
file://rpm-canonarch.patch \
file://rpm-no-loopmsg.patch \
file://rpm-scriptletexechelper.patch \
file://fix_for_automake_1.11.2.patch \
file://pythondeps.sh \
"
# file://rpm-autoconf.patch \
# file://remove-compiled-tests.patch;apply=no \
# "
SRC_URI[md5sum] = "19c1a7f68d7765eeb7615c9c4e54e380"
SRC_URI[sha256sum] = "887e76218308b570c33c8c2fb10b5298b3afd5d602860d281befc85357b3b923"
inherit autotools gettext
acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
# Specify the default rpm macros in terms of adjustable variables
rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
rpm_macros_virtclass-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros"
# Configure values taken from rpm.spec
WITH_BZIP2 = "--with-bzip2"
WITH_XZ = "--with-xz=none"
WITH_Z = "--with-zlib $WITH_BZIP2 $WITH_XZ"
WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
--with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
--with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION} \
--without-pythonembed \
"
WITH_PYTHON_virtclass-native = " --without-python"
# Perl modules are not built, but they could be enabled fairly easily
# the perl module creation and installation would need to be patched.
# (currently has host perl contamination issues)
#WITH_PERL = " --with-perl --without-perlembed"
WITH_PERL = " --without-perl"
WITH_PERL_virtclass-native = " --without-perl"
WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated --without-sqlite"
WITH_CRYPTO = "--with-beecrypt=internal --with-openssl --without-nss --without-gcrypt"
WITH_KEYUTILS = "--without-keyutils"
WITH_LIBELF = "--with-libelf"
WITH_SELINUX = "--without-selinux --without-sepol --without-semanage"
#WITH_NEON = "--with-neon=internal --without-libproxy --with-expat --without-gssapi"
WITH_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
EXTRA_OECONF = "--verbose \
--sysconfdir=/etc \
${WITH_DB} \
${WITH_Z} \
--with-file \
--with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
--without-lua \
--without-tcl \
--with-syck=internal \
--without-readline \
--without-augeas \
${WITH_CRYPTO} \
--without-libtasn1 \
--without-pakchois \
--without-gnutls \
${WITH_NEON} \
--with-pcre \
--enable-utf8 \
--without-uuid \
--with-attr \
--with-acl \
--without-xar \
--with-popt=external \
${WITH_KEYUTILS} \
--with-pthreads \
${WITH_LIBELF} \
--without-cudf \
--without-ficl \
--without-aterm \
--without-nix \
--without-bash \
--without-rc \
--without-js \
--without-gpsee \
${WITH_PYTHON} \
${WITH_PERL} \
--without-ruby \
--without-squirrel \
--with-build-extlibdep \
--with-build-maxextlibdep \
--without-valgrind \
--without-xz \
--disable-openmp \
--enable-build-pic \
--enable-build-versionscript \
--enable-build-warnings \
--enable-build-debug \
--enable-maintainer-mode \
--with-path-macros=${rpm_macros} \
--with-path-lib=${libdir}/rpm \
--with-bugreport=http://bugzilla.yoctoproject.org \
--program-prefix="
CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY"
PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm-dbg python-rpm perl-module-rpm perl-module-rpm-dev ${PN}-locale"
SOLIBS = "5.4.so"
# Based on %files section in the rpm.spec
FILES_${PN} = "${bindir}/rpm \
${bindir}/rpmconstant \
${libdir}/rpm/rpm.* \
${libdir}/rpm/tgpg \
${libdir}/rpm/macros \
${libdir}/rpm/rpmpopt \
${libdir}/rpm/rpmdb_loadcvt \
${libdir}/rpm/rpm2cpio \
${libdir}/rpm/vcheck \
${libdir}/rpm/helpers \
${libdir}/rpm/qf \
${libdir}/rpm/cpuinfo.yaml \
${libdir}/rpm/bin/mtree \
${libdir}/rpm/bin/rpmkey \
${libdir}/rpm/bin/rpmrepo \
${libdir}/rpm/bin/rpmspecdump \
${libdir}/rpm/bin/wget \
/var/lib/rpm \
"
# ${libdir}/rpm/magic
# ${libdir}/rpm/magic.mgc
# ${libdir}/rpm/magic.mime
# ${libdir}/rpm/magic.mime.mgc
# ${libdir}/rpm/bin/db_*
# ${libdir}/rpm/bin/grep
FILES_${PN}-dbg += "${libdir}/rpm/.debug \
${libdir}/rpm/bin/.debug \
"
FILES_${PN}-common = "${bindir}/rpm2cpio \
${bindir}/gendiff \
/etc/rpm \
/var/spool/repackage \
"
FILES_${PN}-libs = "${libdir}/librpm-*.so \
${libdir}/librpmconstant-*.so \
${libdir}/librpmdb-*.so \
${libdir}/librpmio-*.so \
${libdir}/librpmmisc-*.so \
${libdir}/librpmbuild-*.so \
"
###%{_rpmhome}/lib/libxar.so.*
###%{_rpmhome}/lib/libjs.so.*
###%{_rpmhome}/lib/librpmjsm.so.*
###%{_rpmhome}/lib/rpmjsm.so
FILES_${PN}-build = "${prefix}/src/rpm \
${bindir}/rpmbuild \
${libdir}/rpm/brp-* \
${libdir}/rpm/check-files \
${libdir}/rpm/cross-build \
${libdir}/rpm/find-debuginfo.sh \
${libdir}/rpm/find-lang.sh \
${libdir}/rpm/find-prov.pl \
${libdir}/rpm/find-provides.perl \
${libdir}/rpm/find-req.pl \
${libdir}/rpm/find-requires.perl \
${libdir}/rpm/getpo.sh \
${libdir}/rpm/http.req \
${libdir}/rpm/javadeps.sh \
${libdir}/rpm/mono-find-provides \
${libdir}/rpm/mono-find-requires \
${libdir}/rpm/executabledeps.sh \
${libdir}/rpm/libtooldeps.sh \
${libdir}/rpm/osgideps.pl \
${libdir}/rpm/perldeps.pl \
${libdir}/rpm/perl.prov \
${libdir}/rpm/perl.req \
${libdir}/rpm/php.prov \
${libdir}/rpm/php.req \
${libdir}/rpm/pkgconfigdeps.sh \
${libdir}/rpm/pythondeps.sh \
${libdir}/rpm/bin/debugedit \
${libdir}/rpm/bin/rpmcache \
${libdir}/rpm/bin/rpmcmp \
${libdir}/rpm/bin/rpmdeps \
${libdir}/rpm/bin/rpmdigest \
${libdir}/rpm/bin/abi-compliance-checker.pl \
${libdir}/rpm/bin/api-sanity-autotest.pl \
${libdir}/rpm/bin/chroot \
${libdir}/rpm/bin/cp \
${libdir}/rpm/bin/dbsql \
${libdir}/rpm/bin/find \
${libdir}/rpm/bin/install-sh \
${libdir}/rpm/bin/lua \
${libdir}/rpm/bin/luac \
${libdir}/rpm/bin/mkinstalldirs \
${libdir}/rpm/bin/rpmlua \
${libdir}/rpm/bin/rpmluac \
${libdir}/rpm/bin/sqlite3 \
${libdir}/rpm/lib/liblua.a \
${libdir}/rpm/lib/liblua.la \
${libdir}/rpm/macros.d/cmake \
${libdir}/rpm/macros.d/java \
${libdir}/rpm/macros.d/libtool \
${libdir}/rpm/macros.d/mandriva \
${libdir}/rpm/macros.d/mono \
${libdir}/rpm/macros.d/perl \
${libdir}/rpm/macros.d/php \
${libdir}/rpm/macros.d/pkgconfig \
${libdir}/rpm/macros.d/python \
${libdir}/rpm/macros.d/ruby \
${libdir}/rpm/macros.d/selinux \
${libdir}/rpm/macros.d/tcl \
${libdir}/rpm/macros.rpmbuild \
${libdir}/rpm/u_pkg.sh \
${libdir}/rpm/vpkg-provides.sh \
${libdir}/rpm/vpkg-provides2.sh \
${libdir}/rpm/perfile_rpmdeps.sh \
"
RDEPENDS_${PN}-build = "file"
#%rpmattr %{_rpmhome}/gem_helper.rb
#%rpmattr %{_rpmhome}/symclash.*
FILES_python-rpm-dbg = "${libdir}/python*/rpm/.debug/_*"
FILES_python-rpm = "${libdir}/python*/rpm"
FILES_perl-module-rpm = "${libdir}/perl/*/* \
"
FILES_perl-module-rpm-dev = "${prefix}/share/man/man3/RPM* \
"
FILE_${PN}-dev = "${includedir}/rpm \
${libdir}/librpm.la \
${libdir}/librpm.so \
${libdir}/librpmconstant.la \
${libdir}/librpmconstant.so \
${libdir}/librpmdb.la \
${libdir}/librpmdb.so \
${libdir}/librpmio.la \
${libdir}/librpmio.so \
${libdir}/librpmmisc.la \
${libdir}/librpmmisc.so \
${libdir}/librpmbuild.la \
${libdir}/librpmbuild.so \
${libdir}/pkgconfig/rpm.pc \
"
FILE_${PN}-staticdev = " \
${libdir}/librpm.a \
${libdir}/librpmconstant.a \
${libdir}/librpmdb.a \
${libdir}/librpmio.a \
${libdir}/librpmmisc.a \
${libdir}/librpmbuild.a \
"
###%{_rpmhome}/lib/libxar.a
###%{_rpmhome}/lib/libxar.la
###%{_rpmhome}/lib/libxar.so
###%{_rpmhome}/lib/libjs.a
###%{_rpmhome}/lib/libjs.la
###%{_rpmhome}/lib/libjs.so
###%{_rpmhome}/lib/librpmjsm.a
###%{_rpmhome}/lib/librpmjsm.la
###%{_rpmhome}/lib/librpmjsm.so
do_configure() {
# Disable tests!
echo "all:" > tests/Makefile.am
./autogen.sh
export varprefix=${localstatedir}
oe_runconf
}
do_install_append() {
sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros
sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros
sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros
sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
# Enable Debian style arbitrary tags...
sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
# Remove unpackaged files (based on list in rpm.spec)
rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
rm -f ${D}/${mandir}/man8/rpmcache.8*
rm -f ${D}/${mandir}/man8/rpmgraph.8*
rm -f ${D}/${mandir}/*/man8/rpmcache.8*
rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
rm -rf ${D}/${mandir}/{fr,ko}
rm -f ${D}/${includedir}/popt.h
rm -f ${D}/${libdir}/libpopt.*
rm -f ${D}/${libdir}/pkgconfig/popt.pc
rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
rm -f ${D}/${mandir}/man3/popt.3
rm -f ${D}/${mandir}/man1/xar.1*
rm -f ${D}/${bindir}/xar
rm -rf ${D}/${includedir}/xar
rm -f ${D}/${libdir}/libxar*
rm -f ${D}/${bindir}/lz*
rm -f ${D}/${bindir}/unlzma
rm -f ${D}/${bindir}/unxz
rm -f ${D}/${bindir}/xz*
rm -rf ${D}/${includedir}/lzma*
rm -f ${D}/${mandir}/man1/lz*.1
rm -f ${D}/${libdir}/pkgconfig/liblzma*
rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la}
rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la}
#find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
# -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
#find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
# We don't want the default macro set
rm -rf ${D}/${libdir}/rpm/{i[3456]86*,athlon*,pentium*,x86_64*,alpha*,sparc*,ia64*,ppc*,s390*,armv[34][lb]*,armv[345]*,mips*,noarch*}
rm -f ${D}/${libdir}/rpm/dbconvert.sh
rm -f ${D}/${libdir}/rpm/libsqldb.*
}
do_install_append_virtclass-native() {
create_wrapper ${D}/${bindir}/rpm \
RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
create_wrapper ${D}/${bindir}/rpm2cpio \
RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
create_wrapper ${D}/${bindir}/rpmbuild \
RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
create_wrapper ${D}/${bindir}/rpmconstant \
RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
for rpm_binary in ${D}/${libdir}/rpm/bin/rpm*; do
create_wrapper $rpm_binary
RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
done
# Adjust popt macros to match...
cat ${D}/${libdir}/rpm/rpmpopt | sed -e "s,^\(rpm[^ ]*\)\([ ]\),\1.real\2," > ${D}/${libdir}/rpm/rpmpopt.new
mv ${D}/${libdir}/rpm/rpmpopt.new ${D}/${libdir}/rpm/rpmpopt
}
BBCLASSEXTEND = "native"