Commit ef4ad04f authored by Michal Čihař's avatar Michal Čihař

Imported Upstream version 4.9.1.1

parent fac37bbe
This diff is collapsed.
......@@ -16,7 +16,7 @@ SUBDIRS = po misc
if WITH_INTERNAL_DB
SUBDIRS += db3
endif
if WITH_LUAEXT
if WITH_LUA
SUBDIRS += luaext
endif
SUBDIRS += rpmio lib sign build scripts fileattrs doc . tests
......
......@@ -48,7 +48,7 @@ DIST_COMMON = README $(am__configure_deps) $(dist_bin_SCRIPTS) \
config.guess config.rpath config.sub depcomp install-sh \
ltmain.sh missing mkinstalldirs
@WITH_INTERNAL_DB_TRUE@am__append_1 = db3
@WITH_LUAEXT_TRUE@am__append_2 = luaext
@WITH_LUA_TRUE@am__append_2 = luaext
@ENABLE_PYTHON_TRUE@am__append_3 = python
@ENABLE_PLUGINS_TRUE@am__append_4 = plugins
rpmbin_PROGRAMS = rpm$(EXEEXT)
......@@ -259,6 +259,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
......@@ -292,7 +293,10 @@ LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
......@@ -311,6 +315,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
PYTHON = @PYTHON@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
......@@ -335,8 +342,6 @@ WITH_BZ2_LIB = @WITH_BZ2_LIB@
WITH_CAP_LIB = @WITH_CAP_LIB@
WITH_DB_LIB = @WITH_DB_LIB@
WITH_LIBELF_LIB = @WITH_LIBELF_LIB@
WITH_LUA_INCLUDE = @WITH_LUA_INCLUDE@
WITH_LUA_LIB = @WITH_LUA_LIB@
WITH_LZMA_LIB = @WITH_LZMA_LIB@
WITH_MAGIC_INCLUDE = @WITH_MAGIC_INCLUDE@
WITH_MAGIC_LIB = @WITH_MAGIC_LIB@
......@@ -371,6 +376,8 @@ __GZIP = @__GZIP@
__ID = @__ID@
__INSTALL = @__INSTALL@
__LD = @__LD@
__LRZIP = @__LRZIP@
__LZIP = @__LZIP@
__MAKE = @__MAKE@
__MKDIR = @__MKDIR@
__MKDIR_P = @__MKDIR_P@
......@@ -396,6 +403,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
......
......@@ -13,12 +13,170 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],,
[m4_warning([this file was generated for autoconf 2.66.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
[m4_warning([this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
......
......@@ -20,10 +20,11 @@ fi
# --- Grab the file manifest and classify files.
#filelist=`sed "s/['\"]/\\\&/g"`
filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
exelist=`echo $filelist | xargs -r file | grep -Ev ":.* (commands|script) " | \
exelist=`echo $filelist | xargs -r file | \
grep -Ev ":.* (commands|script)[, ]" | \
grep ":.*executable" | cut -d: -f1`
scriptlist=`echo $filelist | xargs -r file | \
grep -E ":.* (commands|script) " | cut -d: -f1`
grep -E ":.* (commands|script)[, ]" | cut -d: -f1`
liblist=`echo $filelist | xargs -r file | \
grep ":.*shared object" | cut -d : -f1`
......
......@@ -16,7 +16,7 @@ librpmbuild_la_SOURCES = \
parsePolicies.c policies.c \
rpmbuild_internal.h rpmbuild_misc.h
librpmbuild_la_LDFLAGS = -version-info 2:0:0
librpmbuild_la_LDFLAGS = -version-info 2:1:0
librpmbuild_la_LIBADD = \
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmio/librpmio.la \
......
......@@ -127,6 +127,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
......@@ -160,7 +161,10 @@ LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
......@@ -179,6 +183,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
PYTHON = @PYTHON@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
......@@ -203,8 +210,6 @@ WITH_BZ2_LIB = @WITH_BZ2_LIB@
WITH_CAP_LIB = @WITH_CAP_LIB@
WITH_DB_LIB = @WITH_DB_LIB@
WITH_LIBELF_LIB = @WITH_LIBELF_LIB@
WITH_LUA_INCLUDE = @WITH_LUA_INCLUDE@
WITH_LUA_LIB = @WITH_LUA_LIB@
WITH_LZMA_LIB = @WITH_LZMA_LIB@
WITH_MAGIC_INCLUDE = @WITH_MAGIC_INCLUDE@
WITH_MAGIC_LIB = @WITH_MAGIC_LIB@
......@@ -239,6 +244,8 @@ __GZIP = @__GZIP@
__ID = @__ID@
__INSTALL = @__INSTALL@
__LD = @__LD@
__LRZIP = @__LRZIP@
__LZIP = @__LZIP@
__MAKE = @__MAKE@
__MKDIR = @__MKDIR@
__MKDIR_P = @__MKDIR_P@
......@@ -264,6 +271,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
......@@ -331,7 +339,7 @@ librpmbuild_la_SOURCES = \
parsePolicies.c policies.c \
rpmbuild_internal.h rpmbuild_misc.h
librpmbuild_la_LDFLAGS = -version-info 2:0:0
librpmbuild_la_LDFLAGS = -version-info 2:1:0
librpmbuild_la_LIBADD = \
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmio/librpmio.la \
......
......@@ -543,13 +543,7 @@ static rpmRC parseForAttr(char * buf, FileList fl)
}
ar->ar_fmode = ui;
} else {
if (ret_ar == &(fl->def_ar)) {
ar->ar_fmodestr = NULL;
ar->ar_fmode = 0;
} else {
ar->ar_fmodestr = fl->def_ar.ar_fmodestr;
ar->ar_fmode = fl->def_ar.ar_fmode;
}
ar->ar_fmodestr = NULL;
}
if (ar->ar_dmodestr && !isAttrDefault(ar->ar_dmodestr)) {
......@@ -561,29 +555,15 @@ static rpmRC parseForAttr(char * buf, FileList fl)
}
ar->ar_dmode = ui;
} else {
if (ret_ar == &(fl->def_ar)) {
ar->ar_dmodestr = NULL;
ar->ar_dmode = 0;
} else {
ar->ar_dmodestr = fl->def_ar.ar_dmodestr;
ar->ar_dmode = fl->def_ar.ar_dmode;
}
ar->ar_dmodestr = NULL;
}
if (!(ar->ar_user && !isAttrDefault(ar->ar_user))) {
if (ret_ar == &(fl->def_ar)) {
ar->ar_user = NULL;
} else {
ar->ar_user = fl->def_ar.ar_user;
}
ar->ar_user = NULL;
}
if (!(ar->ar_group && !isAttrDefault(ar->ar_group))) {
if (ret_ar == &(fl->def_ar)) {
ar->ar_group = NULL;
} else {
ar->ar_group = fl->def_ar.ar_group;
}
ar->ar_group = NULL;
}
dupAttrRec(ar, ret_ar);
......@@ -941,7 +921,6 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf,
appendStringBuf(pkg->specialDoc, "DOCDIR=$RPM_BUILD_ROOT");
appendLineStringBuf(pkg->specialDoc, pkg->specialDocDir);
appendLineStringBuf(pkg->specialDoc, "export DOCDIR");
appendLineStringBuf(pkg->specialDoc, "rm -rf $DOCDIR");
appendLineStringBuf(pkg->specialDoc, mkdocdir);
free(mkdocdir);
......@@ -1215,11 +1194,16 @@ static void genCpioListAndHeader(FileList fl,
buf[0] = '\0';
if (S_ISLNK(flp->fl_mode)) {
buf[readlink(flp->diskPath, buf, BUFSIZ)] = '\0';
if (fl->buildRoot) {
ssize_t llen = readlink(flp->diskPath, buf, BUFSIZ-1);
if (llen == -1) {
rpmlog(RPMLOG_ERR, _("reading symlink %s failed: %s\n"),
flp->diskPath, strerror(errno));
fl->processingFailed = 1;
} else {
buf[llen] = '\0';
if (buf[0] == '/' && !rstreq(fl->buildRoot, "/") &&
rstreqn(buf, fl->buildRoot, strlen(fl->buildRoot))) {
rpmlog(RPMLOG_ERR,
rstreqn(buf, fl->buildRoot, strlen(fl->buildRoot))) {
rpmlog(RPMLOG_ERR,
_("Symlink points to BuildRoot: %s -> %s\n"),
flp->cpioPath, buf);
fl->processingFailed = 1;
......@@ -1342,13 +1326,23 @@ static rpmRC recurseDir(FileList fl, const char * diskPath);
static rpmRC addFile(FileList fl, const char * diskPath,
struct stat * statp)
{
const char *cpioPath = diskPath;
size_t plen = strlen(diskPath);
char buf[plen + 1];
const char *cpioPath;
struct stat statbuf;
mode_t fileMode;
uid_t fileUid;
gid_t fileGid;
const char *fileUname;
const char *fileGname;
/* Strip trailing slash. The special case of '/' path is handled below. */
if (plen > 0 && diskPath[plen - 1] == '/') {
diskPath = strcpy(buf, diskPath);
buf[plen - 1] = '\0';
}
cpioPath = diskPath;
/* Path may have prepended buildRoot, so locate the original filename. */
/*
......@@ -1398,8 +1392,11 @@ static rpmRC addFile(FileList fl, const char * diskPath,
statp->st_atime = now;
statp->st_mtime = now;
statp->st_ctime = now;
} else {
rpmlog(RPMLOG_ERR, _("File not found: %s\n"), diskPath);
} else {
const char *msg = fl->isDir ?
_("Directory not found: %s\n") :
_("File not found: %s\n");
rpmlog(RPMLOG_ERR, msg, diskPath);
fl->processingFailed = 1;
return RPMRC_FAIL;
}
......@@ -1407,8 +1404,8 @@ static rpmRC addFile(FileList fl, const char * diskPath,
}
}
if ((! fl->isDir) && S_ISDIR(statp->st_mode)) {
/* FIX: fl->buildRoot may be NULL */
/* Don't recurse into explicit %dir, don't double-recurse from fts */
if ((fl->isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) {
return recurseDir(fl, diskPath);
}
......@@ -1416,20 +1413,33 @@ static rpmRC addFile(FileList fl, const char * diskPath,
fileUid = statp->st_uid;
fileGid = statp->st_gid;
if (S_ISDIR(fileMode) && fl->cur_ar.ar_dmodestr) {
fileMode &= S_IFMT;
fileMode |= fl->cur_ar.ar_dmode;
} else if (fl->cur_ar.ar_fmodestr != NULL) {
/* Explicit %attr() always wins */
if (fl->cur_ar.ar_fmodestr != NULL) {
fileMode &= S_IFMT;
fileMode |= fl->cur_ar.ar_fmode;
} else {
/* ...but %defattr() for directories and files is different */
if (S_ISDIR(fileMode)) {
if (fl->def_ar.ar_dmodestr) {
fileMode &= S_IFMT;
fileMode |= fl->def_ar.ar_dmode;
}
} else if (fl->def_ar.ar_fmodestr) {
fileMode &= S_IFMT;
fileMode |= fl->def_ar.ar_fmode;
}
}
if (fl->cur_ar.ar_user) {
fileUname = fl->cur_ar.ar_user;
} else if (fl->def_ar.ar_user) {
fileUname = fl->def_ar.ar_user;
} else {
fileUname = rpmugUname(fileUid);
}
if (fl->cur_ar.ar_group) {
fileGname = fl->cur_ar.ar_group;
} else if (fl->def_ar.ar_group) {
fileGname = fl->def_ar.ar_group;
} else {
fileGname = rpmugGname(fileGid);
}
......@@ -1529,8 +1539,6 @@ static rpmRC recurseDir(FileList fl, const char * diskPath)
int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL);
rpmRC rc = RPMRC_FAIL;
fl->isDir = 1; /* Keep it from following myftw() again */
ftsSet[0] = (char *) diskPath;
ftsSet[1] = NULL;
ftsp = Fts_open(ftsSet, myFtsOpts, NULL);
......@@ -1563,8 +1571,6 @@ static rpmRC recurseDir(FileList fl, const char * diskPath)
}
(void) Fts_close(ftsp);
fl->isDir = 0;