1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

sysutils/deltup: upgrade to version 0.4.6

Fetch from GitHub, since the main web-site deltup.org seems
unresponsive (it still has a DNS entry).
This commit is contained in:
Stefan Eßer 2023-10-22 10:32:46 +02:00
parent b0ebeff48e
commit da38902830
12 changed files with 71 additions and 366 deletions

View File

@ -1,20 +1,23 @@
PORTNAME= deltup
PORTVERSION= 0.4.4
PORTREVISION= 1
DISTVERSIONPREFIX= v
DISTVERSION= 0.4.6
CATEGORIES= sysutils
MASTER_SITES= http://deltup.org/e107_files/downloads/ \
LOCAL/rafan \
MASTER_SITES= https://github.com/jjwhitney/Deltup/archive/refs/tags/ \
http://www.bzip.org/${BZIP2_102}/:bzip2102src \
http://www.bzip.org/${BZIP2_103}/:bzip2103src
DISTFILES+= ${DISTNAME}.tar.gz ${BZIP2_102_SOURCE}:bzip2102src ${BZIP2_103_SOURCE}:bzip2103src
DISTFILES+= ${DISTVERSIONPREFIX}${DISTVERSION}.tar.gz \
${BZIP2_102_SOURCE}:bzip2102src \
${BZIP2_103_SOURCE}:bzip2103src
MAINTAINER= ports@FreeBSD.org
MAINTAINER= se@FreeBSD.org
COMMENT= Source delta update program
WWW= http://www.deltup.org/
WWW= https://github.com/jjwhitney/Deltup # http://www.deltup.org/
LICENSE= GPLv2+
RUN_DEPENDS= bdelta:misc/bdelta \
xdelta:misc/xdelta \
gzip>=1:archivers/gzip
gzip>=1:archivers/gzip \
xdelta:misc/xdelta
BZIP2_102_SOURCE= bzip2-${BZIP2_102}.tar.gz
BZIP2_103_SOURCE= bzip2-${BZIP2_103}.tar.gz
@ -23,42 +26,47 @@ BZIP2_102= 1.0.2
BZIP2_103= 1.0.3
USES= gmake ssl
ALL_TARGET= deltup
MAKE_ARGS= CC="${CC}" CXX="${CXX}" PREFIX="${PREFIX}"
MAKE_ARGS= CC="${CC}" \
CXX="${CXX}" \
PREFIX="${PREFIX}"
CXXFLAGS+= -I${OPENSSLINC}
PLIST_FILES= bin/deltup \
bin/bzip2_1.0.2 \
bin/bzip2_1.0.3 \
man/man1/deltup.1.gz
WRKSRC= ${WRKDIR}/Deltup-${PORTVERSION}
WRKSRC_BZIP2_102= ${WRKDIR}/bzip2-${BZIP2_102}
WRKSRC_BZIP2_103= ${WRKDIR}/bzip2-${BZIP2_103}
PLIST_FILES= bin/bzip2_1.0.2 \
bin/bzip2_1.0.3 \
bin/deltup \
man/man1/deltup.1.gz
PORTDOCS= ChangeLog README
OPTIONS_DEFINE= DOCS
post-patch:
@${REINPLACE_CMD} -e 's/CC/CXX/' -e 's,gcc,$${CXX},' \
-e "s|\(-lcrypto\)|-L${OPENSSLLIB} \1|g" ${WRKSRC}/Makefile
pre-build:
@${REINPLACE_CMD} -e 's,CC,CXX,;s,gcc,$${CXX},' \
-e "s|\(-lcrypto\)|-L${OPENSSLLIB} \1|g" ${WRKSRC}/src/Makefile
@${REINPLACE_CMD} -e 's|-Wall -Winline -O2|-Wall -Winline -O2 ${CFLAGS}|' \
${WRKSRC_BZIP2_102}/Makefile
@${REINPLACE_CMD} -e 's|-Wall -Winline -O -g|-Wall -Winline -O2 ${CFLAGS}|' \
${WRKSRC_BZIP2_103}/Makefile
@(cd ${WRKSRC_BZIP2_102} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} bzip2)
@(cd ${WRKSRC_BZIP2_103} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} bzip2)
do-build:
@cd ${WRKSRC_BZIP2_102} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} bzip2
@cd ${WRKSRC_BZIP2_103} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} bzip2
cd ${WRKSRC}/src && ${MAKE} deltup
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/deltup ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/src/deltup ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC_BZIP2_102}/bzip2 ${STAGEDIR}${PREFIX}/bin/bzip2_1.0.2
${INSTALL_PROGRAM} ${WRKSRC_BZIP2_103}/bzip2 ${STAGEDIR}${PREFIX}/bin/bzip2_1.0.3
${INSTALL_MAN} ${WRKSRC}/deltup.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in ${PORTDOCS}
@${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}/${i}
${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}/${i}
.endfor
.include <bsd.port.mk>

