View | Details | Raw Unified | Return to bug 184585 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-6 / +22 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	jbigkit
4
PORTNAME=	jbigkit
5
PORTVERSION=	1.6
5
PORTVERSION=	2.1
6
CATEGORIES=	graphics
6
CATEGORIES=	graphics
7
MASTER_SITES=	http://www.cl.cam.ac.uk/~mgk25/download/
7
MASTER_SITES=	http://www.cl.cam.ac.uk/~mgk25/download/
8
8
Lines 9-24 Link Here
9
MAINTAINER=	mi@aldan.algebra.com
9
MAINTAINER=	mi@aldan.algebra.com
10
COMMENT=	Lossless compression for bi-level images such as scanned pages, faxes
10
COMMENT=	Lossless compression for bi-level images such as scanned pages, faxes
11
11
12
WRKSRC=	${WRKDIR}/${PORTNAME}
13
USE_LDCONFIG=	yes
12
USE_LDCONFIG=	yes
14
13
MAN1=	jbgtopbm.1 pbmtojbg.1
14
BINS=	jbgtopbm pbmtojbg jbgtopbm85 pbmtojbg85
15
LIBS=	libjbig.a libjbig.so.2 libjbig85.a libjbig85.so.1
15
DOCSDIR?=	${PREFIX}/share/doc/jbig
16
DOCSDIR?=	${PREFIX}/share/doc/jbig
16
17
17
post-install:
18
do-install:
19
	${INSTALL_PROGRAM}	\
20
		${BINS:S|^|${WRKSRC}/pbmtools/|} ${STAGEDIR}${PREFIX}/bin
21
22
	${INSTALL_MAN}	\
23
		${MAN1:S|^|${WRKSRC}/pbmtools/|} ${STAGEDIR}${MANPREFIX}/man/man1
