ports/165287: [update] converters/chmview various fixes, take maintainership

Alex Kozlov spam at rm-rf.kiev.ua
Sun Feb 19 03:50:01 UTC 2012


>Number:         165287
>Category:       ports
>Synopsis:       [update] converters/chmview various fixes, take maintainership
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 19 03:50:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Alex Kozlov
>Release:        RELENG_8
>Organization:
private
>Environment:
>Description:
- use chmlib-0.40 instead of embedded chmlib-0.19, remove patch-bb
- improve Makefile, remove unnecessary do-install target
- make WARNS=6 clean
- remove ONLY_FOR_ARCH, new chmlib don't have such limitation
- take maintainership
>How-To-Repeat:

>Fix:
rm converters/chmview/files/patch-bb
apply patch

Patch attached with submission follows:

Index: converters/chmview/Makefile
@@ -7,27 +7,24 @@
 
 PORTNAME=	chmview
 DISTVERSION=	2.0b3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	converters textproc
 MASTER_SITES=	SF/trexinc/CHMView/2.0%20beta%203
 DISTNAME=	CHMView_${DISTVERSION}
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	spam at rm-rf.kiev.ua
 COMMENT=	Extractor from .chm files
 
+LIB_DEPENDS=	chm:${PORTSDIR}/misc/chmlib
+
 USE_ZIP=	yes
-USE_DOS2UNIX=	yes
+USE_DOS2UNIX=	chmview.c utf8.c utf8.h
 
 WRKSRC=		${WRKDIR}/src
 PLIST_FILES=	bin/chmview
 MAKE_JOBS_SAFE=	yes
 
-ONLY_FOR_ARCHS=	i386 amd64
-
 pre-patch:
-	@${CP} ${FILESDIR}/Makefile ${WRKSRC}
-
-do-install:
-	@${INSTALL_PROGRAM} ${WRKSRC}/chmview ${PREFIX}/bin/
+	@${CP} ${FILESDIR}/Makefile ${WRKSRC}
 
 .include <bsd.port.mk>
Index: converters/chmview/files/Makefile
@@ -1,27 +1,14 @@
-#
-# $FreeBSD: ports/converters/chmview/files/Makefile,v 1.3 2007/03/05 12:15:12 rafan Exp $
-#
-OBJDIR = .
-EXEDIR = .
-EXENAME = $(EXEDIR)/chmview
-
-CFLAGS += -DUNIX
-
-all: $(EXENAME)
-
-OBJS = $(OBJDIR)/chmview.o \
-       $(OBJDIR)/chm_lib.o \
-       $(OBJDIR)/lzx.o \
-       $(OBJDIR)/utf8.o
-
-$(OBJDIR)/chmview.o: chmview.c chm_lib.h
-$(OBJDIR)/chm_lib.o: chm_lib.c chm_lib.h lzx.h
-$(OBJDIR)/utf8.o: utf8.c utf8.h
-$(OBJDIR)/lzx.o: lzx.c lzx.h
-
-.c.o:
-	$(CC) $(CFLAGS) -c ${.IMPSRC}
-
-$(EXENAME): $(OBJS)
-	echo $(OBJS)
-	$(CC) $(LFLAGS) -o $(EXENAME) ${.ALLSRC}
+BINDIR?=	${PREFIX}/bin
+
+CFLAGS+=	-DUNIX -I${LOCALBASE}/include
+LDADD+=		-L${LOCALBASE}/lib -lchm
+
+WARNS?=		6
+
+NO_MAN=		yes
+
+PROG=		chmview
+
+SRCS=		chmview.c utf8.h utf8.c
+
+.include <bsd.prog.mk>
Index: converters/chmview/files/patch-aa
@@ -1,7 +1,5 @@
-diff -ruN src.old/chmview.c src/chmview.c
---- src.old/chmview.c	2005-03-07 21:29:18.000000000 +0100
-+++ chmview.c	2008-08-18 14:39:39.000000000 +0200
-@@ -17,19 +17,33 @@
+Index: chmview.c
+@@ -17,19 +17,47 @@
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
  
@@ -9,6 +7,8 @@
  #include <windows.h>
 +#endif
 +
++#include <sys/stat.h>
++#include <unistd.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
@@ -21,7 +21,8 @@
  #include <dir.h>
 +#endif
  
- #include "chm_lib.h"
+-#include "chm_lib.h"
++#include <chm_lib.h>
  #include "utf8.h"
  
 +#ifdef UNIX
@@ -29,6 +30,18 @@
 +#define MODE 0755
 +#endif
 +
++char *pointtoname(char *path);
++void ReplaceIllegalChars(char *ptr);
++void extract(struct chmFile *c, struct chmUnitInfo *ui,
++		long extractwithoutpath);
++int _extract_callback_all(struct chmFile *c, struct chmUnitInfo *ui,
++		void *context);
++int _extract_callback_dir(struct chmFile *c, struct chmUnitInfo *ui,
++		void *context);
++int extractdir(struct chmFile *c, char *path, long extractwithoutpath);
++int _print_ui(struct chmFile *c __unused, struct chmUnitInfo *ui,
++		void *context __unused);
++
  struct cb_data
  {
 -  int extractwithoutpath;
@@ -36,7 +49,7 @@
    char *path;
    int pathlen;
  };