View File

@ -1,6 +1,9 @@
SHA256 (deltup-0.4.4.tar.gz) = fba7f1a970a04b2b786402e55c017c667b065f1974154f2ba6a65c855357b744
SIZE (deltup-0.4.4.tar.gz) = 14905
TIMESTAMP = 1697960572
SHA256 (v0.4.6.tar.gz) = f86b304dcdadc864cd347d382dc2c9c249e399f22408d6d7d68490374386c365
SIZE (v0.4.6.tar.gz) = 14869
SHA256 (bzip2-1.0.2.tar.gz) = 4b526afa73ca1ccd6f5f1f5fd23813f159f715c3d0e00688f1df54b51f443cdd
SIZE (bzip2-1.0.2.tar.gz) = 665198
SHA256 (bzip2-1.0.3.tar.gz) = 4aaa8e7b4ecf03d91c33e8bf92d489533fa6c1f99e825c34058003f18eb68c13
SIZE (bzip2-1.0.3.tar.gz) = 669075
SHA256 (jjwhitney-Deltup-v0.4.6_GH0.tar.gz) = f86b304dcdadc864cd347d382dc2c9c249e399f22408d6d7d68490374386c365
SIZE (jjwhitney-Deltup-v0.4.6_GH0.tar.gz) = 14869

View File

@ -1,19 +0,0 @@
--- Makefile.orig 2005-05-21 04:23:34.000000000 +0400
+++ Makefile 2013-03-16 09:57:42.000000000 +0400
@@ -4,13 +4,13 @@
CC = g++
-objfiles=bpatch.o bzip2.o file.o system.o tmpstore.o deltup.o
-libs=-lstdc++ -lz -lbz2 -lssl
+objfiles=bpatch.o bzip2.o gzip.o file.o system.o tmpstore.o deltup.o
+libs=-lz -lbz2 -lcrypto
#edelta: edelta.cpp deltup
# gcc edelta.cpp ${CXXFLAGS} -o edelta
%.o : %.cpp
- ${CC} -c $< -o $@ -g #-Wall -pedantic #-DFIXED_FRAMERATE
+ ${CC} -c $< -o $@ ${CXXFLAGS}
all: deltup

View File