24
25
	${INSTALL_DATA} ${WRKSRC}/libjbig/*.h ${STAGEDIR}${PREFIX}/include
26
27
	${INSTALL_DATA}	\
28
		${LIBS:S|^|${WRKSRC}/libjbig/|} ${STAGEDIR}${PREFIX}/lib
29
	${LN} -sf libjbig.so.1 ${STAGEDIR}${PREFIX}/lib/libjbig.so
30
	${LN} -sf libjbig85.so.1 ${STAGEDIR}${PREFIX}/lib/libjbig85.so
31
32
.if !defined(NOPORTDOCS)
18
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
33
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
19
	@${INSTALL_DATA} ${WRKSRC}/libjbig/jbig.doc ${STAGEDIR}${DOCSDIR}
34
	${INSTALL_DATA} ${WRKSRC}/libjbig/jbig.txt ${STAGEDIR}${DOCSDIR}
35
.endif
20
36
21
post-build test:
37
regression-test test:
22
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} LD_LIBRARY_PATH=${WRKSRC}/libjbig ${MAKE} test
38
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} LD_LIBRARY_PATH=${WRKSRC}/libjbig ${MAKE} test
23
39
24
.include <bsd.port.mk>
40
.include <bsd.port.mk>
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (jbigkit-1.6.tar.gz) = d841b6d0723c1082450967f3ea500be01810a34ec4a97ad10985ae7071a6150b
1
SHA256 (jbigkit-2.1.tar.gz) = de7106b6bfaf495d6865c7dd7ac6ca1381bd12e0d81405ea81e7f2167263d932
2
SIZE (jbigkit-1.6.tar.gz) = 405712
2
SIZE (jbigkit-2.1.tar.gz) = 438710
(-)files/patch-aa (-53 / +9 lines)
Lines 1-7 Link Here
1
--- Makefile.orig	Tue Apr  9 19:37:13 2002
1
--- Makefile	2014-03-27 14:47:15.000000000 -0400
2
+++ Makefile	Tue Apr  9 22:45:53 2002
2
+++ Makefile	2014-04-08 08:37:59.000000000 -0400
3
@@ -2,13 +2,13 @@
3
@@ -2,12 +2,10 @@
4
 # $Id: Makefile,v 1.12 2002-04-09 11:37:13+01 mgk25 Exp $
5
 
4
 
6
 # Select an ANSI/ISO C compiler here, GNU gcc is recommended
5
 # Select an ANSI/ISO C compiler here, GNU gcc is recommended
7
-CC = gcc
6
-CC = gcc
Lines 8-61 Link Here
8
+#CC = gcc
7
+#CC = gcc
9
 
8
 
10
 # Options for the compiler: A high optimization level is suggested
9
 # Options for the compiler: A high optimization level is suggested
11
-CCFLAGS = -O2 -W
10
-CFLAGS = -O2 -W -Wno-unused-result
12
+#CCFLAGS = -O2 -W
11
+CFLAGS += -W # -Wno-unused-result -- older compilers don't have this
13
 #CCFLAGS = -O -g -W -Wall -ansi -pedantic #-DDEBUG  # developer only
12
 # CFLAGS = -O -g -W -Wall -Wno-unused-result -ansi -pedantic # -DDEBUG
14
 
13
 
15
-CFLAGS = $(CCFLAGS) -I../libjbig
14
-export CC CFLAGS
16
+CFLAGS += -I../libjbig
15
-
16
 VERSION=2.1
17
 
17
 
18
 VERSION=1.4
19
 
20
@@ -16,14 +16,14 @@
21
 	@echo "Enter 'make test' in order to start some automatic tests."
22
 
23
 lib:
24
-	(cd libjbig;  make "CC=$(CC)" "CFLAGS=$(CFLAGS)")
25
+	(cd libjbig;  $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)")
26
 
27
 pbm: lib
28
-	(cd pbmtools; make "CC=$(CC)" "CFLAGS=$(CFLAGS)")
29
+	(cd pbmtools; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)")
30
 
31
 test: lib pbm
32
-	(cd libjbig;  make "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
33
-	(cd pbmtools; make "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
34
+	(cd libjbig;  $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
35
+	(cd pbmtools; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" test)
36
 
37
 clean:
38
 	rm -f *~ core
39
@@ -36,3 +36,22 @@
40
 	  gzip -9f jbigkit-$(VERSION).tar )
41
 	mv ../jbigkit-$(VERSION).tar.gz $(HOME)/public_html/download/
42
 	cp CHANGES $(HOME)/public_html/jbigkit/
43
+
44
+install:
45
+	mkdir -p $(DESTDIR)${PREFIX}/bin
46
+	${BSD_INSTALL_PROGRAM} pbmtools/jbgtopbm pbmtools/pbmtojbg \
47
+		$(DESTDIR)${PREFIX}/bin
48
+	mkdir -p $(DESTDIR)${PREFIX}/man/man1
49
+	${BSD_INSTALL_MAN} pbmtools/pbmtojbg.1 pbmtools/jbgtopbm.1 \
50
+		$(DESTDIR)${PREFIX}/man/man1
51
+	# mkdir -p $(DESTDIR)${PREFIX}/man/man5
52
+	# Not installing the pbm(5) man page, because BSD has its own
53
+	# install -c -m 644 -o bin -g bin pbmtools/pbm.5 ${PREFIX}/man/man5
54
+	# Not installing the pgm(5) man page for it comes with netpbm port
55
+	# install -c -m 644 -o bin -g bin pbmtools/pgm.5 ${PREFIX}/man/man5
56
+	mkdir -p $(DESTDIR)${PREFIX}/include
57
+	${BSD_INSTALL_DATA} libjbig/jbig.h $(DESTDIR)${PREFIX}/include
58
+	mkdir -p $(DESTDIR)${PREFIX}/lib
59
+	${BSD_INSTALL_DATA} libjbig/libjbig.a $(DESTDIR)${PREFIX}/lib
60
+	${BSD_INSTALL_DATA} libjbig/libjbig.so.1 $(DESTDIR)${PREFIX}/lib
61
+	ln -sf libjbig.so.1 $(DESTDIR)${PREFIX}/lib/libjbig.so
(-)files/patch-ab (-30 / +28 lines)
Lines 1-40 Link Here
1
--- libjbig/Makefile	Fri Apr 10 20:33:27 1998
1
--- libjbig/Makefile	2014-03-27 14:47:15.000000000 -0400
2
+++ libjbig/Makefile	Wed Sep 16 11:57:16 1998
2
+++ libjbig/Makefile	2014-04-08 08:43:57.000000000 -0400
3
@@ -5,9 +5,11 @@
3
@@ -2,10 +2,14 @@
4
 
5
 # Select an ANSI/ISO C compiler here, GNU gcc is recommended
4
-CC = gcc
6
-CC = gcc
7
+#CC = gcc
5
 
8
 
6
 # Options for the compiler: A high optimization level is suggested
9
 # Options for the compiler: A high optimization level is suggested
7
-CFLAGS = -O -Wall -ansi -pedantic
10
-CFLAGS = -g -O -W -Wall -ansi -pedantic # --coverage
8
+CFLAGS += -Wall -ansi -pedantic
11
+CFLAGS += -W -Wall -ansi -pedantic # --coverage
9
 
12
 
10
-all: libjbig.a tstcodec
13
-all: libjbig.a libjbig85.a tstcodec tstcodec85
11
+JBIGLIB=libjbig.a
14
+all: libjbig.a libjbig85.a tstcodec tstcodec85 libjbig.so.2 libjbig85.so.1
12
+SOJBIGLIB=libjbig.so.1
13
+
15
+
14
+all: libjbig.a $(SOJBIGLIB)
16
+.SUFFIXES: .c .So
17
+.c.So:
18
+	$(CC) -c -fpic -DPIC ${CFLAGS} ${.IMPSRC} -o ${.TARGET}
15
 
19
 
16
 tstcodec: tstcodec.c jbig.c jbig.h jbig_tab.o
20
 tstcodec: tstcodec.o jbig.o jbig_ar.o
17
 	$(CC) $(CFLAGS) -o tstcodec -DTEST_CODEC tstcodec.c jbig.c \
21
@@ -20,4 +24,8 @@
18
@@ -18,10 +25,21 @@
22
 	-ranlib libjbig.a
19
 	ar rc libjbig.a jbig.o jbig_tab.o
20
 	ranlib libjbig.a
21
 
23
 
22
+$(SOJBIGLIB): jbig.so jbig_tab.so
24
+libjbig.so.2: jbig.So jbig_ar.So
23
+	rm -f ${.TARGET}
25
+	rm -f ${.TARGET}
24
+	$(CC) -o ${.TARGET} ${LDFLAGS} -shared -Wl,-soname,${.TARGET} ${.ALLSRC}         
26
+	$(CC) -o ${.TARGET} ${LDFLAGS} -shared -Wl,-soname,${.TARGET} ${.ALLSRC}
25
+	ln -sf ${.TARGET} `echo ${.TARGET} | sed 's/\.so.*$$/.so/'`
27
+
26
+	
28
 libjbig85.a: jbig85.o jbig_ar.o
27
 jbig.o: jbig.c jbig.h
29
 	rm -f libjbig85.a
30
@@ -25,4 +33,8 @@
31
 	-ranlib libjbig85.a
28
 
32
 
29
+.SUFFIXES: .c .so
33
+libjbig85.so.1: jbig85.So jbig_ar.So
30
+.c.so:
34
+	rm -f ${.TARGET}
31
+	${CC} -c -fpic -DPIC ${CFLAGS} ${.IMPSRC} -o ${.TARGET}
35
+	$(CC) -o ${.TARGET} ${LDFLAGS} -shared -Wl,-soname,${.TARGET} ${.ALLSRC}
32
+jbig.so: jbig.c jbig.h
33
+jbig_tab.so: jbig_tab.c
34
+
36
+
35
 test: tstcodec
37
 jbig.o: jbig.c jbig.h jbig_ar.h
36
 	./tstcodec
38
 jbig85.o: jbig85.c jbig85.h jbig_ar.h
37
 
38
 clean:
39
-	rm -f *.o *~ core gmon.out dbg_d\=??.pbm tstcodec
40
+	rm -f *.o *~ core gmon.out dbg_d\=??.pbm tstcodec *.so libjbig.so.1 libjbig.so.1.1 libjbig.a
(-)files/patch-ac (-9 / +25 lines)
Lines 1-16 Link Here
1
--- pbmtools/Makefile.orig	Thu Jun 25 13:30:38 1998
1
--- pbmtools/Makefile	2014-03-27 14:47:15.000000000 -0400
2
+++ pbmtools/Makefile	Thu Jun 25 13:31:00 1998
2
+++ pbmtools/Makefile	2014-04-08 09:18:42.000000000 -0400
3
@@ -5,11 +5,10 @@
3
@@ -2,14 +2,14 @@
4
 
5
 # Select an ANSI/ISO C compiler here, e.g. GNU gcc is recommended
4
-CC = gcc
6
-CC = gcc
7
+#CC = gcc
5
 
8
 
6
 # Options for the compiler
9
 # Options for the compiler
7
-CFLAGS = -g -Wall -ansi -pedantic -I../libjbig
10
-CFLAGS = -g -O -W -Wall -Wno-unused-result -ansi -pedantic # --coverage
8
+CFLAGS += -Wall -ansi -pedantic -I../libjbig
11
-CPPFLAGS = -I../libjbig 
12
+CFLAGS += -W -Wall -ansi -pedantic # --coverage -Wno-unused-result
13
+CFLAGS += -I../libjbig 
9
 
14
 
10
 .SUFFIXES: .1 .5 .txt $(SUFFIXES)
15
 .SUFFIXES: .1 .5 .txt $(SUFFIXES)
16
 .PHONY: txt test test82 test85 clean
11
 
17
 
12
-all: pbmtojbg jbgtopbm pbmtojbg.txt jbgtopbm.txt pbm.txt pgm.txt
18
-all: pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85 txt
13
+all: pbmtojbg jbgtopbm
19
+all: pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85
14
 
20
 
15
 pbmtojbg: pbmtojbg.o ../libjbig/libjbig.a
21
 txt: pbmtojbg.txt jbgtopbm.txt pbm.txt pgm.txt
16
 	$(CC) $(CFLAGS) -o pbmtojbg pbmtojbg.o -L../libjbig -ljbig
22
@@ -144,6 +144,8 @@
23
 	cmp test-$(IMG).pbm test-$(IMG).pbm85
24
 
25
-test-%.pbm: ../examples/%.jbg
26
-	./jbgtopbm $< $@
27
+.for i in 1 2 3
28
+test-ccitt$i.pbm: ../examples/ccitt$i.jbg
29
+	./jbgtopbm ${.ALLSRC} ${.TARGET}
30
+.endfor
31
 
32
 test-t82.pbm:
(-)files/patch-warnings (+36 lines)
Line 0 Link Here
1
--- pbmtools/pbmtojbg85.c	2014-03-27 14:47:15.000000000 -0400
2
+++ pbmtools/pbmtojbg85.c	2014-04-08 09:00:16.000000000 -0400
3
@@ -71,8 +71,12 @@
4
   if (c != EOF) {
5
     ungetc(c, f);
6
-    fscanf(f, "%lu", &i);
7
-  }
8
+    if (fscanf(f, "%lu", &i) == 1)
9
+       return i;
10
+    else
11
+       fprintf(stderr, "%s: corrupt input", progname);
12
+  } else
13
+       fprintf(stderr, "%s: unexpected end of input", progname);
14
 
15
-  return i;
16
+  return -1;
17
 }
18
19
--- pbmtools/pbmtojbg.c	2014-03-27 14:47:15.000000000 -0400
20
+++ pbmtools/pbmtojbg.c	2014-04-08 09:00:16.000000000 -0400
21
@@ -87,8 +87,12 @@
22
   if (c != EOF) {
23
     ungetc(c, f);
24
-    fscanf(f, "%lu", &i);
25
-  }
26
+    if (fscanf(f, "%lu", &i) == 1)
27
+       return i;
28
+    else
29
+       fprintf(stderr, "%s: corrupt input", progname);
30
+  } else
31
+       fprintf(stderr, "%s: unexpected end of input", progname);
32
 
33
-  return i;
34
+  return -1;
35
 }
36
 
(-)pkg-plist (-4 / +9 lines)
Lines 1-10 Link Here
1
bin/jbgtopbm
1
bin/jbgtopbm
2
bin/jbgtopbm85
2
bin/pbmtojbg
3
bin/pbmtojbg
4
bin/pbmtojbg85
3
include/jbig.h
5
include/jbig.h
6
include/jbig85.h
7
include/jbig_ar.h
4
lib/libjbig.a
8
lib/libjbig.a
5
lib/libjbig.so
9
lib/libjbig.so
6
lib/libjbig.so.1
10
lib/libjbig.so.2
7
man/man1/jbgtopbm.1.gz
11
lib/libjbig85.a
8
man/man1/pbmtojbg.1.gz
12
lib/libjbig85.so
9
%%PORTDOCS%%%%DOCSDIR%%/jbig.doc
13
lib/libjbig85.so.1
14
%%PORTDOCS%%%%DOCSDIR%%/jbig.txt
10
%%PORTDOCS%%@dirrm %%DOCSDIR%%
15
%%PORTDOCS%%@dirrm %%DOCSDIR%%

Return to bug 184585