View | Details | Raw Unified | Return to bug 30143
Collapse All | Expand All

(-)net/cnet/Makefile (-17 / +13 lines)
Lines 6-19 Link Here
6
#
6
#
7
7
8
PORTNAME=	cnet
8
PORTNAME=	cnet
9
PORTVERSION=	1.6
9
PORTVERSION=	1.7.4
10
PORTREVISION=	3
11
CATEGORIES=	net tk82
10
CATEGORIES=	net tk82
12
MASTER_SITES=	http://www.cs.uwa.edu.au/cnet/
11
MASTER_SITES=	http://www.cs.uwa.edu.au/cnet/
12
EXTRACT_SUFX=	.tgz
13
13
14
MAINTAINER=	ports@FreeBSD.org
14
MAINTAINER=	ports@FreeBSD.org
15
15
16
LIB_DEPENDS=	tk82.1:${PORTSDIR}/x11-toolkits/tk82
16
LIB_DEPENDS=	tk83.1:${PORTSDIR}/x11-toolkits/tk83
17
17
18
USE_X_PREFIX=	yes
18
USE_X_PREFIX=	yes
19
USE_XPM=	yes
19
USE_XPM=	yes
Lines 21-49 Link Here
21
ALL_TARGET=	# empty
21
ALL_TARGET=	# empty
22
MAN1=		cnet.1
22
MAN1=		cnet.1
23
23
24
post-extract:
25
	${CP} ${FILESDIR}/Makefile.freebsd ${WRKSRC}/src
26
	${CP} ${FILESDIR}/compile.c ${WRKSRC}/src/compile/freebsd.c
27
28
post-patch:
24
post-patch:
29
	@${PERL} -pi.in \
25
	@${PERL} -pi -e 's|8.2|8.3|g ; \
30
		-e "s|%%CC%%|${CC}|g;" \
26
		 s|82|83|g' ${WRKSRC}/src/Makefile.freebsd
31
		-e "s|%%PREFIX%%|${PREFIX}|g;" \
27
	@${PERL} -pi -e 's|%%CC%%|${CC}|g ; \
32
			${WRKSRC}/src/config.h
28
		 s|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/src/config.h
33
29
34
do-install:
30
do-install:
35
	${INSTALL_PROGRAM} ${WRKSRC}/src/cnet ${PREFIX}/bin
31
	${INSTALL_PROGRAM} ${WRKSRC}/src/cnet ${PREFIX}/bin
36
	${INSTALL_DATA} ${WRKSRC}/src/cnet.h ${PREFIX}/include
32
	${INSTALL_DATA} ${WRKSRC}/src/cnet.h ${PREFIX}/include
37
	${INSTALL_MAN} ${WRKSRC}/DOC/cnet.man ${PREFIX}/man/man1/cnet.1
33
	${INSTALL_MAN} ${WRKSRC}/DOC/cnet.man ${PREFIX}/man/man1/cnet.1
38
	@${MKDIR} ${PREFIX}/share/cnet
34
	@${MKDIR} ${DATADIR}