@ -1,39 +0,0 @@
--- bzip2.cpp.orig 2007-03-25 01:59:24.000000000 +0300
+++ bzip2.cpp 2013-10-06 17:12:16.000000000 +0400
@@ -19,6 +19,8 @@
#include "system.h"
#include "tmpstore.h"
#include "bzip2.h"
+#include <stdio.h>
+#include <stdlib.h>
char *bzip2_compressor_name[MAX_BZIP2_COMPRESSORS] = {"0.9.0c", "1.0.2", "1.0.3", "1.0.4"};
char *bzip2_name[MAX_BZIP2_COMPRESSORS] = {NULL, NULL, NULL, NULL};
@@ -31,14 +33,12 @@
system(command.c_str());
FILE * fp;
- char * line = NULL;
+ char line[2*CHAR_MAX];
string fname;
- size_t len = 0;
- ssize_t read;
fp = fopen(tempfile.c_str(), "r");
if (fp == NULL)
exit(EXIT_FAILURE);
- while ((read = getline(&line, &len, fp)) != -1) {
+ while (fgets(line, 2*CHAR_MAX, fp)!=NULL) {
// printf("Retrieved line of length %zu :\n", read);
// printf("%s", line);
char *v = strstr(line, "Version");
@@ -56,8 +56,8 @@
}
fname = line;
}
- if (line)
- free(line);
+// if (line)
+// free(&line);
if (verbose) {
printf("found bzip2 compressors/decompressors:\n");
for (int i = 0; i < MAX_BZIP2_COMPRESSORS; ++i) {

View File

@ -1,122 +0,0 @@
--- deltup.cpp.orig 2007-07-13 07:22:20.000000000 +0400
+++ deltup.cpp 2013-10-06 17:15:15.000000000 +0400
@@ -16,7 +16,7 @@
//#include <sys/wait.h>
//#include <unistd.h>
//#include <sys/signal.h>
-//#include <stdlib.h>
+#include <stdlib.h>
//#include <string.h>
//#include <stdio.h>
//#include <stdarg.h>
@@ -32,6 +32,7 @@
#include "filetypes.h"
#include "system.h"
#include "bzip2.h"
+#include "gzip.h"
bool force_overwrite = false, remove_intermediate = false,
info_mode = false, ensure_md5sum = false, use_bdelta = false;
@@ -150,28 +151,33 @@
void gzip_without_header(string in, string out, char compression) {
string tempfile = getTmpFilename();
-
- deflate("gzip", in, tempfile, compression, false);
+ find_gzip_compressor();
+ if (gzip_name != NULL) {
+ deflate(gzip_name, in, tempfile, compression, false);
// printf("here2 %s %s %c\n", in.c_str(), tempfile.c_str(), compression);
- unsigned filesize = getLenOfFile(tempfile);
- char inbuf[12];
- IFStream *f = new IFStream(tempfile);
- f->read(inbuf, 10);
- char flags = inbuf[3];
-
- if (flags & 2) f->read(inbuf, 2);
- if (flags & 4) {
- unsigned extrafieldsize = read_word(*f);
- while (extrafieldsize)
- extrafieldsize -= f->read(inbuf, extrafieldsize<10?extrafieldsize:10);
- }
- if (flags & 8) do f->read(inbuf, 1); while (*inbuf);
- if (flags & 16) do f->read(inbuf, 1); while (*inbuf);
- if (flags & 32) f->read(inbuf, 2);
-
- OFStream o(out);
- copy_bytes_to_file(*f, o, filesize-f->loc());
- delete f;
+ unsigned filesize = getLenOfFile(tempfile);
+ char inbuf[12];
+ IFStream *f = new IFStream(tempfile);
+ f->read(inbuf, 10);
+ char flags = inbuf[3];
+
+ if (flags & 2) f->read(inbuf, 2);
+ if (flags & 4) {
+ unsigned extrafieldsize = read_word(*f);
+ while (extrafieldsize)
+ extrafieldsize -= f->read(inbuf, extrafieldsize<10?extrafieldsize:10);
+ }
+ if (flags & 8) do f->read(inbuf, 1); while (*inbuf);
+ if (flags & 16) do f->read(inbuf, 1); while (*inbuf);
+ if (flags & 32) f->read(inbuf, 2);
+
+ OFStream o(out);
+ copy_bytes_to_file(*f, o, filesize-f->loc());
+ delete f;
+ gzip_found = 1;
+ } else {
+ gzip_found = 0;
+ }
doneTmpFile(tempfile);
}
@@ -245,12 +251,16 @@
string gzip_temp = getTmpFilename();
const char *lev = "968712534";
do {
- printf("here %c\n", *lev);
gzip_without_header(file2.uname, gzip_temp, *lev);
+ if (gzip_found == 0) { break;
+// } else {
+// printf("here %c\n", *lev);
+ }
makeDelta(use_bdelta, gzip_temp, file2.fullname(), pristineName);
++lev;
} while (*lev && getLenOfFile(pristineName)>1024);
- if (!*lev) error("Unknown gzip compression format");
+ if (gzip_found == 0) { error("Can't find GNU gzip");
+ } else if (!*lev) { error("Unknown gzip compression format"); }
compression_level=*(lev-1)-'0';
doneTmpFile(gzip_temp);
} else if (file2.type==BZIP2) {
@@ -365,7 +375,10 @@
bzip2_name[i]);
} else fprintf(stderr, "Error: Deltup cannot find the proper bzip2 to rebuild the package\n");
break;
- case GZIP: gzip_without_header(f.uname, finalName, c); break;
+ case GZIP:
+ gzip_without_header(f.uname, finalName, c);
+ if (gzip_found == 0) error("Can't find GNU gzip");
+ break;
case UNKNOWN_FMT: cat(f.uname, finalName, false);
};
@@ -520,14 +533,14 @@
IStream *f = new IFStream(fname);
Injectable_IStream f2(*f);
if (((IFStream*)f)->bad()) {
- fprintf(stderr, "file is missing: %s\n", fname.c_str()); return;}
+ fprintf(stderr, "file is missing: %s\n", fname.c_str()); exit(1);}
unsigned type = determine_filetype(f2);
delete f;
switch (type) {
case GZIP: f = new GZ_IFStream(fname); break;
case BZIP2: f = new BZ_IFStream(fname); break;
case DTU: f = new IFStream(fname); break;
- case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname.c_str()); return;
+ case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname.c_str()); exit(1);
case TARBALL :
f = new IFStream(fname);
unsigned zero_count;

