diff --git a/rsync/build.sh b/rsync/build.sh index 0fa8567..2daee46 100755 --- a/rsync/build.sh +++ b/rsync/build.sh @@ -6,11 +6,14 @@ ########################################################### # Check the following 4 variables before running the script topdir=rsync -version=3.1.3 +version=3.4.1 pkgver=1 source[0]=https://download.samba.org/pub/rsync/src/$topdir-$version.tar.gz # If there are no patches, simply comment this -#patch[0]= +patch[0]=0001-Move-pathjoin-to-lib.patch +patch[1]=0002-Fix-build-with-no-stdint.h.patch +patch[2]=0003-Ensure-SIZE_MAX-is-defined.patch +patch[3]=0004-Missing-include-for-my_strdup.patch # Source function library . ${BUILDPKG_SCRIPTS}/buildpkg.functions @@ -18,7 +21,8 @@ source[0]=https://download.samba.org/pub/rsync/src/$topdir-$version.tar.gz # Global settings export CPPFLAGS="-I$prefix/include" export LDFLAGS="-L$prefix/lib -R$prefix/lib" -configure_args+=(--with-included-popt --disable-ipv6) +export CC="gcc -D__EXTENSIONS__" +configure_args+=(--with-included-popt --disable-ipv6 --disable-xxhash --disable-zstd --disable-lz4) reg prep prep() @@ -42,7 +46,7 @@ reg install install() { generic_install DESTDIR - doc NEWS README COPYING + doc NEWS.md README.md COPYING } reg pack diff --git a/rsync/meta/ChangeLog b/rsync/meta/ChangeLog index 7942fc5..5f97d44 100644 --- a/rsync/meta/ChangeLog +++ b/rsync/meta/ChangeLog @@ -1,5 +1,8 @@ CHANGELOG --------- +* Wed Feb 12 2025 Tom G. Christensen - 3.4.1-1 +- Update to 3.4.1 + * Sat Apr 21 2018 Tom G. Christensen - 3.1.3-1 - Update to 3.1.3 diff --git a/rsync/meta/pkgdef b/rsync/meta/pkgdef index 57f5aa8..f761a68 100644 --- a/rsync/meta/pkgdef +++ b/rsync/meta/pkgdef @@ -2,7 +2,7 @@ pkgname="${pkgprefix}${topdir}" name="$topdir - File transfer utility" pkgcat="application" -pkgvendor="http://samba.anu.edu.au/rsync/" +pkgvendor="https://rsync.samba.org/" pkgdesc="Utility that provides fast incremental file transfer" pkgver="$pkgver" files(-,root,bin) diff --git a/rsync/src/0001-Move-pathjoin-to-lib.patch b/rsync/src/0001-Move-pathjoin-to-lib.patch new file mode 100644 index 0000000..66265f9 --- /dev/null +++ b/rsync/src/0001-Move-pathjoin-to-lib.patch @@ -0,0 +1,155 @@ +From 1afc1f962841edeba221a5188d255e26cb0f5c74 Mon Sep 17 00:00:00 2001 +From: "Tom G. Christensen" +Date: Wed, 12 Feb 2025 10:12:39 +0100 +Subject: [PATCH 1/4] Move pathjoin() to lib/ + +To allow pathjoin() to be used from syscall.o when building the test +programs. +--- + Makefile.in | 9 +++++---- + lib/pathjoin.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ + rsync.h | 4 ++++ + util1.c | 22 ---------------------- + 4 files changed, 58 insertions(+), 26 deletions(-) + create mode 100644 lib/pathjoin.c + +diff --git a/Makefile.in b/Makefile.in +index 6340403b..a532a1f7 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -40,7 +40,8 @@ GENFILES=configure.sh aclocal.m4 config.h.in rsync.1 rsync.1.html \ + HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \ + lib/pool_alloc.h lib/mdigest.h lib/md-defines.h + LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \ +- lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@ ++ lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o \ ++ lib/pathjoin.o @LIBOBJS@ + zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \ + zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o + OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \ +@@ -53,7 +54,7 @@ popt_OBJS= popt/popt.o popt/poptconfig.o \ + popt/popthelp.o popt/poptparse.o popt/poptint.o + OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@ + +-TLS_OBJ = tls.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@ ++TLS_OBJ = tls.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o lib/pathjoin.o @BUILD_POPT@ + + # Programs we must have to run the test cases + CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \ +@@ -170,11 +171,11 @@ getgroups$(EXEEXT): getgroups.o + getfsdev$(EXEEXT): getfsdev.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS) + +-TRIMSLASH_OBJ = trimslash.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o ++TRIMSLASH_OBJ = trimslash.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/pathjoin.o + trimslash$(EXEEXT): $(TRIMSLASH_OBJ) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS) + +-T_UNSAFE_OBJ = t_unsafe.o syscall.o util1.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/wildmatch.o ++T_UNSAFE_OBJ = t_unsafe.o syscall.o util1.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/wildmatch.o lib/pathjoin.o + t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS) + +diff --git a/lib/pathjoin.c b/lib/pathjoin.c +new file mode 100644 +index 00000000..f29834a0 +--- /dev/null ++++ b/lib/pathjoin.c +@@ -0,0 +1,49 @@ ++/* ++ * Utility routines used in rsync. ++ * ++ * Copyright (C) 1996-2000 Andrew Tridgell ++ * Copyright (C) 1996 Paul Mackerras ++ * Copyright (C) 2001, 2002 Martin Pool ++ * Copyright (C) 2003-2022 Wayne Davison ++ * ++ * 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 3 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, visit the http://fsf.org website. ++ */ ++ ++#include "rsync.h" ++#include "ifuncs.h" ++#include "itypes.h" ++#include "inums.h" ++ ++/* Join strings p1 & p2 into "dest" with a guaranteed '/' between them. (If ++ * p1 ends with a '/', no extra '/' is inserted.) Returns the length of both ++ * strings + 1 (if '/' was inserted), regardless of whether the null-terminated ++ * string fits into destsize. */ ++size_t pathjoin(char *dest, size_t destsize, const char *p1, const char *p2) ++{ ++ size_t len = strlcpy(dest, p1, destsize); ++ if (len < destsize - 1) { ++ if (!len || dest[len-1] != '/') ++ dest[len++] = '/'; ++ if (len < destsize - 1) ++ len += strlcpy(dest + len, p2, destsize - len); ++ else { ++ dest[len] = '\0'; ++ len += strlen(p2); ++ } ++ } ++ else ++ len += strlen(p2) + 1; /* Assume we'd insert a '/'. */ ++ return len; ++} ++ +diff --git a/rsync.h b/rsync.h +index 479ac484..b477ad10 100644 +--- a/rsync.h ++++ b/rsync.h +@@ -1487,3 +1487,7 @@ const char *get_panic_action(void); + #elif defined HAVE_MALLINFO + #define MEM_ALLOC_INFO mallinfo + #endif ++ ++/* pathjoin() is in lib/pathjoin.c */ ++size_t pathjoin(char *dest, size_t destsize, const char *p1, const char *p2); ++ +diff --git a/util1.c b/util1.c +index d84bc414..0e6806b1 100644 +--- a/util1.c ++++ b/util1.c +@@ -866,28 +866,6 @@ char *conf_strtok(char *str) + return strtok(str, " ,\t\r\n"); + } + +-/* Join strings p1 & p2 into "dest" with a guaranteed '/' between them. (If +- * p1 ends with a '/', no extra '/' is inserted.) Returns the length of both +- * strings + 1 (if '/' was inserted), regardless of whether the null-terminated +- * string fits into destsize. */ +-size_t pathjoin(char *dest, size_t destsize, const char *p1, const char *p2) +-{ +- size_t len = strlcpy(dest, p1, destsize); +- if (len < destsize - 1) { +- if (!len || dest[len-1] != '/') +- dest[len++] = '/'; +- if (len < destsize - 1) +- len += strlcpy(dest + len, p2, destsize - len); +- else { +- dest[len] = '\0'; +- len += strlen(p2); +- } +- } +- else +- len += strlen(p2) + 1; /* Assume we'd insert a '/'. */ +- return len; +-} +- + /* Join any number of strings together, putting them in "dest". The return + * value is the length of all the strings, regardless of whether the null- + * terminated whole fits in destsize. Your list of string pointers must end +-- +2.36.6 + diff --git a/rsync/src/0002-Fix-build-with-no-stdint.h.patch b/rsync/src/0002-Fix-build-with-no-stdint.h.patch new file mode 100644 index 0000000..18241cc --- /dev/null +++ b/rsync/src/0002-Fix-build-with-no-stdint.h.patch @@ -0,0 +1,51 @@ +From a551f279b7b93c47d0be5fbd29ca90def0d013e8 Mon Sep 17 00:00:00 2001 +From: "Tom G. Christensen" +Date: Wed, 12 Feb 2025 10:17:44 +0100 +Subject: [PATCH 2/4] Fix build with no stdint.h + +--- + popt/lookup3.c | 8 +++++++- + popt/poptint.h | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/popt/lookup3.c b/popt/lookup3.c +index e974cad8..792776cd 100644 +--- a/popt/lookup3.c ++++ b/popt/lookup3.c +@@ -34,7 +34,13 @@ + */ + /* -------------------------------------------------------------------- */ + +-#include ++#include ++ ++#ifdef HAVE_STDINT_H ++ #include ++#else ++ #include ++#endif + + #if defined(_JLU3_SELFTEST) + # define _JLU3_jlu32w 1 +diff --git a/popt/poptint.h b/popt/poptint.h +index 001c5c35..75575492 100644 +--- a/popt/poptint.h ++++ b/popt/poptint.h +@@ -9,7 +9,13 @@ + #ifndef H_POPTINT + #define H_POPTINT + +-#include ++#include ++ ++#ifdef HAVE_STDINT_H ++ #include ++#else ++ #include ++#endif + + /** + * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL. +-- +2.36.6 + diff --git a/rsync/src/0003-Ensure-SIZE_MAX-is-defined.patch b/rsync/src/0003-Ensure-SIZE_MAX-is-defined.patch new file mode 100644 index 0000000..f2d4780 --- /dev/null +++ b/rsync/src/0003-Ensure-SIZE_MAX-is-defined.patch @@ -0,0 +1,24 @@ +From e89c46bb50b64256abe47e3ac1934de186d415ef Mon Sep 17 00:00:00 2001 +From: "Tom G. Christensen" +Date: Wed, 12 Feb 2025 10:21:10 +0100 +Subject: [PATCH 3/4] Ensure SIZE_MAX is defined + +--- + popt/poptconfig.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/popt/poptconfig.c b/popt/poptconfig.c +index bf201e26..f0d52123 100644 +--- a/popt/poptconfig.c ++++ b/popt/poptconfig.c +@@ -10,6 +10,7 @@ + #include "poptint.h" + #include + #include ++#include + #include + #include + +-- +2.36.6 + diff --git a/rsync/src/0004-Missing-include-for-my_strdup.patch b/rsync/src/0004-Missing-include-for-my_strdup.patch new file mode 100644 index 0000000..7a49b0f --- /dev/null +++ b/rsync/src/0004-Missing-include-for-my_strdup.patch @@ -0,0 +1,24 @@ +From 6a679eef0112fe073af8b068c1bc74cbeaed55c1 Mon Sep 17 00:00:00 2001 +From: "Tom G. Christensen" +Date: Wed, 12 Feb 2025 10:48:11 +0100 +Subject: [PATCH 4/4] Missing include for my_strdup() + +--- + lib/getaddrinfo.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c +index 96d7a2ba..a1706096 100644 +--- a/lib/getaddrinfo.c ++++ b/lib/getaddrinfo.c +@@ -44,6 +44,7 @@ TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + + #include "rsync.h" ++#include "ifuncs.h" + + #ifndef SMB_MALLOC + #define SMB_MALLOC(s) malloc(s) +-- +2.36.6 +