2008-09-12 20:37:28 +02:00
|
|
|
Index: build/pack.c
|
|
|
|
===================================================================
|
|
|
|
--- build/pack.c.orig
|
|
|
|
+++ build/pack.c
|
2008-03-21 02:12:40 +01:00
|
|
|
@@ -479,6 +479,11 @@ int writeRPM(Header *hdrp, unsigned char
|
|
|
|
/* Add prereq on rpm version that understands bzip2 payloads */
|
|
|
|
(void) rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1");
|
|
|
|
}
|
|
|
|
+ if (s[1] == 'l' && s[2] == 'z') {
|
|
|
|
+ (void) headerAddEntry(h, RPMTAG_PAYLOADCOMPRESSOR, RPM_STRING_TYPE,
|
|
|
|
+ "lzma", 1);
|
|
|
|
+ (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.2-1");
|
|
|
|
+ }
|
|
|
|
strcpy(buf, rpmio_flags);
|
|
|
|
buf[s - rpmio_flags] = '\0';
|
|
|
|
(void) headerAddEntry(h, RPMTAG_PAYLOADFLAGS, RPM_STRING_TYPE, buf+1, 1);
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: lib/psm.c
|
|
|
|
===================================================================
|
|
|
|
--- lib/psm.c.orig
|
|
|
|
+++ lib/psm.c
|
|
|
|
@@ -2097,6 +2097,8 @@ psm->te->h = headerFree(psm->te->h);
|
2008-03-21 02:12:40 +01:00
|
|
|
t = stpcpy(t, ".gzdio");
|
|
|
|
if (!strcmp(payload_compressor, "bzip2"))
|
|
|
|
t = stpcpy(t, ".bzdio");
|
|
|
|
+ if (!strcmp(payload_compressor, "lzma"))
|
|
|
|
+ t = stpcpy(t, ".lzdio");
|
|
|
|
rc = RPMRC_OK;
|
|
|
|
} break;
|
|
|
|
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: lib/rpmlibprov.c
|
|
|
|
===================================================================
|
|
|
|
--- lib/rpmlibprov.c.orig
|
|
|
|
+++ lib/rpmlibprov.c
|
|
|
|
@@ -59,6 +59,9 @@ static struct rpmlibProvides_s rpmlibPro
|
2008-03-21 02:12:40 +01:00
|
|
|
( RPMSENSE_EQUAL),
|
|
|
|
N_("internal support for lua scripts.") },
|
|
|
|
#endif
|
|
|
|
+ { "rpmlib(PayloadIsLzma)", "4.4.2-1",
|
|
|
|
+ (RPMSENSE_RPMLIB|RPMSENSE_EQUAL),
|
|
|
|
+ N_("package payload can be compressed using lzma.") },
|
2008-09-12 20:37:28 +02:00
|
|
|
{ NULL, NULL, 0, NULL }
|
2008-03-21 02:12:40 +01:00
|
|
|
};
|
|
|
|
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: macros.in
|
|
|
|
===================================================================
|
|
|
|
--- macros.in.orig
|
|
|
|
+++ macros.in
|
|
|
|
@@ -326,6 +326,7 @@ package or when debugging this package.\
|
2008-03-21 02:12:40 +01:00
|
|
|
# Compression type and level for source/binary package payloads.
|
|
|
|
# "w9.gzdio" gzip level 9 (default).
|
|
|
|
# "w9.bzdio" bzip2 level 9.
|
|
|
|
+# "w5.lzdio" lzma level 5. (best compromise)
|
|
|
|
#
|
|
|
|
#%_source_payload w9.gzdio
|
2008-09-12 20:37:28 +02:00
|
|
|
%_binary_payload w2.lzdio
|
|
|
|
Index: rpm2cpio.c
|
|
|
|
===================================================================
|
|
|
|
--- rpm2cpio.c.orig
|
|
|
|
+++ rpm2cpio.c
|
2008-03-21 02:12:40 +01:00
|
|
|
@@ -76,6 +76,8 @@ int main(int argc, char **argv)
|
|
|
|
t = stpcpy(t, ".gzdio");
|
|
|
|
if (!strcmp(payload_compressor, "bzip2"))
|
|
|
|
t = stpcpy(t, ".bzdio");
|
|
|
|
+ if (!strcmp(payload_compressor, "lzma"))
|
|
|
|
+ t = stpcpy(t, ".lzdio");
|
|
|
|
}
|
|
|
|
|
|
|
|
gzdi = Fdopen(fdi, rpmio_flags); /* XXX gzdi == fdi */
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: rpmio/rpmio.h
|
|
|
|
===================================================================
|
|
|
|
--- rpmio/rpmio.h.orig
|
|
|
|
+++ rpmio/rpmio.h
|
|
|
|
@@ -669,6 +669,10 @@ int ufdGetFile( /*@killref@*/ FD_t sfd,
|
2008-03-21 02:12:40 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
+/*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ */
|
|
|
|
/*@observer@*/ /*@unchecked@*/ extern FDIO_t fadio;
|
|
|
|
/*@=exportlocal@*/
|
|
|
|
/*@}*/
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: scripts/rpm2cpio.sh
|
|
|
|
===================================================================
|
|
|
|
--- scripts/rpm2cpio.sh.orig
|
|
|
|
+++ scripts/rpm2cpio.sh
|
2008-03-21 02:12:40 +01:00
|
|
|
@@ -23,4 +23,14 @@ dl=`expr 256 \* \( 256 \* \( 256 \* $6 +
|
|
|
|
hdrsize=`expr 8 + 16 \* $il + $dl`
|
|
|
|
o=`expr $o + $hdrsize`
|
|
|
|
|
|
|
|
-dd if=$pkg ibs=$o skip=1 2>/dev/null | gunzip
|
|
|
|
+comp=`dd if="$pkg" ibs=$o skip=1 count=1 2>/dev/null \
|
|
|
|
+ | dd bs=3 count=1 2>/dev/null`
|
|
|
|
+
|
|
|
|
+gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`"
|
|
|
|
+case "$comp" in
|
|
|
|
+ BZh) dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;;
|
|
|
|
+ "$gz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;;
|
|
|
|
+ # no magic in old lzma format, if unknown we assume that's lzma for now
|
|
|
|
+ *) dd if="$pkg" ibs=$o skip=1 2>/dev/null | unlzma ;;
|
|
|
|
+ #*) echo "Unrecognized rpm file: $pkg"; return 1 ;;
|
|
|
|
+esac
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: rpmio/Makefile.am
|
|
|
|
===================================================================
|
|
|
|
--- rpmio/Makefile.am.orig
|
|
|
|
+++ rpmio/Makefile.am
|
|
|
|
@@ -41,7 +41,7 @@ librpmio_la_LDFLAGS = -release 4.4 $(LDF
|
2008-03-21 02:12:40 +01:00
|
|
|
@WITH_MAGIC_LIB@ \
|
|
|
|
@WITH_ZLIB_LIB@ \
|
|
|
|
-lpthread
|
|
|
|
-librpmio_la_LIBADD = $(BEECRYPTLOBJS)
|
|
|
|
+librpmio_la_LIBADD = $(BEECRYPTLOBJS) -llzma
|
|
|
|
librpmio_la_DEPENDENCIES = .created
|
|
|
|
|
|
|
|
.created:
|