summaryrefslogtreecommitdiff
path: root/net-p2p/dctc/Makefile
blob: 56dd0beeb906d8ace58816e0002c27850ddea45a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# New ports collection makefile for:	Direct Connect Text Client
# Date created:				Thu Nov 22 00:19:27 BRST 2001
# Whom:			Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	dctc
PORTVERSION=	0.80.5
CATEGORIES=	net
MASTER_SITES=	http://ac2i.tzo.com/dctc/
DISTNAME=	${PORTNAME}-${PORTVERSION}

MAINTAINER=	lioux@FreeBSD.org

BUILD_DEPENDS=	makedepend:${PORTSDIR}/devel/makedepend
LIB_DEPENDS=	db4.0:${PORTSDIR}/databases/db4 \
		gnugetopt.1:${PORTSDIR}/devel/libgnugetopt

USE_GLIB=	yes
USE_PERL5=	yes
GNU_CONFIGURE=	yes
CONFIGURE_ENV=  CPPFLAGS="-I${LOCALBASE}/include \
		${PTHREAD_CFLAGS}" \
		LDFLAGS="-L${LOCALBASE}/lib -lgnugetopt \
		${PTHREAD_LIBS}"
CONFIGURE_ARGS=	--enable-manual-db-detect
MANCOMPRESSED=	no

MAN1=	dctc.1

DOC_DIRS=	Documentation Documentation/DCextensions
DOC_FILES=      COPYING ChangeLog INSTALL README \
		KNOWN_BUGS TODO \
		Documentation/BerkeleyDB \
		Documentation/BerkeleyDB.nl \
		Documentation/DCextensions/p2p_capabilities \
		Documentation/DCextensions/search_by_content \
		Documentation/GDL.nl \
		Documentation/GDL Documentation/VAR \
		Documentation/UNODE Documentation/Vshare \
		Documentation/Vshare.nl \
		Documentation/commands \
		Documentation/programs.nl \
		Documentation/programs.pl \
		Documentation/output Documentation/programs

post-patch:
.for file in ${DOC_FILES}
	@${PERL} -pi -e 's|(hublist)|dc_\1|' ${WRKSRC}/${file}
.endfor
	@${PERL} -pi -e 's/(CK?\(std)(out\))/\1_\2/' ${WRKSRC}/src/*
	@${PERL} -pi -e 's/(CK?\()inet_ntoa(\))/\1shared_info\2/' ${WRKSRC}/src/*
	@${FIND} ${WRKSRC} -type f | ${XARGS} -n 10 ${PERL} -pi -e \
		's|include.+<linux/sem.h>|include <sys/ipc.h>\n#include <sys/sem.h>|; \
		s|<(db.h>)|<db4/\1|'
	@${PERL} -pi -e 's|(db)-|\1|g;s|db4.0|db4|' \
		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
	@${PERL} -pi -e 's|/usr/bin/perl|${PERL}|' \
		${WRKSRC}/ForcejoinGDL.pl

pre-build:
	@${ECHO_CMD} '#ifndef MSG_NOSIGNAL' >> ${CONFIGURE_WRKSRC}/config.h
	@${ECHO_CMD} '# define MSG_NOSIGNAL 0' >> ${CONFIGURE_WRKSRC}/config.h
	@${ECHO_CMD} '#endif' >> ${CONFIGURE_WRKSRC}/config.h
	@${ECHO_CMD} '#include <errno.h>' >> ${CONFIGURE_WRKSRC}/config.h
	@${ECHO_CMD} '#ifndef ENODATA' >> ${CONFIGURE_WRKSRC}/config.h
	@${ECHO_CMD} '# define ENODATA ENOMSG' >> ${CONFIGURE_WRKSRC}/config.h
	@${ECHO_CMD} '#endif' >> ${CONFIGURE_WRKSRC}/config.h
	@${ECHO_CMD} '#include <sys/param.h>' >> ${CONFIGURE_WRKSRC}/config.h

do-install:
.ifndef(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
.for dir in ${DOC_DIRS}
	@${MKDIR} ${DOCSDIR}/${dir}
.endfor
.for file in ${DOC_FILES}
	@${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}/${file}
.endfor
.endif
	@${MKDIR} ${PREFIX}/share/${PORTNAME}
	@${INSTALL_SCRIPT} ${WRKSRC}/ForcejoinGDL.pl \
		${PREFIX}/share/${PORTNAME}
	@${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1
	@${INSTALL_PROGRAM} ${WRKSRC}/src/hublist ${PREFIX}/bin/dc_hublist
	@${INSTALL_PROGRAM} ${WRKSRC}/src/dctc ${PREFIX}/bin

.include <bsd.port.mk>