aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/gnunet/Makefile
blob: f7e43c5c11e0dc96312f2ab88d366596f9dcb954 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# ex:ts=8
# Ports collection makefile for:	GNUnet
# Date created:			Mar 23, 2002
# Whom:				ijliao
#
# $FreeBSD$
#

PORTNAME=	gnunet
DISTVERSION=	0.9.2
PORTREVISION=	2
CATEGORIES=	net-p2p ipv6 security
MASTER_SITES=	GNU

MAINTAINER=	bf@FreeBSD.org
COMMENT=	An anonymous, distributed, reputation-based network

LICENSE=	GPLv3

LIB_DEPENDS=	unistring:${PORTSDIR}/devel/libunistring \
		curl:${PORTSDIR}/ftp/curl \
		glpk:${PORTSDIR}/math/glpk \
		gmp:${PORTSDIR}/math/gmp \
		gcrypt:${PORTSDIR}/security/libgcrypt \
		extractor:${PORTSDIR}/textproc/libextractor

OPTIONS=	HTTP	"Enable HTTP transport via libmicrohttpd" off \
		MYSQL	"Use MySQL for the datastore and datacache" off \
		NLS	"Enable Native Language support" on \
		PGSQL	"Use PostgreSQL for the datastore and datacache" off \
		SQLITE	"Use SQLite for the datastore and datacache" on

USE_AUTOTOOLS=	libltdl libtool
USE_GMAKE=	yes
USE_ICONV=	yes
USE_LDCONFIG=	yes

CONFIGURE_ARGS =	--with-daemon-home-dir=${GNUNET_DAEMON_DIR} \
			--with-daemon-config-dir=${PREFIX}/etc \
			--with-extractor=${LOCALBASE} \
			--with-libcurl=${LOCALBASE} \
			--with-libgcrypt-prefix=${LOCALBASE} \
			--with-libunistring-prefix=${LOCALBASE} \
			--with-ltdl-include=${LOCALBASE}/include \
			--with-ltdl-lib=${LOCALBASE}/lib

GROUPS =	gnunet
USERS=		gnunet

MAN1=	gnunet-arm.1 gnunet-directory.1 gnunet-download.1 \
	gnunet-download-manager.1 gnunet-fs.1 gnunet-nat-server.1 \
	gnunet-peerinfo.1 gnunet-pseudonym.1 gnunet-publish.1 \
	gnunet-search.1 gnunet-statistics.1 gnunet-transport.1 \
	gnunet-unindex.1 gnunet-vpn.1

#If a non-default GNUNET_DAEMON_DIR is defined, the home directory
#of the gnunet user may need to be adjusted -- e.g., via:
#pw usermod gnunet -d $GNUNET_DAEMON_DIR
GNUNET_DAEMON_DIR?=		/var/lib/gnunet
PLIST_SUB=	GNUNET_DAEMON_DIR=${GNUNET_DAEMON_DIR}
SUB_FILES=	pkg-message

.include <bsd.port.pre.mk>

.if !defined(NOPORTDOCS)
PORTDOCS=	AUTHORS COPYING ChangeLog NEWS README
.endif

.if !defined(NOPORTEXAMPLES)
PORTEXAMPLES=	gnunet_janitor.py gnunet_pyexpect.py hostlist.cgi hostlist.php \
report.sh
.endif

.if defined(WITH_HTTP)
BROKEN =	WITH_HTTP requires libmicrohttpd 0.9.18 or higher
LIB_DEPENDS+=		microhttpd:${PORTSDIR}/www/libmicrohttpd
CONFIGURE_ARGS+=	--with-microhttpd=${LOCALBASE}
PLIST_SUB+=		HTTP=""
.else
CONFIGURE_ARGS+=	--without-microhttpd
PLIST_SUB+=		HTTP="@comment "
.endif

.if defined(WITH_MYSQL)
USE_MYSQL=		yes
CONFIGURE_ARGS+=	--with-mysql=${LOCALBASE}
PLIST_SUB+=		MYSQL=""
.else
.if !(defined(WITH_PGSQL) || defined(WITH_SQLITE))
IGNORE =	define at least one of WITH_MYSQL, WITH_PGSQL, and WITH_SQLITE
.endif
CONFIGURE_ARGS+=	--without-mysql
PLIST_SUB+=		MYSQL="@comment "
.endif

.if !defined(WITHOUT_NLS)
USE_GETTEXT=	yes
CONFIGURE_ARGS+=	--with-libintl-prefix=${LOCALBASE}
PLIST_SUB+=		NLS=""
.else
CONFIGURE_ARGS+=	--disable-nls
PLIST_SUB+=		NLS="@comment "
.endif

.if defined(WITH_PGSQL)
USE_PGSQL=		yes
CONFIGURE_ARGS+=	--with-postgres=${LOCALBASE}
PLIST_SUB+=		PGSQL=""
.else
CONFIGURE_ARGS+=	--without-postgres
PLIST_SUB+=		PGSQL="@comment "
.endif

.if defined(WITH_SQLITE)
USE_SQLITE=		yes
CONFIGURE_ARGS+=	--with-sqlite=${LOCALBASE}
PLIST_SUB+=		SQLITE=""
.else
CONFIGURE_ARGS+=	--without-sqlite
PLIST_SUB+=		SQLITE="@comment "
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|postgresql/||g' \
		${WRKSRC}/configure \
		${WRKSRC}/src/datacache/plugin_datacache_postgres.c \
		${WRKSRC}/src/datastore/plugin_datastore_postgres.c
	@${REINPLACE_CMD} \
	-e 's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' \
		${WRKSRC}/pkgconfig/Makefile.in

post-install:
	@${PRINTF} "%s\n%s\n%s\n" "[PATHS]" "SERVICEHOME = ${GNUNET_DAEMON_DIR}" \
	"DEFAULTCONFIG = ${PREFIX}/etc/gnunet.conf" > ${PREFIX}/etc/gnunet.conf.sample
.if !exists(${PREFIX}/etc/gnunet.conf)
	@${CP} ${PREFIX}/etc/gnunet.conf.sample ${PREFIX}/etc/gnunet.conf
.endif
.if !exists(${GNUNET_DAEMON_DIR})
	@${INSTALL} -d -o gnunet -g gnunet -m 700 ${GNUNET_DAEMON_DIR}
.endif
	@${INSTALL_PROGRAM} ${WRKSRC}/contrib/timeout_watchdog ${PREFIX}/bin
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	@cd ${WRKSRC}; ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
.if !defined(NOPORTEXAMPLES)
	@${MKDIR} ${EXAMPLESDIR}
	@cd ${WRKSRC}/contrib; ${INSTALL_DATA} ${PORTEXAMPLES} ${EXAMPLESDIR}
.endif
	@${ECHO_CMD} ""
	@${CAT} ${PKGMESSAGE}
	@${ECHO_CMD} ""

.include <bsd.port.post.mk>