39
	${INSTALL_DATA} ${WRKSRC}/cnetlib/* ${PREFIX}/share/cnet
35
	${INSTALL_DATA} ${WRKSRC}/cnetlib/* ${DATADIR}
40
.if !defined(NOPORTDOCS)
36
.if !defined(NOPORTDOCS)
41
	@${MKDIR} ${PREFIX}/share/examples/cnet
37
	@${MKDIR} ${PREFIX}/share/examples/cnet
42
	${INSTALL_DATA} ${WRKSRC}/EXAMPLES/* ${PREFIX}/share/examples/cnet
38
	${INSTALL_DATA} ${WRKSRC}/EXAMPLES/* ${PREFIX}/share/examples/cnet
43
	@${MKDIR} ${PREFIX}/share/doc/cnet
39
	@${MKDIR} ${DOCSDIR}
44
	${INSTALL_DATA} ${WRKSRC}/DOC/*.html ${PREFIX}/share/doc/cnet
40
	${INSTALL_DATA} ${WRKSRC}/DOC/*.html ${DATADIR}
45
	@${MKDIR} ${PREFIX}/share/doc/cnet/images
41
	@${MKDIR} ${DOCSDIR}/images
46
	${INSTALL_DATA} ${WRKSRC}/DOC/images/* ${PREFIX}/share/doc/cnet/images
42
	${INSTALL_DATA} ${WRKSRC}/DOC/images/* ${DATADIR}/images
47
.endif
43
.endif
48
44
49
.include <bsd.port.mk>
45
.include <bsd.port.mk>
(-)net/cnet/distinfo (-1 / +1 lines)
Line 1 Link Here
1
MD5 (cnet-1.6.tar.gz) = fc7fa25547dce8966237e58274ef0f51
1
MD5 (cnet-1.7.4.tgz) = 836521358e164ef1c742163740e1e08a
(-)net/cnet/files/Makefile.freebsd (-28 lines)
Lines 1-28 Link Here
1
#
2
# The following #defines are for FreeBSD
3
#
4
XINCLUDES	= -I${X11BASE}/include
5
XLIBS		= -lXpm -lX11 -lm -L${X11BASE}/lib
6
7
ANSICC		= ${CC}
8
9
INCLUDES	= -I${LOCALBASE}/include \
10
		  -I${LOCALBASE}/include/tcl8.2 \
11
		  -I${LOCALBASE}/include/tk8.2
12
CFLAGS		+= $(INCLUDES) $(XINCLUDES)
13
14
LD		= ${CC}
15
LIBDIRS		= -L${LOCALBASE}/lib
16
LIBS		= -ltcl82 -ltk82 -lm -lgnuregex
17
STRIP		= strip
18
19
BINDIR		= ${PREFIX}/bin
20
MANDIR		= ${PREFIX}/man/manl
21
MANEXT		= 1
22
INCDIR		= ${PREFIX}/include
23
24
25
# ---------------------- No user-serviceable code below -----------------
26
27
include	Makefile.common
28
(-)net/cnet/files/compile.c (-75 lines)
Lines 1-75 Link Here
1
#include <dlfcn.h>
2
#include <nlist.h>
3
4
static int add_compile_args(int ac, char *av[], int kflag)
5
{
6
    av[ac++] =	"-fPIC";
7
    return(ac);
8
}
9
10
11
static int add_link_args(int ac, char *av[], int kflag)
12
{
13
    av[ac++] =	findenv("CNETLD", CNETLD);
14
    av[ac++] =	"ld";
15
    av[ac++] =	"-shared";
16
    return(ac);
17
}
18
19
20
static void data_segments(int n, void *handle, char *so_filenm)
21
{
22
    extern int	 	nlist(const char *, struct nlist *);
23
24
    typedef struct _c {
25
	char		*so_filenm;
26
	unsigned long	length_data;
27
	char		*incore_data;
28
	char		*original_data;
29
	struct _c	*next;
30
    } CACHE;
31
32
    static CACHE	*chd = (CACHE *)NULL;
33
    CACHE		*cp  = chd;
34
35
    NODE		*np	= &NP[n];
36
    struct nlist	nls[3];
37
38
    while(cp != (CACHE *)NULL) {
39
	if(strcmp(cp->so_filenm, so_filenm) == 0)
40
	    goto found;
41
	cp	= cp->next;
42
    }
43
44
    nls[0].n_name	= "__DYNAMIC";
45
    nls[1].n_name	= "_end";
46
    nls[2].n_name	= (char *)NULL;
47
48
    if(nlist(so_filenm, nls) != 0) {
49
	fprintf(stderr,"%s: cannot load symbols from %s\n",
50
					argv0,so_filenm);
51
	++nerrors;
52
	return;
53
    }
54
55
    cp			= (CACHE *)malloc(sizeof(CACHE));
56
    cp->so_filenm	= strdup(so_filenm);
57
    cp->length_data	= (nls[1].n_value - nls[0].n_value);
58
    cp->incore_data	= (char *)((long)dlsym(handle,"end") - cp->length_data);
59
    cp->original_data	= (char *)malloc(cp->length_data);
60
    memcpy(cp->original_data, cp->incore_data, cp->length_data);
61
    cp->next		= chd;
62
    chd			= cp;
63
64
    if(vflag)
65
	fprintf(stderr,"%s dataseg=0x%08lx len(dataseg)=%ld\n",
66
			    so_filenm, (long)cp->incore_data, cp->length_data);
67
found:
68
69
    np->length_data[0]		= cp->length_data;
70
    np->incore_data[0]		= cp->incore_data;
71
    np->original_data[0]	= cp->original_data;
72
73
    np->private_data[0]		= (char *)malloc(cp->length_data);
74
    memcpy(np->private_data[0], cp->original_data, cp->length_data);
75
}
(-)net/cnet/files/patch-ab (-13 lines)
Lines 1-13 Link Here
1
--- src/cnetheader.h.orig	Thu Jul 24 09:15:13 1997
2
+++ src/cnetheader.h	Sun Aug 16 23:27:41 1998
3
@@ -22,6 +22,10 @@
4
 #define	NDATASEGS		1
5
 #define	LENDATA_EVER_0		FALSE
6
 
7
+#elif	defined(USE_FREEBSD)
8
+#define	NDATASEGS		1
9
+#define	LENDATA_EVER_0		FALSE
10
+
11
 #elif	defined(USE_SOLARIS2)
12
 #define	NDATASEGS		1
13
 #define	LENDATA_EVER_0		FALSE
(-)net/cnet/files/patch-ad (-13 lines)
Lines 1-13 Link Here
1
--- src/compile.c.orig	Sat May 13 03:41:53 2000
2
+++ src/compile.c	Sat Jul 22 01:44:09 2000
3
@@ -25,6 +25,10 @@
4
 #elif	defined(USE_IRIX5)
5
 #include "compile/irix5.c"
6
 
7
+#elif	defined(USE_FREEBSD)
8
+#include <dlfcn.h>
9
+#include "compile/freebsd.c"
10
+
11
 #elif	defined(USE_WIN32)
12
 #include <process.h>
13
 #include "compile/win32.c"
(-)net/cnet/files/patch-ae (-35 lines)
Lines 1-35 Link Here
1
--- src/config.h.orig	Thu Jun 22 16:39:34 2000
2
+++ src/config.h	Sat Jul 22 01:41:04 2000
3
@@ -19,6 +19,9 @@
4
 #elif	defined(sgi) || defined(__sgi) || defined(__sgi__)
5
 #define	USE_IRIX5
6
 
7
+#elif	defined(__FreeBSD__)
8
+#define	USE_FREEBSD
9
+
10
 #elif	defined(_WIN32)
11
 /* Don't get too excited here . The Windows implementation is still being
12
    developed and will first appear in the non-alpha version of 1.6.
13
@@ -78,6 +81,13 @@
14
 #define	CNETGCC		"/usr/local/bin/gcc"
15
 #define	CNETLD		"/bin/ld"
16
 
17
+#elif	defined(USE_FREEBSD)
18
+#define	OS_DEFINE	"-DFREEBSD"
19
+#define	CNETCPP		"/usr/libexec/cpp"
20
+#define	CNETCC		"%%CC%%"
21
+#define	CNETGCC		"%%CC%%"
22
+#define	CNETLD		"/usr/bin/ld"
23
+
24
 #elif	defined(USE_WIN32)
25
 #define	OS_DEFINE	"/DWIN32"
26
 #endif
27
@@ -102,7 +112,7 @@
28
     CNETPATH must be defined.
29
  */
