diff --git a/.gitignore b/.gitignore index fc099d0..a590d08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /zsync-0.6.2.tar.bz2 -/zsync-0.6.3.tar.bz2 diff --git a/fix-build-with-gcc-14.patch b/fix-build-with-gcc-14.patch new file mode 100644 index 0000000..43bce49 --- /dev/null +++ b/fix-build-with-gcc-14.patch @@ -0,0 +1,89 @@ +Description: Fix build with GCC-14 +Author: Marcos Talau +Bug-Debian: https://bugs.debian.org/1075710 +Forwarded: https://github.com/cph6/zsync/issues/20 +Last-Update: 2024-08-16 + +Index: zsync-0.6.2/client.c +=================================================================== +--- zsync-0.6.2.orig/client.c ++++ zsync-0.6.2/client.c +@@ -392,7 +392,7 @@ int fetch_remaining_blocks_http(struct z + */ + int fetch_remaining_blocks(struct zsync_state *zs) { + int n, utype; +- const char *const *url = zsync_get_urls(zs, &n, &utype); ++ char **url = zsync_get_urls(zs, &n, &utype); + int *status; /* keep status for each URL - 0 means no error */ + int ok_urls = n; + +@@ -452,7 +452,7 @@ extern long global_offset; + int main(int argc, char **argv) { + struct zsync_state *zs; + char *temp_file = NULL; +- char **seedfiles = NULL; ++ void **seedfiles = NULL; + int nseedfiles = 0; + char *filename = NULL; + long long local_used; +Index: zsync-0.6.2/libzsync/zmap.c +=================================================================== +--- zsync-0.6.2.orig/libzsync/zmap.c ++++ zsync-0.6.2/libzsync/zmap.c +@@ -333,7 +333,7 @@ int zmap_search(const struct zmap* zm, l + * and in the order that it returned them, this condition is satisfied. + */ + void configure_zstream_for_zdata(const struct zmap *zm, z_stream * zs, +- long zoffset, long long *poutoffset) { ++ long zoffset, off_t *poutoffset) { + /* Find the zmap entry corresponding to this offset */ + int i = zmap_search(zm, zoffset); + +Index: zsync-0.6.2/libzsync/zmap.h +=================================================================== +--- zsync-0.6.2.orig/libzsync/zmap.h ++++ zsync-0.6.2/libzsync/zmap.h +@@ -29,7 +29,7 @@ struct zmap* zmap_make(const struct gzbl + void zmap_free(struct zmap*); + + off_t* zmap_to_compressed_ranges(const struct zmap* zm, off_t* byterange, int nrange, int* num); +-void configure_zstream_for_zdata(const struct zmap* zm, struct z_stream_s* zs, long zoffset, long long* poutoffset); ++void configure_zstream_for_zdata(const struct zmap* zm, struct z_stream_s* zs, long zoffset, off_t* poutoffset); + + /* gzip flag byte */ + #define GZ_ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ +Index: zsync-0.6.2/libzsync/zsync.c +=================================================================== +--- zsync-0.6.2.orig/libzsync/zsync.c ++++ zsync-0.6.2/libzsync/zsync.c +@@ -436,7 +436,7 @@ void zsync_progress(const struct zsync_s + * Note that these URLs could be for encoded versions of the target; a 'type' + * is returned in *type which tells libzsync in later calls what version of the + * target is being retrieved. */ +-const char *const *zsync_get_urls(struct zsync_state *zs, int *n, int *t) { ++char **zsync_get_urls(struct zsync_state *zs, int *n, int *t) { + if (zs->zmap && zs->nzurl) { + *n = zs->nzurl; + *t = 1; +@@ -768,7 +768,7 @@ char *zsync_end(struct zsync_state *zs) + */ + void zsync_configure_zstream_for_zdata(const struct zsync_state *zs, + struct z_stream_s *zstrm, +- long zoffset, long long *poutoffset) { ++ long zoffset, off_t *poutoffset) { + configure_zstream_for_zdata(zs->zmap, zstrm, zoffset, poutoffset); + { /* Load in prev 32k sliding window for backreferences */ + long long pos = *poutoffset; +Index: zsync-0.6.2/libzsync/zsync.h +=================================================================== +--- zsync-0.6.2.orig/libzsync/zsync.h ++++ zsync-0.6.2/libzsync/zsync.h +@@ -58,7 +58,7 @@ int zsync_submit_source_file(struct zsyn + * (the URL pointers are still referenced by the library, and are valid only until zsync_end). + */ + +-const char * const * zsync_get_urls(struct zsync_state* zs, int* n, int* t); ++char ** zsync_get_urls(struct zsync_state* zs, int* n, int* t); + + /* zsync_needed_byte_ranges - get the byte ranges needed from a URL. + * Returns the number of ranges in *num, and a malloc'd array (to be freed diff --git a/sources b/sources index bbf2246..d62cd44 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsync-0.6.3.tar.bz2) = b7b9f16c9dc9d3d7753eb43e57d8c4bc8adea37ed3b6372829b466d3b010dd2c287a1de2ec02a5f1a4d96ee52fdcfec6d6021776368fe4a3af862c785de20089 +SHA512 (zsync-0.6.2.tar.bz2) = 56437594831f2320c532759805b5c51116c53c8848f14b54cfd9b76676d1d061abe7fc914264f496ed1c7922fbbd5b884166c855a2fb9eb1285f216e478c5f0d diff --git a/zsync-0.6.3-fix-tests.patch b/zsync-0.6.3-fix-tests.patch deleted file mode 100644 index 4134b10..0000000 --- a/zsync-0.6.3-fix-tests.patch +++ /dev/null @@ -1,21 +0,0 @@ -From a5cb28f923dd3cfdeb65e2930dd1faa727c2abf8 Mon Sep 17 00:00:00 2001 -From: Colin Phipps -Date: Thu, 29 May 2025 08:33:11 +0100 -Subject: [PATCH] Update check-zsyncmake for changes in 208ef06. - ---- - c/check-zsyncmake | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/c/check-zsyncmake b/c/check-zsyncmake -index 3006230..08791e1 100755 ---- a/check-zsyncmake -+++ b/check-zsyncmake -@@ -4,6 +4,6 @@ ${top_builddir-.}/zsyncmake -u foo -f foo ${srcdir-.}/INSTALL - - # Note TAB required for Solaris cksum - x=`perl -pe 's/^(zsync:).*$/$1 XXX/; s/^(MTime:)(.*)$/my ($x, $y) = ($1, $2); $y =~ s![a-zA-Z0-9]!_!g; "$x$y"/e;' foo.zsync | tee foo.tr.zsync | cksum | sed -e 's/[ ][0-9].*//'` --[ $x = 4103379992 ] -+[ $x = 3456223344 ] - rm foo.zsync - diff --git a/zsync.spec b/zsync.spec index 1bb1f8c..91a3e4c 100644 --- a/zsync.spec +++ b/zsync.spec @@ -1,15 +1,17 @@ Name: zsync Summary: a file transfer program using the same algorithm as rsync over HTTP -URL: https://zsync.moria.org.uk/ +URL: http://zsync.moria.org.uk/ License: Artistic-2.0 and Zlib and NTP and LicenseRef-Fedora-Public-Domain # Zlib: zlib/* # NTP: base64.c # PD: librcksum/* -Version: 0.6.3 +Version: 0.6.2 Release: %autorelease -Source0: https://zsync.moria.org.uk/download/%{name}-%{version}.tar.bz2 -Patch0: zsync-0.6.3-fix-tests.patch +Source0: http://zsync.moria.org.uk/download/%{name}-%{version}.tar.bz2 + +# https://sources.debian.org/data/main/z/zsync/0.6.2-7/debian/patches/fix-build-with-gcc-14.patch +Patch1: fix-build-with-gcc-14.patch BuildRequires: gcc BuildRequires: make @@ -36,6 +38,7 @@ large scale file distribution. sed -i '/^doc_DATA/s/COPYING//' Makefile.am # avoid duplicating license file %build +autoreconf -if %configure %make_build CFLAGS+="-Wno-old-style-definition -D_DEFAULT_SOURCE" # bundled zlib uses old-style function definition, ignore.