diff -uNr rpm5/Makefile rpm52/Makefile --- rpm5/Makefile 2010-11-25 16:22:51.000000000 +0100 +++ rpm52/Makefile 2010-11-25 16:48:39.000000000 +0100 @@ -2,63 +2,65 @@ # Date created: 6 May 2003 # Whom: Greg Lewis # -# $FreeBSD: ports/archivers/rpm5/Makefile,v 1.38 2010/11/09 18:58:24 naddy Exp $ +# $FreeBSD: ports/archivers/rpm5/Makefile,v $ PORTNAME= rpm -PORTVERSION= 5.0.3 -PORTREVISION= 12 +PORTVERSION= 5.2.1 CATEGORIES= archivers -MASTER_SITES= http://rpm5.org/files/rpm/rpm-5.0/ -PATCHFILES= rpm-5.0.3.1.patch -PATCH_SITES= ${MASTER_SITES} +MASTER_SITES= http://rpm5.org/files/rpm/rpm-${PORTVERSION:R}/ MAINTAINER= afb@rpm5.org COMMENT= The RPM Package Manager -LIB_DEPENDS= db-${DB_VERSION:C/(.)/\1./}:${PORTSDIR}/databases/db${DB_VERSION} \ - sqlite3.8:${PORTSDIR}/databases/sqlite3 \ +LIB_DEPENDS= sqlite3.8:${PORTSDIR}/databases/sqlite3 \ popt.0:${PORTSDIR}/devel/popt \ beecrypt.7:${PORTSDIR}/security/beecrypt \ neon.27:${PORTSDIR}/www/neon29 \ magic:${PORTSDIR}/sysutils/file \ xar:${PORTSDIR}/archivers/xar \ pcre.0:${PORTSDIR}/devel/pcre -BUILD_DEPENDS= ${LOCALBASE}/bin/gsed:${PORTSDIR}/textproc/gsed +BUILD_DEPENDS= ${LOCALBASE}/bin/gsed:${PORTSDIR}/textproc/gsed \ + ${LOCALBASE}/lib/libuuid.a:${PORTSDIR}/misc/ossp-uuid .if !defined(NOPORTDOCS) BUILD_DEPENDS+= ${LOCALBASE}/bin/doxygen:${PORTSDIR}/devel/doxygen \ - ${LOCALBASE}/bin/dot:${PORTSDIR}/graphics/graphviz + ${LOCALBASE}/bin/dot:${PORTSDIR}/graphics/graphviz \ + ${LOCALBASE}/lib/X11/fonts/freefont-ttf/FreeSans.ttf:${PORTSDIR}/x11-fonts/freefont-ttf .endif -OPTIONS= PYTHON "Build Python rpm module" On +BUILD_DEPENDS+= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash +SH= ${LOCALBASE}/bin/bash -DB_VERSION?= 45 +OPTIONS= PERL "Build Perl RPM module" Off \ + PYTHON "Build Python rpm module" On + +DB_VERSION?= 47 + +USE_BDB= ${DB_VERSION} USE_AUTOTOOLS= libtool:22 LIBTOOLFILES= configure db3/configure db/dist/configure \ - file/configure zlib/configure xar/configure + file/configure xar/configure USE_GMAKE= yes -USE_GETTEXT= yes -USE_ICONV= yes USE_LDCONFIG= yes USE_PERL5_BUILD=5.8.0+ LATEST_LINK= rpm5 CONFLICTS= rpm-3.* rpm-4.* -# need to autogen (for xz support) -USE_AUTOTOOLS+= aclocal:111 autoconf:268 automake:111 autoheader:268 -ACLOCAL_ARGS+= -I m4 -I ${LOCALBASE}/share/aclocal -AUTOMAKE_ARGS+= -a -c -pre-configure: - cd ${WRKSRC}; ./autogen.sh +.include .if !defined(WITHOUT_LUA) -CONFIGURE_ARGS+=--with-lua=external +CONFIGURE_ARGS+=--with-lua=external \ + --with-syck=external USE_LUA= 5.1- +BUILD_DEPENDS+= ${LOCALBASE}/lib/libsyck.a:${PORTSDIR}/textproc/syck CPPFLAGS+= -I${LUA_INCDIR} LDFLAGS+= -L${LUA_LIBDIR} .else -CONFIGURE_ARGS+=--without-lua +CONFIGURE_ARGS+=--without-lua \ + --without-syck .endif +CONFIGURE_ARGS+=--without-js + .if defined(WITH_PERL) CONFIGURE_ARGS+=--with-perl CONFIGURE_ENV+=__PERL=${PERL} @@ -83,14 +85,18 @@ .if defined(WITHOUT_NLS) CONFIGURE_ARGS+=--disable-nls +.else +CONFIGURE_ARGS+=--enable-nls +USE_GETTEXT= yes +USE_ICONV= yes .endif .if !defined(NOPORTDOCS) CONFIGURE_ARGS+=--with-apidocs .endif -CPPFLAGS+= -I${LOCALBASE}/include/db${DB_VERSION} -I${LOCALBASE}/include -I${LOCALBASE}/include/xar -LDFLAGS+= -L${LOCALBASE}/lib/db${DB_VERSION} -L${LOCALBASE}/lib +CPPFLAGS+= -I${BDB_INCLUDE_DIR} -I${LOCALBASE}/include -I${LOCALBASE}/include/xar +LDFLAGS+= -L${BDB_LIB_DIR} -L${LOCALBASE}/lib CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" CONFIGURE_ARGS+=--with-db=external --with-bugreport="${MAINTAINER}" \ @@ -100,14 +106,15 @@ --with-xar=external \ --with-xz=external \ --with-pcre=external \ + --with-uuid=external \ --program-prefix="" \ --sysconfdir=${PREFIX}/etc \ --with-path-cfg=${PREFIX}/etc/rpm \ - --without-javaglue + --with-path-magic=${LOCALBASE}/share/file/magic MAN1= gendiff.1 MAN8= rpm.8 rpm2cpio.8 rpmbuild.8 rpmconstant.8 \ - rpmcache.8 rpmdeps.8 rpmgraph.8 + rpmcache.8 rpmdeps.8 .if defined(WITH_PERL) MAN3= RPM.3 RPM::Constant.3 RPM::Dependencies.3 \ RPM::Files.3 RPM::Header.3 RPM::PackageIterator.3 \ @@ -125,25 +132,19 @@ LIB_DEPENDS+= lzma:${PORTSDIR}/archivers/xz .endif -.if ${ARCH} == "amd64" -CFLAGS+= -fPIC -.endif - post-patch:: @${REINPLACE_CMD} -E -e \ 's:\$$\(libdir\)/pkgconfig:${PREFIX}/libdata/pkgconfig:' \ ${WRKSRC}/scripts/Makefile.am ${WRKSRC}/scripts/Makefile.in @${REINPLACE_CMD} -e "s:/bin/sh:/usr/bin/env bash:" \ ${WRKSRC}/scripts/gendiff - @${REINPLACE_CMD} -e 's:AC_DEFUN:m4_define:g' ${WRKSRC}/configure.ac - @${REINPLACE_CMD} -e 's:pkgincHEADERS_INSTALL:INSTALL_HEADER:' \ - ${WRKSRC}/rpmdb/Makefile.am -.if defined(WITH_PERL) post-configure: +.if defined(WITH_PERL) @cd ${CONFIGURE_WRKSRC}/perl && \ ${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile .endif + @echo "DOT_FONTPATH = ${LOCALBASE}/lib/X11/fonts/freefont-ttf" >> ${WRKSRC}/Doxyfile .if ${OSVERSION} < 700000 # on FreeBSD 6.x, first requires (for NGROUPS) @@ -152,12 +153,10 @@ ${WRKSRC}/config.h .endif -post-build: .if !defined(NOPORTDOCS) +post-build: ${MAKE} -C ${WRKSRC} apidocs .endif - ${REINPLACE_CMD} -e "s:%{_rpmhome}/magic:${LOCALBASE}/share/file/magic:" \ - ${WRKSRC}/macros post-install: .if !defined(NOPORTDOCS) @@ -171,4 +170,3 @@ ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} POST-INSTALL .include -# DO NOT DELETE diff -uNr rpm5/distinfo rpm52/distinfo --- rpm5/distinfo 2009-08-14 21:57:54.000000000 +0200 +++ rpm52/distinfo 2010-11-25 16:21:34.000000000 +0100 @@ -1,6 +1,3 @@ -MD5 (rpm-5.0.3.tar.gz) = b3df4e54e84cf3344ce6b76fa2a8d5bf -SHA256 (rpm-5.0.3.tar.gz) = 224d15c52511b453b2a63e6447b279a622c03af5fe373a67757979f4d00cd042 -SIZE (rpm-5.0.3.tar.gz) = 9337992 -MD5 (rpm-5.0.3.1.patch) = 4f572f9eaf70c8f7884495fd56217f3b -SHA256 (rpm-5.0.3.1.patch) = 868633cf46089b19f5770021ec779e155a1547321734bbc4fc995cbfc02e7099 -SIZE (rpm-5.0.3.1.patch) = 483 +MD5 (rpm-5.2.1.tar.gz) = 71f825ede4a2ddc191132ae017c9a6e4 +SHA256 (rpm-5.2.1.tar.gz) = ce301adc959b5139ae0c9e83af315ed11049efd081cc7ca9b2f7a8f3026e108c +SIZE (rpm-5.2.1.tar.gz) = 15544959 diff -uNr rpm5/files/patch-configure.ac rpm52/files/patch-configure.ac --- rpm5/files/patch-configure.ac 2010-09-23 12:48:04.000000000 +0200 +++ rpm52/files/patch-configure.ac 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ ---- configure.ac.orig 2010-09-22 23:22:07.000000000 +0200 -+++ configure.ac 2010-09-22 23:41:59.000000000 +0200 -@@ -809,14 +809,14 @@ - AC_ARG_WITH(python, AS_HELP_STRING([--with-python], [build with RPM Python language bindings]), [ - if test ".$withval" != .no; then - case "$withval" in -- 2.x|2.3|2.4|2.5) -+ 2.x|2.3|2.4|2.5|2.6|2.7) - python_version=$withval - ;; - yes) -- python_version="2.5 2.4 2.3 2.x" -+ python_version="2.7 2.6 2.5 2.4 2.3 2.x" - ;; - *) -- AC_MSG_WARN([--with-python only supports values 2.x, 2.3, 2.4, or 2.5, ignoring...]) -+ AC_MSG_WARN([--with-python only supports values 2.x, 2.3, 2.4, 2.5, 2.6, or 2.7, ignoring...]) - python_version="" - ;; - esac -@@ -894,9 +894,9 @@ - done - 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()'`"]) -+ [WITH_PYTHON_INCDIR="$withval"], [WITH_PYTHON_INCDIR="`${__PYTHON} -c 'from distutils.sysconfig import get_python_inc; print get_python_inc()'`"]) - AC_ARG_WITH(python-lib-dir, AS_HELP_STRING([--with-python-lib-dir=DIR], [directory with Python library]), -- [WITH_PYTHON_LIBDIR="$withval"], [WITH_PYTHON_LIBDIR="`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`"]) -+ [WITH_PYTHON_LIBDIR="$withval"], [WITH_PYTHON_LIBDIR="`${__PYTHON} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`"]) - ]) - AC_SUBST(WITH_PYTHON_SUBDIR) - AC_SUBST(WITH_PYTHON_SUBPACKAGE) diff -uNr rpm5/files/patch-tools-rpmdigest.c rpm52/files/patch-tools-rpmdigest.c --- rpm5/files/patch-tools-rpmdigest.c 1970-01-01 01:00:00.000000000 +0100 +++ rpm52/files/patch-tools-rpmdigest.c 2010-11-25 16:39:12.000000000 +0100 @@ -0,0 +1,11 @@ +--- tools/rpmdigest.c.orig 2009-01-16 21:47:11.000000000 +0100 ++++ tools/rpmdigest.c 2010-09-13 21:30:57.000000000 +0200 +@@ -887,7 +887,7 @@ + When checking, the input should be a former output of this program. The\n\ + default mode is to print a line with digest, a character indicating type\n\ + (`*' for binary, ` ' for text), and name for each FILE.\n\ +-"), NULL }, ++\0"), NULL }, /* embed NUL to work around expandMacro bug in Doxygen 1.7.1 */ + + POPT_TABLEEND + }; diff -uNr rpm5/files/patch-xz-support rpm52/files/patch-xz-support --- rpm5/files/patch-xz-support 2009-10-22 15:27:20.000000000 +0200 +++ rpm52/files/patch-xz-support 1970-01-01 01:00:00.000000000 +0100 @@ -1,650 +0,0 @@ -diff -urp build/pack.c.orig build/pack.c ---- build/pack.c.orig 2008-01-29 14:57:33.000000000 +0100 -+++ build/pack.c 2009-06-08 10:54:15.000000000 +0200 -@@ -672,6 +672,13 @@ rpmRC writeRPM(Header *hdrp, unsigned ch - he->c = 1; - xx = headerPut(h, he, 0); - (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.6-1"); -+ } else if (s[1] == 'x' && s[2] == 'z') { -+ he->tag = RPMTAG_PAYLOADCOMPRESSOR; -+ he->t = RPM_STRING_TYPE; -+ he->p.str = "xz"; -+ he->c = 1; -+ xx = headerPut(h, he, 0); -+ (void) rpmlibNeedsFeature(h, "PayloadIsXz", "5.2-1"); - } - strcpy(buf, rpmio_flags); - buf[s - rpmio_flags] = '\0'; -diff -urp build/parsePrep.c.orig build/parsePrep.c ---- build/parsePrep.c.orig 2007-12-31 17:21:47.000000000 +0100 -+++ build/parsePrep.c 2009-04-06 08:38:11.000000000 +0200 -@@ -159,6 +159,9 @@ static char *doPatch(Spec spec, int c, i - case COMPRESSED_LZMA: - zipper = "%{__lzma}"; - break; -+ case COMPRESSED_XZ: -+ zipper = "%{__xz}"; -+ break; - } - zipper = rpmGetPath(zipper, NULL); - -@@ -289,6 +292,9 @@ _rpmmg_debug = 0; - case COMPRESSED_LZMA: - t = "%{__lzma} -dc"; - break; -+ case COMPRESSED_XZ: -+ t = "%{__xz} -dc"; -+ break; - case COMPRESSED_ZIP: - if (rpmIsVerbose() && !quietly) - t = "%{__unzip}"; -diff -urp configure.ac.orig configure.ac ---- configure.ac.orig 2008-03-03 09:41:37.000000000 +0100 -+++ configure.ac 2009-07-29 10:21:26.000000000 +0200 -@@ -469,6 +469,7 @@ AC_PATH_PROG(__TCLSH, tclsh, %{_bindir}/ - AC_PATH_PROG(__UNZIP, unzip, %{_bindir}/unzip, $MYPATH) - AC_PATH_PROG(__WGET, wget, %{_bindir}/wget, $MYPATH) - AC_PATH_PROG(__XAR, xar, %{_bindir}/xar, $MYPATH) -+AC_PATH_PROG(__XZ, xz, %{_bindir}/xz, $MYPATH) - AC_PATH_PROG(__LD, ld, %{_bindir}/ld, $MYPATH) - AC_PATH_PROG(__NM, nm, %{_bindir}/nm, $MYPATH) - AC_PATH_PROG(__OBJCOPY, objcopy, %{_bindir}/objcopy, $MYPATH) -@@ -927,6 +928,13 @@ RPM_CHECK_LIB( - [no,external:none], [], - [], []) - -+dnl # LZMA Utils -+RPM_CHECK_LIB( -+ [XZ libLZMA], [xz], -+ [lzma], [lzma_auto_decoder], [lzma.h], -+ [no,external:none], [], -+ [], []) -+ - dnl # BeeCrypt - RPM_CHECK_LIB( - [BeeCrypt], [beecrypt], -diff -urp lib/psm.c.orig lib/psm.c ---- lib/psm.c.orig 2008-02-05 21:23:53.000000000 +0100 -+++ lib/psm.c 2009-04-06 08:38:13.000000000 +0200 -@@ -2408,6 +2408,8 @@ psm->te->h = headerFree(psm->te->h); - t = stpcpy(t, ".bzdio"); - if (!strcmp(payload_compressor, "lzma")) - t = stpcpy(t, ".lzdio"); -+ if (!strcmp(payload_compressor, "xz")) -+ t = stpcpy(t, ".xzdio"); - payload_compressor = _free(payload_compressor); - - he->tag = RPMTAG_PAYLOADFORMAT; -diff -urp lib/rpmds.c.orig lib/rpmds.c ---- lib/rpmds.c.orig 2007-12-15 12:17:03.000000000 +0100 -+++ lib/rpmds.c 2009-04-06 08:38:13.000000000 +0200 -@@ -1391,6 +1391,11 @@ static struct rpmlibProvides_s rpmlibPro - { "rpmlib(FileDigestParameterized)", "4.4.6-1", - (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), - N_("file digests can be other than MD5.") }, -+#if defined(HAVE_LZMA_H) -+ { "rpmlib(PayloadIsXz)", "5.2-1", -+ (RPMSENSE_RPMLIB|RPMSENSE_EQUAL), -+ N_("package payload can be compressed using xz.") }, -+#endif - { NULL, NULL, 0, NULL } - }; - -diff -urp macros.in.orig macros.in ---- macros.in.orig 2008-03-03 09:41:19.000000000 +0100 -+++ macros.in 2009-07-29 10:13:06.000000000 +0200 -@@ -93,6 +93,7 @@ - %__vcheck %{__perl} %{_rpmhome}/vcheck - %__wget @__WGET@ - %__xar @__XAR@ -+%__xz @__XZ@ - - #============================================================================== - # ---- Build system path macros. -diff -urp rpmio/macro.c.orig rpmio/macro.c ---- rpmio/macro.c.orig 2008-02-05 21:23:56.000000000 +0100 -+++ rpmio/macro.c 2009-04-13 09:20:07.000000000 +0200 -@@ -1314,6 +1314,9 @@ doFoo(MacroBuf mb, int negate, const cha - case 5: /* COMPRESSED_LZMA */ - sprintf(be, "%%__lzma -dc '%s'", b); - break; -+ case 6: /* COMPRESSED_XZ */ -+ sprintf(be, "%%__xz -dc '%s'", b); -+ break; - } - b = be; - } else if (STREQ("mkstemp", f, fn)) { -@@ -2414,6 +2417,10 @@ int isCompressed(const char * file, rpmC - magic[11] == (unsigned char) 0x00 && magic[12] == (unsigned char) 0x00) /* lzmash */ - *compressed = COMPRESSED_LZMA; - else -+ if (magic[0] == (unsigned char) 0xFD && magic[1] == 0x37 && magic[2] == 0x7A -+ && magic[3] == 0x58 && magic[4] == 0x5A && magic[5] == 0x00) /* xz */ -+ *compressed = COMPRESSED_XZ; -+ else - if ((magic[0] == (unsigned char) 0037 && magic[1] == (unsigned char) 0213) /* gzip */ - || (magic[0] == (unsigned char) 0037 && magic[1] == (unsigned char) 0236) /* old gzip */ - || (magic[0] == (unsigned char) 0037 && magic[1] == (unsigned char) 0036) /* pack */ -diff -urp rpmio/rpmio.c.orig rpmio/rpmio.c ---- rpmio/rpmio.c.orig 2008-01-29 14:57:50.000000000 +0100 -+++ rpmio/rpmio.c 2009-07-29 11:57:14.000000000 +0200 -@@ -216,6 +216,10 @@ static /*@observer@*/ const char * fdbg( - #endif - } else if (fps->io == lzdio) { - sprintf(be, "LZD %p fdno %d", fps->fp, fps->fdno); -+#if defined(HAVE_LZMA_H) -+ } else if (fps->io == xzdio) { -+ sprintf(be, "XZD %p fdno %d", fps->fp, fps->fdno); -+#endif - } else if (fps->io == fpio) { - /*@+voidabstract@*/ - sprintf(be, "%s %p(%d) fdno %d", -@@ -3079,6 +3083,422 @@ static struct FDIO_s lzdio_s = { - FDIO_t lzdio = /*@-compmempass@*/ &lzdio_s /*@=compmempass@*/ ; - - /* =============================================================== */ -+/* Support for LZMA compression library. -+ */ -+#if defined(HAVE_LZMA_H) -+ -+/* provide necessary defines for inclusion of -+ similar to LZMAUtils's internal and as -+ explicitly stated in the top-level comment of */ -+#ifndef UINT32_C -+# define UINT32_C(n) n ## U -+#endif -+#ifndef UINT32_MAX -+# define UINT32_MAX UINT32_C(4294967295) -+#endif -+#if SIZEOF_UNSIGNED_LONG == 4 -+# ifndef UINT64_C -+# define UINT64_C(n) n ## ULL -+# endif -+#else -+# ifndef UINT64_C -+# define UINT64_C(n) n ## UL -+# endif -+#endif -+#ifndef UINT64_MAX -+# define UINT64_MAX UINT64_C(18446744073709551615) -+#endif -+ -+#include "lzma.h" -+ -+#ifndef LZMA_PRESET_DEFAULT -+#define LZMA_PRESET_DEFAULT UINT32_C(6) -+#endif -+ -+/*@access FD_t @*/ -+ -+#define XZDONLY(fd) assert(fdGetIo(fd) == xzdio) -+ -+#define kBufferSize (1 << 15) -+ -+typedef struct xzfile { -+/*@only@*/ -+ uint8_t buf[kBufferSize]; /*!< IO buffer */ -+ lzma_stream strm; /*!< LZMA stream */ -+/*@dependent@*/ -+ FILE * fp; -+ int encoding; -+ int eof; -+} XZFILE; -+ -+/*@-globstate@*/ -+/*@null@*/ -+static XZFILE *xzopen_internal(const char *path, const char *mode, int fdno, int xz) -+ /*@globals fileSystem @*/ -+ /*@modifies fileSystem @*/ -+{ -+ int level = LZMA_PRESET_DEFAULT; -+ int encoding = 0; -+ FILE *fp; -+ XZFILE *xzfile; -+ lzma_stream tmp; -+ lzma_ret ret; -+ -+ for (; *mode != '\0'; mode++) { -+ if (*mode == 'w') -+ encoding = 1; -+ else if (*mode == 'r') -+ encoding = 0; -+ else if (*mode >= '0' && *mode <= '9') -+ level = (int)(*mode - '0'); -+ } -+ if (fdno != -1) -+ fp = fdopen(fdno, encoding ? "w" : "r"); -+ else -+ fp = fopen(path, encoding ? "w" : "r"); -+ if (!fp) -+ return NULL; -+ xzfile = calloc(1, sizeof(*xzfile)); -+ if (!xzfile) { -+ (void) fclose(fp); -+ return NULL; -+ } -+ xzfile->fp = fp; -+ xzfile->encoding = encoding; -+ xzfile->eof = 0; -+ tmp = (lzma_stream)LZMA_STREAM_INIT; -+ xzfile->strm = tmp; -+ if (encoding) { -+ if (xz) { -+ ret = lzma_easy_encoder(&xzfile->strm, level, LZMA_CHECK_CRC32); -+ } else { -+ lzma_options_lzma options; -+ (void) lzma_lzma_preset(&options, level); -+ ret = lzma_alone_encoder(&xzfile->strm, &options); -+ } -+ } else { -+ /* We set the memlimit for decompression to 100MiB which should be -+ * more than enough to be sufficient for level 9 which requires 65 MiB. -+ */ -+ ret = lzma_auto_decoder(&xzfile->strm, 100<<20, 0); -+ } -+ if (ret != LZMA_OK) { -+ (void) fclose(fp); -+ memset(xzfile, 0, sizeof(*xzfile)); -+ free(xzfile); -+ return NULL; -+ } -+ return xzfile; -+} -+/*@=globstate@*/ -+ -+/*@null@*/ -+static XZFILE *xzopen(const char *path, const char *mode) -+ /*@globals fileSystem @*/ -+ /*@modifies fileSystem @*/ -+{ -+ return xzopen_internal(path, mode, -1, 1); -+} -+ -+/*@null@*/ -+static XZFILE *xzdopen(int fdno, const char *mode) -+ /*@globals fileSystem @*/ -+ /*@modifies fileSystem @*/ -+{ -+ if (fdno < 0) -+ return NULL; -+ return xzopen_internal(0, mode, fdno, 1); -+} -+ -+static int xzflush(XZFILE *xzfile) -+ /*@globals fileSystem @*/ -+ /*@modifies xzfile, fileSystem @*/ -+{ -+ return fflush(xzfile->fp); -+} -+ -+static int xzclose(/*@only@*/ XZFILE *xzfile) -+ /*@globals fileSystem @*/ -+ /*@modifies *xzfile, fileSystem @*/ -+{ -+ lzma_ret ret; -+ size_t n; -+ int rc; -+ -+ if (!xzfile) -+ return -1; -+ if (xzfile->encoding) { -+ for (;;) { -+ xzfile->strm.avail_out = kBufferSize; -+ xzfile->strm.next_out = (uint8_t *)xzfile->buf; -+ ret = lzma_code(&xzfile->strm, LZMA_FINISH); -+ if (ret != LZMA_OK && ret != LZMA_STREAM_END) -+ return -1; -+ n = kBufferSize - xzfile->strm.avail_out; -+ if (n && fwrite(xzfile->buf, 1, n, xzfile->fp) != n) -+ return -1; -+ if (ret == LZMA_STREAM_END) -+ break; -+ } -+ } -+ lzma_end(&xzfile->strm); -+ rc = fclose(xzfile->fp); -+ memset(xzfile, 0, sizeof(*xzfile)); -+ free(xzfile); -+ return rc; -+} -+ -+/*@-mustmod@*/ -+static ssize_t xzread(XZFILE *xzfile, void *buf, size_t len) -+ /*@globals fileSystem @*/ -+ /*@modifies xzfile, *buf, fileSystem @*/ -+{ -+ lzma_ret ret; -+ int eof = 0; -+ -+ if (!xzfile || xzfile->encoding) -+ return -1; -+ if (xzfile->eof) -+ return 0; -+/*@-temptrans@*/ -+ xzfile->strm.next_out = buf; -+/*@=temptrans@*/ -+ xzfile->strm.avail_out = len; -+ for (;;) { -+ if (!xzfile->strm.avail_in) { -+ xzfile->strm.next_in = (uint8_t *)xzfile->buf; -+ xzfile->strm.avail_in = fread(xzfile->buf, 1, kBufferSize, xzfile->fp); -+ if (!xzfile->strm.avail_in) -+ eof = 1; -+ } -+ ret = lzma_code(&xzfile->strm, LZMA_RUN); -+ if (ret == LZMA_STREAM_END) { -+ xzfile->eof = 1; -+ return len - xzfile->strm.avail_out; -+ } -+ if (ret != LZMA_OK) -+ return -1; -+ if (!xzfile->strm.avail_out) -+ return len; -+ if (eof) -+ return -1; -+ } -+ /*@notreached@*/ -+} -+/*@=mustmod@*/ -+ -+static ssize_t xzwrite(XZFILE *xzfile, void *buf, size_t len) -+ /*@globals fileSystem @*/ -+ /*@modifies xzfile, fileSystem @*/ -+{ -+ lzma_ret ret; -+ size_t n; -+ -+ if (!xzfile || !xzfile->encoding) -+ return -1; -+ if (!len) -+ return 0; -+/*@-temptrans@*/ -+ xzfile->strm.next_in = buf; -+/*@=temptrans@*/ -+ xzfile->strm.avail_in = len; -+ for (;;) { -+ xzfile->strm.next_out = (uint8_t *)xzfile->buf; -+ xzfile->strm.avail_out = kBufferSize; -+ ret = lzma_code(&xzfile->strm, LZMA_RUN); -+ if (ret != LZMA_OK) -+ return -1; -+ n = kBufferSize - xzfile->strm.avail_out; -+ if (n && fwrite(xzfile->buf, 1, n, xzfile->fp) != n) -+ return -1; -+ if (!xzfile->strm.avail_in) -+ return len; -+ } -+ /*@notreached@*/ -+} -+ -+/* =============================================================== */ -+ -+static inline /*@dependent@*/ /*@null@*/ void * xzdFileno(FD_t fd) -+ /*@*/ -+{ -+ void * rc = NULL; -+ int i; -+ -+ FDSANE(fd); -+ for (i = fd->nfps; i >= 0; i--) { -+/*@-boundsread@*/ -+ FDSTACK_t * fps = &fd->fps[i]; -+/*@=boundsread@*/ -+ if (fps->io != xzdio && fps->io != lzdio) -+ continue; -+ rc = fps->fp; -+ break; -+ } -+ -+ return rc; -+} -+ -+/*@-globuse@*/ -+static /*@null@*/ FD_t xzdOpen(const char * path, const char * fmode) -+ /*@globals fileSystem @*/ -+ /*@modifies fileSystem @*/ -+{ -+ FD_t fd; -+ mode_t mode = (fmode && fmode[0] == 'w' ? O_WRONLY : O_RDONLY); -+ XZFILE * xzfile = xzopen(path, fmode); -+ -+ if (xzfile == NULL) -+ return NULL; -+ fd = fdNew("open (xzdOpen)"); -+ fdPop(fd); fdPush(fd, xzdio, xzfile, -1); -+ fdSetOpen(fd, path, fileno(xzfile->fp), mode); -+ return fdLink(fd, "xzdOpen"); -+} -+/*@=globuse@*/ -+ -+/*@-globuse@*/ -+static /*@null@*/ FD_t xzdFdopen(void * cookie, const char * fmode) -+ /*@globals fileSystem, internalState @*/ -+ /*@modifies fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ int fdno = fdFileno(fd); -+ XZFILE *xzfile; -+ -+assert(fmode != NULL); -+ fdSetFdno(fd, -1); /* XXX skip the fdio close */ -+ if (fdno < 0) return NULL; -+ xzfile = xzdopen(fdno, fmode); -+ if (xzfile == NULL) return NULL; -+ fdPush(fd, xzdio, xzfile, fdno); -+ return fdLink(fd, "xzdFdopen"); -+} -+/*@=globuse@*/ -+ -+/*@-globuse@*/ -+static int xzdFlush(void * cookie) -+ /*@globals fileSystem @*/ -+ /*@modifies fileSystem @*/ -+{ -+ FD_t fd = c2f(cookie); -+ return xzflush(xzdFileno(fd)); -+} -+/*@=globuse@*/ -+ -+/* =============================================================== */ -+/*@-globuse@*/ -+/*@-mustmod@*/ /* LCL: *buf is modified */ -+static ssize_t xzdRead(void * cookie, /*@out@*/ char * buf, size_t count) -+ /*@globals fileSystem, internalState @*/ -+ /*@modifies *buf, fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ XZFILE *xzfile; -+ ssize_t rc = -1; -+ -+assert(fd != NULL); -+ if (fd->bytesRemain == 0) return 0; /* XXX simulate EOF */ -+ xzfile = xzdFileno(fd); -+assert(xzfile != NULL); -+ fdstat_enter(fd, FDSTAT_READ); -+/*@-compdef@*/ -+ rc = xzread(xzfile, buf, count); -+/*@=compdef@*/ -+DBGIO(fd, (stderr, "==>\txzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd))); -+ if (rc == -1) { -+ fd->errcookie = "Lzma: decoding error"; -+ } else if (rc >= 0) { -+ fdstat_exit(fd, FDSTAT_READ, rc); -+ /*@-compdef@*/ -+ if (fd->ndigests && rc > 0) fdUpdateDigests(fd, (void *)buf, rc); -+ /*@=compdef@*/ -+ } -+ return rc; -+} -+/*@=mustmod@*/ -+/*@=globuse@*/ -+ -+/*@-globuse@*/ -+static ssize_t xzdWrite(void * cookie, const char * buf, size_t count) -+ /*@globals fileSystem, internalState @*/ -+ /*@modifies fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ XZFILE *xzfile; -+ ssize_t rc = 0; -+ -+ if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */ -+ -+ if (fd->ndigests && count > 0) fdUpdateDigests(fd, (void *)buf, count); -+ -+ xzfile = xzdFileno(fd); -+ -+ fdstat_enter(fd, FDSTAT_WRITE); -+ rc = xzwrite(xzfile, (void *)buf, count); -+DBGIO(fd, (stderr, "==>\txzdWrite(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd))); -+ if (rc < 0) { -+ fd->errcookie = "Lzma: encoding error"; -+ } else if (rc > 0) { -+ fdstat_exit(fd, FDSTAT_WRITE, rc); -+ } -+ return rc; -+} -+ -+static inline int xzdSeek(void * cookie, /*@unused@*/ _libio_pos_t pos, -+ /*@unused@*/ int whence) -+ /*@*/ -+{ -+ FD_t fd = c2f(cookie); -+ -+ XZDONLY(fd); -+ return -2; -+} -+ -+static int xzdClose( /*@only@*/ void * cookie) -+ /*@globals fileSystem, internalState @*/ -+ /*@modifies fileSystem, internalState @*/ -+{ -+ FD_t fd = c2f(cookie); -+ XZFILE *xzfile; -+ const char * errcookie; -+ int rc; -+ -+ xzfile = xzdFileno(fd); -+ -+ if (xzfile == NULL) return -2; -+ errcookie = strerror(ferror(xzfile->fp)); -+ -+ fdstat_enter(fd, FDSTAT_CLOSE); -+ /*@-dependenttrans@*/ -+ rc = xzclose(xzfile); -+ /*@=dependenttrans@*/ -+ fdstat_exit(fd, FDSTAT_CLOSE, rc); -+ -+ if (fd && rc == -1) -+ fd->errcookie = errcookie; -+ -+DBGIO(fd, (stderr, "==>\txzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd))); -+ -+ if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "XZDIO", stderr); -+ /*@-branchstate@*/ -+ if (rc == 0) -+ fd = fdFree(fd, "open (xzdClose)"); -+ /*@=branchstate@*/ -+ return rc; -+} -+ -+/*@-type@*/ /* LCL: function typedefs */ -+static struct FDIO_s xzdio_s = { -+ xzdRead, xzdWrite, xzdSeek, xzdClose, xzdOpen, xzdFdopen, xzdFlush, -+}; -+/*@=type@*/ -+ -+FDIO_t xzdio = /*@-compmempass@*/ &xzdio_s /*@=compmempass@*/ ; -+ -+#endif /* HAVE_LZMA_H */ -+ -+/* =============================================================== */ - /*@observer@*/ - static const char * getFdErrstr (FD_t fd) - /*@*/ -@@ -3099,6 +3519,11 @@ static const char * getFdErrstr (FD_t fd - if (fdGetIo(fd) == lzdio) { - errstr = fd->errcookie; - } else -+#ifdef HAVE_LZMA_H -+ if (fdGetIo(fd) == xzdio) { -+ errstr = fd->errcookie; -+ } else -+#endif - { - errstr = (fd->syserrno ? strerror(fd->syserrno) : ""); - } -@@ -3416,6 +3841,11 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n" - } else if (!strcmp(end, "lzdio")) { - iof = lzdio; - fd = lzdFdopen(fd, zstdio); -+#if defined(HAVE_LZMA_H) -+ } else if (!strcmp(end, "xzdio")) { -+ iof = xzdio; -+ fd = xzdFdopen(fd, zstdio); -+#endif - } else if (!strcmp(end, "ufdio")) { - iof = ufdio; - } else if (!strcmp(end, "fpio")) { -@@ -3568,6 +3998,10 @@ int Fflush(FD_t fd) - if (vh && fdGetIo(fd) == bzdio) - return bzdFlush(vh); - #endif -+#if defined(HAVE_LZMA_H) -+ if (vh && fdGetIo(fd) == xzdio) -+ return xzdFlush(vh); -+#endif - - return 0; - } -@@ -3602,6 +4036,11 @@ int Ferror(FD_t fd) - } else if (fps->io == lzdio) { - ec = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0; - i--; /* XXX fdio under lzdio always has fdno == -1 */ -+#if defined(HAVE_LZMA_H) -+ } else if (fps->io == xzdio) { -+ ec = (fd->syserrno || fd->errcookie != NULL) ? -1 : 0; -+ i--; /* XXX fdio under xzdio always has fdno == -1 */ -+#endif - } else { - /* XXX need to check ufdio/gzdio/bzdio/fdio errors correctly. */ - ec = (fdFileno(fd) < 0 ? -1 : 0); -diff -urp rpmio/rpmio.h.orig rpmio/rpmio.h ---- rpmio/rpmio.h.orig 2007-12-09 14:04:30.000000000 +0100 -+++ rpmio/rpmio.h 2009-04-06 08:38:33.000000000 +0200 -@@ -793,6 +793,10 @@ int ufdGetFile( /*@killref@*/ FD_t sfd, - - /** - */ -+/*@observer@*/ /*@unchecked@*/ extern FDIO_t xzdio; -+ -+/** -+ */ - /*@observer@*/ /*@unchecked@*/ extern FDIO_t fadio; - /*@=exportlocal@*/ - /*@}*/ -diff -urp rpmio/rpmmacro.h.orig rpmio/rpmmacro.h ---- rpmio/rpmmacro.h.orig 2008-01-29 14:57:50.000000000 +0100 -+++ rpmio/rpmmacro.h 2009-04-06 08:38:33.000000000 +0200 -@@ -208,7 +208,8 @@ typedef enum rpmCompressedMagic_e { - COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */ - COMPRESSED_ZIP = 3, /*!< unzip can handle */ - COMPRESSED_LZOP = 4, /*!< lzop can handle */ -- COMPRESSED_LZMA = 5 /*!< lzma can handle */ -+ COMPRESSED_LZMA = 5, /*!< lzma can handle */ -+ COMPRESSED_XZ = 6 /*!< xz can handle */ - } rpmCompressedMagic; - - /** -diff -urp tools/rpm2cpio.c.orig tools/rpm2cpio.c ---- tools/rpm2cpio.c.orig 2007-12-09 14:04:30.000000000 +0100 -+++ tools/rpm2cpio.c 2009-04-06 08:38:33.000000000 +0200 -@@ -89,6 +89,8 @@ int main(int argc, char **argv) - t = stpcpy(t, ".bzdio"); - if (!strcmp(payload_compressor, "lzma")) - t = stpcpy(t, ".lzdio"); -+ if (!strcmp(payload_compressor, "xz")) -+ t = stpcpy(t, ".xzdio"); - he->p.ptr = _free(he->p.ptr); - } - diff -uNr rpm5/pkg-install rpm52/pkg-install --- rpm5/pkg-install 2008-07-07 15:19:15.000000000 +0200 +++ rpm52/pkg-install 2010-11-25 16:39:47.000000000 +0100 @@ -6,14 +6,13 @@ # Provide instructions for initialising the RPM database. if [ "$2" = "POST-INSTALL" ]; then - if [ ! -d "${RPM_DATABASE_DIR}" ]; then -# echo "" -# echo "No RPM database found. If you wish to use RPM to install" -# echo "RPM packages the you will need to initialise the database" -# echo "with the commands:" -# echo "" -# echo " mkdir -p ${RPM_DATABASE_DIR}" -# echo " ${PKG_PREFIX}/bin/rpm --initdb" -# echo "" + if [ -d "${RPM_DATABASE_DIR}" ]; then + echo "" + echo "Old RPM database found. If you are upgrading RPM from a" + echo "different version of Berkeley DB, you might need to rebuild" + echo "with the command:" + echo "" + echo " ${PKG_PREFIX}/bin/rpm --rebuilddb" + echo "" fi fi diff -uNr rpm5/pkg-plist rpm52/pkg-plist --- rpm5/pkg-plist 2009-01-29 04:33:36.000000000 +0100 +++ rpm52/pkg-plist 2010-11-25 16:21:34.000000000 +0100 @@ -4,80 +4,72 @@ bin/rpmbuild bin/rpmconstant -include/rpm/argv.h include/rpm/db.h -include/rpm/envvar.h -include/rpm/fs.h -include/rpm/fts.h include/rpm/mire.h -include/rpm/misc.h include/rpm/pkgio.h include/rpm/rpm4compat.h -include/rpm/rpmal.h -include/rpm/rpmbc.h +include/rpm/rpm46compat.h include/rpm/rpmbuild.h include/rpm/rpmcb.h include/rpm/rpmcli.h include/rpm/rpmconstant.h -include/rpm/rpmdav.h include/rpm/rpmdb.h -include/rpm/rpmdpkg.h include/rpm/rpmds.h include/rpm/rpmevr.h -include/rpm/rpmfc.h include/rpm/rpmfi.h -include/rpm/rpmgi.h -include/rpm/rpmhash.h -include/rpm/rpmio-stub.h include/rpm/rpmio.h -include/rpm/rpmlib.h +include/rpm/rpmiotypes.h include/rpm/rpmlog.h include/rpm/rpmmacro.h -include/rpm/rpmmg.h include/rpm/rpmns.h -include/rpm/rpmnss.h include/rpm/rpmpgp.h include/rpm/rpmps.h +include/rpm/rpmrc.h include/rpm/rpmspec.h -include/rpm/rpmsq.h -include/rpm/rpmssl.h include/rpm/rpmsw.h include/rpm/rpmsx.h include/rpm/rpmtag.h include/rpm/rpmte.h include/rpm/rpmts.h -include/rpm/rpmurl.h +include/rpm/rpmtypes.h include/rpm/rpmversion.h -include/rpm/rpmwf.h -include/rpm/rpmxar.h -include/rpm/signature.h -include/rpm/stringbuf.h -include/rpm/ugid.h +include/rpm/rpmzlog.h +include/rpm/yarn.h -lib/librpm-5.0.so +lib/librpm-5.2.so lib/librpm.a lib/librpm.la lib/librpm.so -lib/librpmbuild-5.0.so +lib/librpmbuild-5.2.so lib/librpmbuild.a lib/librpmbuild.la lib/librpmbuild.so -lib/librpmconstant-5.0.so +lib/librpmconstant-5.2.so lib/librpmconstant.a lib/librpmconstant.la lib/librpmconstant.so -lib/librpmdb-5.0.so +lib/librpmdb-5.2.so lib/librpmdb.a lib/librpmdb.la lib/librpmdb.so -lib/librpmio-5.0.so +lib/librpmio-5.2.so lib/librpmio.a lib/librpmio.la lib/librpmio.so -lib/librpmmisc-5.0.so +lib/librpmmisc-5.2.so lib/librpmmisc.a lib/librpmmisc.la lib/librpmmisc.so +lib/rpm/bin/rpmcache +lib/rpm/bin/rpmdigest +lib/rpm/bin/grep +lib/rpm/bin/mtree +lib/rpm/bin/rpmrepo +lib/rpm/bin/rpmspecdump +lib/rpm/bin/wget +lib/rpm/bin/rpmcmp +lib/rpm/bin/rpmdeps +lib/rpm/bin/txar lib/rpm/brp-compress lib/rpm/brp-java-gcjcompile lib/rpm/brp-nobuildrootpath @@ -88,6 +80,7 @@ lib/rpm/brp-strip-shared lib/rpm/brp-strip-static-archive lib/rpm/check-files +lib/rpm/cpuinfo.yaml lib/rpm/cross-build lib/rpm/executabledeps.sh lib/rpm/find-debuginfo.sh @@ -97,6 +90,7 @@ lib/rpm/find-req.pl lib/rpm/find-requires.perl lib/rpm/getpo.sh +lib/rpm/helpers/makeshlibs lib/rpm/http.req lib/rpm/install-sh lib/rpm/javadeps.sh @@ -113,18 +107,29 @@ lib/rpm/php.req lib/rpm/pkgconfigdeps.sh lib/rpm/pythondeps.sh +lib/rpm/qf/deb_Packages +lib/rpm/qf/deb_Sources +lib/rpm/qf/deb_control +lib/rpm/qf/deb_md5sums +lib/rpm/qf/deb_postinst +lib/rpm/qf/deb_postrm +lib/rpm/qf/deb_preinst +lib/rpm/qf/deb_prerm +lib/rpm/qf/wnh_filelists_yaml +lib/rpm/qf/wnh_other_yaml +lib/rpm/qf/wnh_primary_yaml +lib/rpm/qf/yum_filelists_sqlite +lib/rpm/qf/yum_other_sqlite +lib/rpm/qf/yum_primary_sqlite +lib/rpm/qf/yum_filelists_xml +lib/rpm/qf/yum_other_xml +lib/rpm/qf/yum_primary_xml lib/rpm/rpm.daily lib/rpm/rpm.log lib/rpm/rpm.xinetd lib/rpm/rpm2cpio -lib/rpm/rpmcache -lib/rpm/rpmcmp lib/rpm/rpmdb_loadcvt -lib/rpm/rpmdeps -lib/rpm/rpmdigest lib/rpm/rpmpopt -lib/rpm/symclash.py -lib/rpm/symclash.sh lib/rpm/tgpg lib/rpm/u_pkg.sh lib/rpm/vcheck @@ -208,6 +213,9 @@ @dirrmtry man/ru @dirrmtry man/sk +@dirrm lib/rpm/bin +@dirrm lib/rpm/helpers +@dirrm lib/rpm/qf @dirrm lib/rpm %%PERL%%@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/RPM %%PYTHON%%@dirrm %%PYTHON_SITELIBDIR%%/rpm