30
 
31
-#define	CNETPATH	".:/cslinux/cnetlib:/home/chris/cnetlib"
32
+#define	CNETPATH	".:%%PREFIX%%/share/cnet:%%PREFIX%%/include"
33
 
34
 
35
 /*  A small number of common errors are detected by cnet at run-time.
(-)net/cnet/files/patch-af (-20 lines)
Lines 1-20 Link Here
1
--- src/Makefile.orig	Mon Feb  7 02:49:35 2000
2
+++ src/Makefile	Sat Jul 22 01:42:34 2000
3
@@ -14,6 +14,8 @@
4
 		make -f Makefile.osf1 $(NAME) ; fi
5
 	@if uname -s -r | grep "IRIX" ; then \
6
 		make -f Makefile.irix5 $(NAME) ; fi
7
+	@if uname -s -r | grep "FreeBSD" ; then \
8
+		$(MAKE) -f Makefile.freebsd $(NAME) ; fi
9
 	cp cnet ..
10
 
11
 install:
12
@@ -27,6 +29,8 @@
13
 		make -f Makefile.osf1 install ; fi
14
 	@if uname -s -r | grep "IRIX" ; then \
15
 		make -f Makefile.irix5 install ; fi
16
+	@if uname -s -r | grep "FreeBSD" ; then \
17
+		$(MAKE) -f Makefile.freebsd install ; fi
18
 
19
 # ---------------------------------------------------------------------
20
 
(-)net/cnet/pkg-plist (-1 / +2 lines)
Lines 10-16 Link Here
10
share/cnet/next.gif
10
share/cnet/next.gif
11
share/cnet/os2.gif
11
share/cnet/os2.gif
12
share/cnet/palm.gif
12
share/cnet/palm.gif
13
share/cnet/palm.xpm
14
share/cnet/paused.gif
13
share/cnet/paused.gif
15
share/cnet/repair.gif
14
share/cnet/repair.gif
16
share/cnet/router.gif
15
share/cnet/router.gif
Lines 19-24 Link Here
19
share/cnet/windows.gif
18
share/cnet/windows.gif
20
share/cnet/zap.gif
19
share/cnet/zap.gif
21
%%PORTDOCS%%share/doc/cnet/application.html
20
%%PORTDOCS%%share/doc/cnet/application.html
21
%%PORTDOCS%%share/doc/cnet/drawframes.html
22
%%PORTDOCS%%share/doc/cnet/enumerated.html
22
%%PORTDOCS%%share/doc/cnet/enumerated.html
23
%%PORTDOCS%%share/doc/cnet/eventdriven.html
23
%%PORTDOCS%%share/doc/cnet/eventdriven.html
24
%%PORTDOCS%%share/doc/cnet/eventfuncs.html
24
%%PORTDOCS%%share/doc/cnet/eventfuncs.html
Lines 26-31 Link Here
26
%%PORTDOCS%%share/doc/cnet/functions.html
26
%%PORTDOCS%%share/doc/cnet/functions.html
27
%%PORTDOCS%%share/doc/cnet/images/UWAsmall.gif
27
%%PORTDOCS%%share/doc/cnet/images/UWAsmall.gif
28
%%PORTDOCS%%share/doc/cnet/images/australia.gif
28
%%PORTDOCS%%share/doc/cnet/images/australia.gif
29
%%PORTDOCS%%share/doc/cnet/images/drawframes.gif
29
%%PORTDOCS%%share/doc/cnet/images/mainlink.gif
30
%%PORTDOCS%%share/doc/cnet/images/mainlink.gif
30
%%PORTDOCS%%share/doc/cnet/images/mainstdio.gif
31
%%PORTDOCS%%share/doc/cnet/images/mainstdio.gif
31
%%PORTDOCS%%share/doc/cnet/images/mainwindow.gif
32
%%PORTDOCS%%share/doc/cnet/images/mainwindow.gif

Return to bug 30143