-@@ -44,6 +58,7 @@
+@@ -44,6 +72,7 @@
    return p;
  }
  
@@ -44,7 +57,7 @@
  int makedir(char *path)
  {
    char *end;
-@@ -75,6 +90,39 @@
+@@ -75,13 +104,45 @@
    }
    return 1;
  }
@@ -52,7 +65,7 @@
 +static int makedir(char *path)
 +{
 +  char *slash;
-+  int  was_error, done, err;
++  int  was_error, done;
 +
 +  slash = path;
 +  done = 0;
@@ -84,7 +97,14 @@
  
  const char ILLEGAL_SYMB[] = "<>:|?*\"";
  const char ILLEGAL_REPL[] = "()_!__'";
-@@ -94,7 +142,7 @@
+ 
+ void ReplaceIllegalChars(char *ptr)
+ {
+-  char *org = ptr;
+   while ( *ptr )
+   {
+     const char *zz;
+@@ -94,15 +155,17 @@
    }
  }
  
@@ -93,7 +113,8 @@
  {
    LONGINT64 length=0;
    char *outbuf=NULL;
-@@ -103,6 +151,9 @@
+-  char *p;
+   FILE *f;
    char fullpath[CHM_MAX_PATHLEN*2+1];
    char target[CHM_MAX_PATHLEN*2+1];
    wchar_t temp[CHM_MAX_PATHLEN+1];
@@ -103,7 +124,7 @@
  
    if (ui->length)
    {
-@@ -116,13 +167,32 @@
+@@ -116,13 +179,32 @@
        return -1;
      }
    }
@@ -136,7 +157,7 @@
    ReplaceIllegalChars(target);
    strcat(fullpath,extractwithoutpath?pointtoname(target):(target[0]=='/'?target+1:target));
    if (!extractwithoutpath)
-@@ -147,26 +217,30 @@
+@@ -147,30 +229,38 @@
    return 0;
  }
  
@@ -163,23 +184,41 @@
    printf("OK\n");
  }
  
- int _extract_callback_all(struct chmFile *c, struct chmUnitInfo *ui, void *context)
+-int _extract_callback_all(struct chmFile *c, struct chmUnitInfo *ui, void *context)
++int _extract_callback_all(struct chmFile *c,
++		struct chmUnitInfo *ui,
++		void *context)
  {
 -  extract(c,ui,(int)context);
 +  extract(c,ui,(long)context);
    return CHM_ENUMERATOR_CONTINUE;
  }
  
-@@ -180,7 +254,7 @@
+-int _extract_callback_dir(struct chmFile *c, struct chmUnitInfo *ui, void *context)
++int _extract_callback_dir(struct chmFile *c,
++		struct chmUnitInfo *ui,
++		void *context)
+ {
+   struct cb_data *data = (struct cb_data *)context;
+   if (!_strnicmp(ui->path,data->path,data->pathlen))
+@@ -180,29 +270,35 @@
    return CHM_ENUMERATOR_CONTINUE;
  }
  
 -extractdir(struct chmFile *c, char *path, int extractwithoutpath)
-+extractdir(struct chmFile *c, char *path, long extractwithoutpath)
++int extractdir(struct chmFile *c, char *path, long extractwithoutpath)
  {
    struct cb_data data = {extractwithoutpath,path,strlen(path)};
    chm_enumerate(c,CHM_ENUMERATE_ALL,_extract_callback_dir,(void *)&data);
-@@ -193,7 +267,11 @@
+   return 0;
+ }
+ 
+-int _print_ui(struct chmFile *c, struct chmUnitInfo *ui, void *context)
++int _print_ui(struct chmFile *c __unused,
++		struct chmUnitInfo *ui,
++		void *context __unused)
+ {
+   char target[CHM_MAX_PATHLEN*2+1];
    wchar_t temp[CHM_MAX_PATHLEN+1];
  
    decode_UTF8(temp,ui->path);
@@ -191,7 +230,27 @@
  
    if ((target)[0] == '/')
    {
-@@ -243,6 +321,9 @@
+-    printf("%12.12u ",ui->length);
++    printf("%12.12llu ",ui->length);
+     printf("%s\n",target);
+   }
+   else
+   {
+-    printf("%12.12u ",ui->length);
++    printf("%12.12llu ",ui->length);
+     printf("/");
+     printf("%s\n",target);
+   }
+@@ -231,8 +327,6 @@
+   struct chmFile *c;
+   char *infname;
+   char *command;
+-  FILE *fh;
+-  int i;
+   struct chmUnitInfo ui;
+ 
+   if (argc < 3)
+@@ -243,6 +337,9 @@
  
    infname = argv[2];
  
@@ -201,7 +260,7 @@
    c = chm_open(infname);
    if (!c)
      exit(-1);
-@@ -265,7 +346,7 @@
+@@ -265,7 +362,7 @@
        char target[CHM_MAX_PATHLEN*2+1];
        wchar_t temp[CHM_MAX_PATHLEN+1];
        int status;
@@ -210,7 +269,7 @@
  
        if (argc == 4)
        {
-@@ -305,7 +386,11 @@
+@@ -305,7 +402,11 @@
              strcat(target,name+1);
            else
              strcat(target,name);


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list