View File

@ -1,10 +0,0 @@
--- file.cpp.orig 2013-10-06 17:12:46.000000000 +0400
+++ file.cpp 2013-10-06 17:13:27.000000000 +0400
@@ -12,6 +12,7 @@
* Author: John Whitney <jjw@deltup.org>
*/
+#include <stdlib.h>
#include <zlib.h>
#include <bzlib.h>
#include <string>

View File

@ -1,29 +0,0 @@
--- file.h.orig 2013-03-16 09:40:32.000000000 +0400
+++ file.h 2013-03-16 09:41:06.000000000 +0400
@@ -12,6 +12,8 @@
* Author: John Whitney <jjw@deltup.org>
*/
+#include <zlib.h>
+
class IStream {
public:
virtual unsigned read(void *data, unsigned num) = 0;
@@ -56,7 +58,7 @@
};
class GZ_IFStream : public IStream {
- void *file;
+ gzFile file;
public:
GZ_IFStream(string fname);
virtual ~GZ_IFStream();
@@ -65,7 +67,7 @@
};
class GZ_OFStream : public OStream {
- void *file;
+ gzFile file;
public:
GZ_OFStream(string fname);
virtual ~GZ_OFStream();

View File

@ -1,67 +0,0 @@
--- gzip.cpp.orig 2013-10-06 17:11:38.000000000 +0400
+++ gzip.cpp 2013-10-06 17:12:35.000000000 +0400
@@ -0,0 +1,64 @@
+/* Copyright (C) 2007 John Whitney
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ *
+ * Author: John Whitney <jjw@deltup.org>
+ */
+
+#include <string>
+#include <list>
+using namespace std;
+#include "file.h"
+#include "system.h"
+#include "tmpstore.h"
+#include "gzip.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int gzip_found = 0;
+char *gzip_name = NULL;
+
+void find_gzip_compressor() {
+ string tempfile = getTmpFilename();
+ string command = "find `echo $PATH | tr ':' ' '` -iname 'gzip' -exec sh -c 'echo {};{} -V 2>&1|grep ^gzip' \\; 2> /dev/null > "
+ + tempfile;
+
+ system(command.c_str());
+
+ FILE * fp;
+ char line[2*CHAR_MAX];
+ string fname;
+ fp = fopen(tempfile.c_str(), "r");
+ if (fp == NULL)
+ exit(EXIT_FAILURE);
+ while (fgets(line, 2*CHAR_MAX, fp)!=NULL) {
+ char *v = strstr(line, "gzip");
+ if (v) {
+ int index=-1;
+ if (strncmp(v+5, "1.", 2) == 0) index=0;
+ if (index!=-1)
+ {
+ gzip_name = new char[fname.length()];
+ strncpy(gzip_name, fname.c_str(), fname.length()-1);
+ gzip_name[fname.length()-1] = 0;
+ break;
+ }
+ }
+ fname = line;
+ }
+ if (verbose) {
+ if (gzip_name!=NULL)
+ {
+ printf("found GNU gzip compressor/decompressor:\n");
+ printf(" %s\n", gzip_name);
+ }
+ else printf("GNU gzip compressor/decompressor NOT found!\n");
+ }
+}

View File

@ -1,20 +0,0 @@
--- gzip.h.orig 1970-01-01 05:00:00.000000000 +0500
+++ gzip.h 2008-03-10 10:38:01.000000000 +0500
@@ -0,0 +1,17 @@
+/* Copyright (C) 2007 John Whitney
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ *
+ * Author: John Whitney <jjw@deltup.org>
+ */
+
+extern char *gzip_name;
+extern int gzip_found;
+void find_gzip_compressor();

View File

@ -0,0 +1,32 @@
--- src/Makefile.orig 2014-08-12 16:57:16 UTC
+++ src/Makefile
@@ -2,23 +2,21 @@ BINDIR=$(PREFIX)/bin
PREFIX=%%PREFIX%%
BINDIR=$(PREFIX)/bin
-CC = g++
-
objfiles=bpatch.o archfunc.o file.o system.o tmpstore.o deltup.o
-libs=-lstdc++ -lz -lbz2 -lcrypto #-lssl
+libs=-lstdc++ -lz -lbz2 -L/usr/local/lib -lcrypto #-lssl
#edelta: edelta.cpp deltup
-# gcc edelta.cpp ${CXXFLAGS} -o edelta
+# ${CXX} edelta.cpp ${CXXFLAGS} -o edelta
%.o : %.cpp
- ${CC} -c $< -o $@ ${CXXFLAGS} #-g #-Wall -pedantic
+ ${CXX} -c $< -o $@ ${CXXFLAGS} #-g #-Wall -pedantic
all: deltup
depend:
- gcc -MM *.cpp > .depend
-
+ $CXX -MM *.cpp > .depend
+
deltup: $(objfiles)
- ${CC} $(objfiles) ${CXXFLAGS} -o deltup $(libs)
+ ${CXX} $(objfiles) ${CXXFLAGS} -o deltup $(libs)
install: deltup
mkdir -p $(DESTDIR)$(BINDIR)

View File

@ -1,21 +0,0 @@
--- system.cpp.orig 2007-03-25 01:45:52.000000000 +0300
+++ system.cpp 2013-10-06 17:14:02.000000000 +0400
@@ -11,7 +11,8 @@
*
* Author: John Whitney <jjw@deltup.org>
*/
-
+
+#include <stdlib.h>
#include <sys/signal.h>
#include <string>
#include <vector>
@@ -19,7 +20,7 @@
using namespace std;
#include "file.h"
#include "bpatch.h"
-
+#include <sys/wait.h>
#include "filetypes.h"
bool verbose = false;

View File

@ -1,11 +0,0 @@
--- tmpstore.cpp.orig 2013-10-06 17:14:20.000000000 +0400
+++ tmpstore.cpp 2013-10-06 17:15:03.000000000 +0400
@@ -12,6 +12,8 @@
* Author: John Whitney <jjw@deltup.org>
*/
+#include <stdlib.h>
+#include <unistd.h>
#include <signal.h>
#include <string>
#include <vector>