aboutsummaryrefslogtreecommitdiff
path: root/sysutils/deltup
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/deltup')
-rw-r--r--sysutils/deltup/Makefile36
-rw-r--r--sysutils/deltup/distinfo6
-rw-r--r--sysutils/deltup/files/patch-Makefile12
-rw-r--r--sysutils/deltup/files/patch-bzip2.cpp6
-rw-r--r--sysutils/deltup/files/patch-deltup.cpp107
-rw-r--r--sysutils/deltup/files/patch-gzip.cpp62
-rw-r--r--sysutils/deltup/files/patch-gzip.h20
7 files changed, 229 insertions, 20 deletions
diff --git a/sysutils/deltup/Makefile b/sysutils/deltup/Makefile
index 7ba8b05b0c90..fff07188a238 100644
--- a/sysutils/deltup/Makefile
+++ b/sysutils/deltup/Makefile
@@ -8,22 +8,35 @@
PORTNAME= deltup
PORTVERSION= 0.4.4
CATEGORIES= sysutils
-MASTER_SITES= http://www.deltup.org/e107_files/downloads/ \
- ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITES= http://deltup.org/e107_files/downloads/ \
+ ${MASTER_SITE_SOURCEFORGE} \
+ http://www.bzip.org/${BZIP2_102}/:bzip2102src \
+ http://www.bzip.org/${BZIP2_103}/:bzip2103src
MASTER_SITE_SUBDIR= ${PORTNAME}
+DISTFILES+= ${PORTNAME}-${PORTVERSION}.tar.gz ${BZIP2_102_SOURCE}:bzip2102src ${BZIP2_103_SOURCE}:bzip2103src
MAINTAINER= novel@FreeBSD.org
COMMENT= Source delta update program
-RUN_DEPENDS= bdelta:${PORTSDIR}/misc/bdelta
+RUN_DEPENDS= bdelta:${PORTSDIR}/misc/bdelta \
+ xdelta:${PORTSDIR}/misc/xdelta \
+ gzip:${PORTSDIR}/archivers/gzip
+
+BZIP2_102_SOURCE= bzip2-${BZIP2_102}.tar.gz
+BZIP2_103_SOURCE= bzip2-${BZIP2_103}.tar.gz
+
+BZIP2_102= 1.0.2
+BZIP2_103= 1.0.3
USE_OPENSSL= yes
USE_GMAKE= yes
-
ALL_TARGET= deltup
PLIST_FILES= bin/deltup \
- bin/bzip2_old
+ bin/bzip2_1.0.2 \
+ bin/bzip2_1.0.3
MAN1= deltup.1
+WRKSRC_BZIP2_102= ${WRKDIR}/bzip2-${BZIP2_102}
+WRKSRC_BZIP2_103= ${WRKDIR}/bzip2-${BZIP2_103}
.if !defined(NOPORTDOCS)
PORTDOCS= ChangeLog README
@@ -34,11 +47,16 @@ post-patch:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/deltup ${PREFIX}/bin
+ ${INSTALL_PROGRAM} ${WRKSRC_BZIP2_102}/bzip2 ${PREFIX}/bin/bzip2_1.0.2
+ ${INSTALL_PROGRAM} ${WRKSRC_BZIP2_103}/bzip2 ${PREFIX}/bin/bzip2_1.0.3
${INSTALL_MAN} ${WRKSRC}/deltup.1 ${PREFIX}/man/man1
-.if !exists(${PREFIX}/bin/bzip2_old)
- @${LN} -s ${BZIP2_CMD} ${PREFIX}/bin/bzip2_old
-.endif
-
+pre-build:
+ @${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}; ${GMAKE} bzip2; \
+ cd ${WRKSRC_BZIP2_103}; ${GMAKE} bzip2;
.if !defined(NOPORTDOCS)
post-install:
@${MKDIR} ${DOCSDIR}
diff --git a/sysutils/deltup/distinfo b/sysutils/deltup/distinfo
index 70b7740f21f0..8590655f791b 100644
--- a/sysutils/deltup/distinfo
+++ b/sysutils/deltup/distinfo
@@ -1,3 +1,9 @@
MD5 (deltup-0.4.4.tar.gz) = 3b8da493eec796bf4aa09f59f318a9cc
SHA256 (deltup-0.4.4.tar.gz) = fba7f1a970a04b2b786402e55c017c667b065f1974154f2ba6a65c855357b744
SIZE (deltup-0.4.4.tar.gz) = 14905
+MD5 (bzip2-1.0.2.tar.gz) = ee76864958d568677f03db8afad92beb
+SHA256 (bzip2-1.0.2.tar.gz) = 4b526afa73ca1ccd6f5f1f5fd23813f159f715c3d0e00688f1df54b51f443cdd
+SIZE (bzip2-1.0.2.tar.gz) = 665198
+MD5 (bzip2-1.0.3.tar.gz) = 8a716bebecb6e647d2e8a29ea5d8447f
+SHA256 (bzip2-1.0.3.tar.gz) = 4aaa8e7b4ecf03d91c33e8bf92d489533fa6c1f99e825c34058003f18eb68c13
+SIZE (bzip2-1.0.3.tar.gz) = 669075
diff --git a/sysutils/deltup/files/patch-Makefile b/sysutils/deltup/files/patch-Makefile
index 3c2353f02e44..3205fd7b3eb3 100644
--- a/sysutils/deltup/files/patch-Makefile
+++ b/sysutils/deltup/files/patch-Makefile
@@ -1,5 +1,5 @@
---- Makefile.orig 2008-03-09 16:13:57.000000000 +0500
-+++ Makefile 2008-03-09 16:16:06.000000000 +0500
+--- Makefile.orig 2005-05-21 06:23:34.000000000 +0600
++++ Makefile 2008-03-10 20:39:02.000000000 +0500
@@ -1,16 +1,16 @@
DESTDIR=
-PREFIX=/usr
@@ -8,15 +8,15 @@
CC = g++
- objfiles=bpatch.o bzip2.o file.o system.o tmpstore.o deltup.o
--libs=-lstdc++ -lz -lbz2 -lssl
-+libs=-lstdc++ -lz -lbz2 -lssl -lcrypt
+-objfiles=bpatch.o bzip2.o file.o system.o tmpstore.o deltup.o
++objfiles=bpatch.o bzip2.o gzip.o file.o system.o tmpstore.o deltup.o
+ libs=-lstdc++ -lz -lbz2 -lssl
#edelta: edelta.cpp deltup
# gcc edelta.cpp ${CXXFLAGS} -o edelta
%.o : %.cpp
- ${CC} -c $< -o $@ -g #-Wall -pedantic #-DFIXED_FRAMERATE
-+ ${CC} -c $< -o $@ ${CXXFLAGS} -g #-Wall -pedantic #-DFIXED_FRAMERATE
++ ${CC} -c $< -o $@ ${CXXFLAGS} #-g #-Wall -pedantic #-DFIXED_FRAMERATE
all: deltup
diff --git a/sysutils/deltup/files/patch-bzip2.cpp b/sysutils/deltup/files/patch-bzip2.cpp
index df0526a0db1d..4d59e4add48c 100644
--- a/sysutils/deltup/files/patch-bzip2.cpp
+++ b/sysutils/deltup/files/patch-bzip2.cpp
@@ -1,16 +1,16 @@
--- bzip2.cpp.orig 2007-03-25 04:59:24.000000000 +0600
-+++ bzip2.cpp 2008-03-09 11:19:55.000000000 +0500
++++ bzip2.cpp 2008-03-09 23:37:35.000000000 +0500
@@ -19,6 +19,7 @@
#include "system.h"
#include "tmpstore.h"
#include "bzip2.h"
+#include <stdio.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 +32,12 @@
system(command.c_str());
-
+
FILE * fp;
- char * line = NULL;
+ char line[2*CHAR_MAX];
diff --git a/sysutils/deltup/files/patch-deltup.cpp b/sysutils/deltup/files/patch-deltup.cpp
index 5bb7ddc6dff9..8fbca3d3681b 100644
--- a/sysutils/deltup/files/patch-deltup.cpp
+++ b/sysutils/deltup/files/patch-deltup.cpp
@@ -1,6 +1,109 @@
--- deltup.cpp.orig 2007-07-13 09:22:20.000000000 +0600
-+++ deltup.cpp 2008-03-08 23:18:08.000000000 +0500
-@@ -520,14 +520,14 @@
++++ deltup.cpp 2008-03-10 14:03:08.000000000 +0500
+@@ -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) {
+@@ -315,7 +325,7 @@
+ }
+ }
+ switch (patch_compression_type) {
+- case GZIP: deflate("gzip", finalName, patchfname, patch_compression, false); break;
++ case GZIP: deflate("gzip", finalName, patchfname, patch_compression, false); break;
+ case BZIP2: deflate("bzip2", finalName, patchfname, patch_compression, false); break;
+ case UNKNOWN_FMT: cat(finalName, patchfname, false); break;
+ }
+@@ -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()) {
diff --git a/sysutils/deltup/files/patch-gzip.cpp b/sysutils/deltup/files/patch-gzip.cpp
new file mode 100644
index 000000000000..ada647dcc6b7
--- /dev/null
+++ b/sysutils/deltup/files/patch-gzip.cpp
@@ -0,0 +1,62 @@
+--- gzip.cpp.orig 1970-01-01 05:00:00.000000000 +0500
++++ gzip.cpp 2008-03-10 14:15:19.000000000 +0500
+@@ -0,0 +1,59 @@
++/* 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>
++
++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) {
++ printf("found gnu gzip compressor/decompressor:\n");
++ if (gzip_name!=NULL) printf(" %s\n", gzip_name);
++ }
++}
diff --git a/sysutils/deltup/files/patch-gzip.h b/sysutils/deltup/files/patch-gzip.h
new file mode 100644
index 000000000000..d15920a4f00a
--- /dev/null
+++ b/sysutils/deltup/files/patch-gzip.h
@@ -0,0 +1,20 @@
+--- 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();