- add __as, _build_arch, and __cxx macros (#36662, #36663, #49280).
- detailed build package error messages.
CVS patchset: 4996
CVS date: 2001/07/31 18:13:22
- add tmpdir to configure db3 tmpdir into chroot tree.
- permit lazy db opens within chroot.
- fix: diddle dbenv path to accomodate backing store reopen in chroot.
+ - add support for mips (#49283).
+ - add __as, _build_arch, and __cxx macros (#36662, #36663, #49280).
+ - detailed build package error messages.
4.0 -> 4.0.[12]
- add doxygen and lclint annotations most everywhere.
@for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\
done
- @case "@build_cpu@" in \
+ @case "@host_cpu@" in \
*86) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;;\
ia64*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
s390*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
+ mipsel*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
+ mips*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
powerpc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;;\
- *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@build_cpu@ ;;\
+ *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
esac
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
- @case "@build_os@" in \
+ @case "@host_os@" in \
mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
solaris*|linux*) \
chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \
rpmdb rpmdb = NULL;
rpmTransactionSet ts = rpmtransCreateSet(rpmdb, rootDir);
TFI_t fi = csa->cpioList;
- const char *fmode = rpmExpand(fmodeMacro, NULL);
const char *failedFile = NULL;
FD_t cfd;
int rc, ec;
- if (!(fmode && fmode[0] == 'w'))
- fmode = xstrdup("w9.gzdio");
- /*@-nullpass@*/
- (void) Fflush(fdo);
- cfd = Fdopen(fdDup(Fileno(fdo)), fmode);
- /*@=nullpass@*/
+ { const char *fmode = rpmExpand(fmodeMacro, NULL);
+ if (!(fmode && fmode[0] == 'w'))
+ fmode = xstrdup("w9.gzdio");
+ /*@-nullpass@*/
+ (void) Fflush(fdo);
+ cfd = Fdopen(fdDup(Fileno(fdo)), fmode);
+ /*@=nullpass@*/
+ fmode = _free(fmode);
+ }
if (cfd == NULL)
return 1;
}
failedFile = _free(failedFile);
- fmode = _free(fmode);
ts = rpmtransFree(ts);
return rc;
{
FD_t fd = NULL;
FD_t ifd = NULL;
- int rc, count, sigtype;
+ int count, sigtype;
const char * sigtarget;
const char * rpmio_flags = NULL;
const char * sha1 = NULL;
char buf[BUFSIZ];
Header h;
Header sig = NULL;
+ int rc = 0;
/* Transfer header reference form *hdrp to h. */
h = headerLink(*hdrp);
h = headerReload(h, RPMTAG_HEADERIMMUTABLE);
if (h == NULL) { /* XXX can't happen */
rc = RPMERR_RELOAD;
+ rpmError(RPMERR_RELOAD, _("Unable to create immutable header region.\n"));
goto exit;
}
/* Re-reference reallocated header. */
if (headerWrite(fd, h, HEADER_MAGIC_YES)) {
rc = RPMERR_NOSPACE;
+ rpmError(RPMERR_NOSPACE, _("Unable to write %s header\n"), "temp");
} else { /* Write the archive and get the size */
if (csa->cpioList != NULL) {
rc = cpio_doio(fd, h, csa, rpmio_flags);
} else if (Fileno(csa->cpioFdIn) >= 0) {
rc = cpio_copy(fd, csa);
} else {
- rpmError(RPMERR_CREATE, _("Bad CSA data\n"));
rc = RPMERR_BADARG;
+ rpmError(RPMERR_BADARG, _("Bad CSA data\n"));
}
}
rpmio_flags = _free(rpmio_flags);
}
fdInitSHA1(fd, 0);
- if (headerWrite(fd, h, HEADER_MAGIC_NO))
+ if (headerWrite(fd, h, HEADER_MAGIC_NO)) {
rc = RPMERR_NOSPACE;
+ rpmError(RPMERR_NOSPACE, _("Unable to write %s header\n"), "final");
+ }
(void) Fflush(fd);
fdFiniSHA1(fd, (void **)&sha1, NULL, 1);
sig = headerReload(sig, RPMTAG_HEADERSIGNATURES);
if (sig == NULL) { /* XXX can't happen */
rc = RPMERR_RELOAD;
+ rpmError(RPMERR_RELOAD, _("Unable to reload %s header.\n"), "signature");
goto exit;
}
/* Open the output file */
fd = Fopen(fileName, "w.ufdio");
if (fd == NULL || Ferror(fd)) {
+ rc = RPMERR_CREATE;
rpmError(RPMERR_CREATE, _("Could not open %s: %s\n"),
fileName, Fstrerror(fd));
- rc = RPMERR_CREATE;
goto exit;
}
}
if (writeLead(fd, &lead)) {
+ rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
Fstrerror(fd));
- rc = RPMERR_NOSPACE;
goto exit;
}
}
/* Append the header and archive */
ifd = Fopen(sigtarget, "r.ufdio");
if (ifd == NULL || Ferror(ifd)) {
+ rc = RPMERR_READ;
rpmError(RPMERR_READ, _("Unable to open sigtarget %s: %s\n"),
sigtarget, Fstrerror(ifd));
- rc = RPMERR_READ;
goto exit;
}
{ Header nh = headerRead(ifd, HEADER_MAGIC_YES);
if (nh == NULL) {
+ rc = RPMERR_READ;
rpmError(RPMERR_READ, _("Unable to read header from %s: %s\n"),
sigtarget, Fstrerror(ifd));
- rc = RPMERR_READ;
goto exit;
}
nh = headerFree(nh);
if (rc) {
+ rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write header to %s: %s\n"),
fileName, Fstrerror(fd));
- rc = RPMERR_NOSPACE;
goto exit;
}
}
/* Write the payload into the package. */
while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) {
if (count == -1) {
+ rc = RPMERR_READ;
rpmError(RPMERR_READ, _("Unable to read payload from %s: %s\n"),
sigtarget, Fstrerror(ifd));
- rc = RPMERR_READ;
goto exit;
}
if (Fwrite(buf, sizeof(buf[0]), count, fd) != count) {
+ rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write payload to %s: %s\n"),
fileName, Fstrerror(fd));
- rc = RPMERR_NOSPACE;
goto exit;
}
}
LIBOBJS=
dnl Checks for programs.
-AC_ARG_PROGRAM
AC_PROG_CC
+AC_PROG_CXX
+AS=${AS-as}
+AC_SUBST(AS)
if test "$ac_cv_prog_gcc" = yes; then
CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts"
fi
}
localdone=
-for dir in $prefix /usr/local
+
+dirs=$prefix
+if test "$cross_compiling" != "yes"; then
+ dirs="$dirs /usr/local"
+fi
+for dir in $dirs
do
case $dir in
NONE|/usr) continue;;
if test $rpm_cv_glob = no ; then
AC_MSG_CHECKING(for GNU extensions to glob)
+if test "${rpm_cv_glob_ext+set}" = set; then
rm -f t
mkdir t
mkdir t/p
rpm_cv_glob_ext=yes, rpm_cv_glob_ext=no, rpm_cv_glob_ext=no)
rm -r t
AC_MSG_RESULT([$rpm_cv_glob_ext])
+fi
if test $rpm_cv_glob_ext = no ; then
- echo " --> using the included GNU glob instead." >&AC_FD_MSG
- rpm_cv_glob=yes
+ echo " --> using the included GNU glob instead." >&AC_FD_MSG
+ rpm_cv_glob=yes
fi
fi
main() {
exit(strcmp("1.5.2", PY_VERSION));
} ],
- withval=yes, withval=no, withval=no)
+ withval=yes, withval=no, withval=yes)
AC_MSG_RESULT($withval)
fi
armv4l*) RPMCANONARCH=armv4l ;;
armv4b*) RPMCANONARCH=armv4b ;;
arm*) RPMCANONARCH="${build_cpu}" ;;
+mipsel*) RPMCANONARCH=mipsel ;;
+mips*) RPMCANONARCH=mips ;;
m68k*) RPMCANONARCH=m68k ;;
*) RPMCANONARCH=unknown ;;
esac
i[3456]86) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_' ;;
alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;;
sparc*) SUBSTS='s_sparc\(64\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
+ powerpc*|ppc*) 's_\(powerpc\|ppc\)_ppc_' ;;
*) SUBSTS=y___ ;;
esac
-base_arch=`echo $arch | sed -e 's_i?86_i386_;s_sparc.*_sparc_;s_alpha.*_alpha_'`
+base_arch=`echo $arch | sed -e 's_i?86_i386_;s_sparc.*_sparc_;s_alpha.*_alpha_;s_\(powerpc\|ppc\).*_ppc_'`
for SUBST in $SUBSTS ; do
ARCH=`echo $arch | sed -e $SUBST`
/*@=assignexpose@*/
entry->length = pvlen - sizeof(il) - sizeof(dl);
rdlen = regionSwab(entry+1, il, 0, pe, dataStart, entry->info.offset);
- if (rdlen != dl) goto errxit;
+#if !defined(MANDRAKE_LOCALE_PACKAGE_DEBUG)
+ if (rdlen != dl)
+ goto errxit;
+#endif
entry->rdlen = rdlen;
entry++;
h->indexUsed++;
/*@=assignexpose@*/
entry->length = pvlen - sizeof(il) - sizeof(dl);
rdlen = regionSwab(entry+1, ril-1, 0, pe+1, dataStart, entry->info.offset);
- if (rdlen < 0) goto errxit;
+ if (rdlen < 0)
+ goto errxit;
entry->rdlen = rdlen;
if (ril < h->indexUsed) {
/* Load dribble entries from region. */
rc = regionSwab(newEntry, ne, 0, pe+ril, dataStart, rid);
- if (rc < 0) goto errxit;
+ if (rc < 0)
+ goto errxit;
rdlen += rc;
{ indexEntry firstEntry = newEntry;
#/*! \page config_macros Default configuration: /usr/lib/rpm/macros
# \verbatim
#
-# $Id: macros.in,v 1.86 2001/07/28 00:33:07 jbj Exp $
+# $Id: macros.in,v 1.87 2001/07/31 18:13:23 jbj Exp $
#
# This is a global RPM configuration file. All changes made here will
# be lost when the rpm package is upgraded. Any per-system configuration
# ---- Build system path macros.
#
%__ar @AR@
+%__as @AS@
%__cc @CC@
%__cpp @CPP@
+%__cxx @CXX@
%__ld @__LD@
%__nm @__NM@
%__objcopy @__OBJCOPY@
# will be used if the per-platform macro file does not exist..
#
%_arch @RPMCANONARCH@
+%_build_arch @RPMCANONARCH@
%_vendor @RPMCANONVENDOR@
%_os @RPMCANONOS@
%_gnu -gnu
CPP = @CPP@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
+CXX = @CXX@
DATADIRNAME = @DATADIRNAME@
DBLIBOBJS = @DBLIBOBJS@
DBLIBSRCS = @DBLIBSRCS@
%define with_python_subpackage 1 %{nil}
+%define with_perl_subpackage 1
%define with_bzip2 1 %{nil}
%define with_apidocs 1 %{nil}
%define with_internal_db 1 %{nil}
%define _noPayloadPrefix 1
%define __prefix /usr
-%{expand:%%define __share %(if [ -d %{__prefix}/share/man ]; then echo /share ; else echo %%{nil} ; fi)}
+%{expand: %%define __share %(if [ -d %{__prefix}/share/man ]; then echo /share ; else echo %%{nil} ; fi)}
Summary: The Red Hat package management system.
Name: rpm
%define version 4.1
Version: %{version}
-Release: 0.1
+%{expand: %%define rpm_version %{version}}
+Release: 0.79
Group: System Environment/Base
-Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{version}.tar.gz
+Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
Copyright: GPL
Conflicts: patch < 2.5
%ifos linux
%endif
%endif
+BuildRequires: zlib-devel
# XXX Red Hat 5.2 has not bzip2 or python
%if %{with_bzip2}
BuildRequires: bzip2 >= 0.9.0c-2
%if %{with_python_subpackage}
BuildRequires: python-devel >= 1.5.2
%endif
+%if %{with_perl_subpackage}
+BuildRequires: perl >= 0:5.00503
+%endif
BuildRoot: %{_tmppath}/%{name}-root
%package devel
Summary: Development files for applications which will manipulate RPM packages.
Group: Development/Libraries
-Requires: rpm = %{version}, popt = 1.6.3
+Requires: rpm = %{rpm_version}, popt = 1.6.3
%description devel
This package contains the RPM C library and header files. These
%package build
Summary: Scripts and executable programs used to build packages.
Group: Development/Tools
-Requires: rpm = %{version}
+Requires: rpm = %{rpm_version}
%description build
This package contains scripts and executable programs that are used to
%package python
Summary: Python bindings for apps which will manipulate RPM packages.
Group: Development/Libraries
-Requires: rpm = %{version}
+Requires: rpm = %{rpm_version}
Requires: python >= 1.5.2
+Requires: popt = 1.6.3
%description python
The rpm-python package contains a module which permits applications
programs that will manipulate RPM packages and databases.
%endif
+%if %{with_perl_subpackage}
+%package perl
+Summary: Native bindings to the RPM API for Perl.
+Group: Development/Languages
+URL: http://www.cpan.org
+Requires: rpm = %{rpm_version}
+Requires: perl >= 0:5.00503
+Requires: popt = 1.6.3
+Obsoletes: perl-Perl-RPM
+
+%description perl
+The Perl-RPM module is an attempt to provide Perl-level access to the
+complete application programming interface that is a part of the Red
+Hat Package Manager (RPM). Rather than have scripts rely on executing
+RPM commands and parse the resulting output, this module aims to give
+Perl programmers the ability to do anything that would otherwise have
+been done in C or C++.
+
+The interface is being designed and laid out as a collection of
+classes, at least some of which are also available as tied-hash
+implementations.
+
+At this time, the interface only provides access to the database of
+installed packages, and header data retrieval for RPM and SRPM files
+is not yet installed. Error management and the export of most defined
+constants, through RPM::Error and RPM::Constants, respectively, are
+also available.
+
+%endif
+
%package -n popt
Summary: A C library for parsing command line parameters.
Group: Development/Libraries
make
+%if %{with_perl_subpackage}
+{ cd Perl-RPM
+ CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL
+ export SUBDIR="%{_builddir}/%{buildsubdir}"
+ make INC="-I. -I$SUBDIR/lib -I$SUBDIR/rpmio -I$SUBDIR/popt" %{?_smp_mflags}
+}
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
gzip -9n apidocs/man/man*/* || :
%endif
+%if %{with_perl_subpackage}
+{ cd Perl-RPM
+ eval `perl '-V:installsitearch'`
+ eval `perl '-V:installarchlib'`
+ mkdir -p $RPM_BUILD_ROOT/$installarchlib
+ make PREFIX=$RPM_BUILD_ROOT/usr install
+ rm -f $RPM_BUILD_ROOT/$installarchlib/perllocal.pod
+ rm -f $RPM_BUILD_ROOT/$installsitearch/auto/RPM/.packlist
+ cd ..
+}
+%endif
+
%if %{strip_binaries}
{ cd $RPM_BUILD_ROOT
- strip ./bin/rpm
- strip .%{__prefix}/bin/rpm2cpio
+ %{__strip} ./bin/rpm
+ %{__strip} .%{__prefix}/bin/rpm2cpio
}
%endif
%ifarch i386 i486 i586 i686 athlon
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/i[3456]86*
+%attr(-, rpm, rpm) %{__prefix}/lib/rpm/athlon*
%endif
-%ifarch alpha
+%ifarch alpha alphaev5 alphaev56 alphapca56 alphaev6 alphaev67
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/alpha*
%endif
-%ifarch sparc sparc64
+%ifarch sparc sparcv9 sparc64
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/sparc*
%endif
%ifarch ia64
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/ia64*
%endif
-%ifarch powerpc ppc
+%ifarch powerpc ppc ppciseries ppcpseries ppcmac
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/ppc*
%endif
%ifarch s390 s390x
%ifarch armv3l armv4l
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/armv[34][lb]*
%endif
+%ifarch mips mipsel mipseb
+%attr(-, rpm, rpm) %{__prefix}/lib/rpm/mips*
+%endif
%attr(-, rpm, rpm) %{__prefix}/lib/rpm/noarch*
%lang(cs) %{__prefix}/*/locale/cs/LC_MESSAGES/rpm.mo
%files python
%defattr(-,root,root)
%{__prefix}/lib/python1.5/site-packages/rpmmodule.so
+%{__prefix}/lib/python1.5/site-packages/poptmodule.so
+%endif
+
+%if %{with_perl_subpackage}
+%files perl
+%defattr(-,root,root)
+%rpmattr %{__prefix}/bin/rpmprune
+%{perl_sitearch}/auto/*
+%{perl_sitearch}/RPM
+%{perl_sitearch}/RPM.pm
+%{__prefix}%{__share}/man/man1/rpmprune.1*
+%{__prefix}%{__share}/man/man3/RPM*
%endif
%files devel
%if %{strip_binaries}
{ cd $RPM_BUILD_ROOT
- strip ./bin/rpm
- strip .%{__prefix}/bin/rpm2cpio
+ %{__strip} ./bin/rpm
+ %{__strip} .%{__prefix}/bin/rpm2cpio
}
%endif
%ifarch i386 i486 i586 i686 athlon
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/i[3456]86*
+%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/athlon*
%endif
-%ifarch alpha
+%ifarch alpha alphaev5 alphaev56 alphapca56 alphaev6 alphaev67
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/alpha*
%endif
-%ifarch sparc sparc64
+%ifarch sparc sparcv9 sparc64
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/sparc*
%endif
%ifarch ia64
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/ia64*
%endif
-%ifarch powerpc ppc
+%ifarch powerpc ppc ppciseries ppcpseries ppcmac
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/ppc*
%endif
%ifarch s390 s390x
%ifarch armv3l armv4l
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/armv[34][lb]*
%endif
+%ifarch mips mipsel mipseb
+%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/mips*
+%endif
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/noarch*
%lang(cs) %{__prefix}/*/locale/cs/LC_MESSAGES/rpm.mo
%defattr(-,root,root)
%rpmattr %{__prefix}/bin/rpmprune
%{perl_sitearch}/auto/*
+%{perl_sitearch}/RPM
+%{perl_sitearch}/RPM.pm
%{__prefix}%{__share}/man/man1/rpmprune.1*
%{__prefix}%{__share}/man/man3/RPM*
%endif
#/*! \page config_rpmrc Default configuration: /usr/lib/rpm/rpmrc
# \verbatim
#
-# $Id: rpmrc.in,v 2.42 2001/07/24 02:52:52 jbj Exp $
+# $Id: rpmrc.in,v 2.43 2001/07/31 18:13:23 jbj Exp $
#
# This is a global RPM configuration file. All changes made here will
# be lost when the rpm package is upgraded. Any per-system configuration
optflags: hppa1.2 -O2 -mpa-risc-1-0
optflags: hppa2.0 -O2 -mpa-risc-1-0
-optflags: mipseb -O2
+optflags: mips -O2
optflags: mipsel -O2
optflags: armv3l -O2 -fsigned-char -fomit-frame-pointer -march=armv3
arch_canon: sun4d: sparc 3
arch_canon: sparcv9: sparcv9 3
# This is really a place holder for MIPS.
-arch_canon: mipseb: mipseb 4
+arch_canon: mips: mips 4
arch_canon: ppc: ppc 5
arch_canon: ppciseries: ppciseries 5
arch_compat: sparcv9: sparc
arch_compat: sparc: noarch
-arch_compat: mipseb: noarch
+arch_compat: mips: noarch
arch_compat: mipsel: noarch
arch_compat: hppa2.0: hppa1.2
buildarch_compat: ppcmac: noarch
buildarch_compat: ppc: noarch
+buildarch_compat: mips: noarch
buildarch_compat: mipsel: noarch
-buildarch_compat: mipseb: noarch
buildarch_compat: armv3l: noarch
buildarch_compat: armv4b: noarch