aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/uhub/Makefile
blob: b14f03179490e7890d91915b3bd9d11938f0ebc0 (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
# Created by: Yashin Dmitry <yashin.dm@gmail.com>
# $FreeBSD$

PORTNAME=	uhub
PORTVERSION=	0.4.0
CATEGORIES=	net-p2p
MASTER_SITES=	http://www.extatic.org/downloads/uhub/
DISTFILES=	${PORTNAME}-${PORTVERSION}-src${EXTRACT_SUFX}

MAINTAINER=	yashin.dm@gmail.com
COMMENT=	High performance peer-to-peer hub for the ADC network

LICENSE=	GPLv3

USES=		gmake perl5
USE_PERL5=	build
USE_SQLITE=	yes

USE_RC_SUBR=	uhub
USERS=		uhub
GROUPS=		uhub
SHAREGRP=	uhub
SHAREMODE=	640

MAKEFILE=	${WRKSRC}/GNUmakefile

OPTIONS_DEFINE=	DEBUG OPENSSL
OPENSSL_DESC=	Enable OpenSSL Support (experimental)

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MOPENSSL}
USE_OPENSSL=	yes
MAKE_ARGS+=	USE_SSL=YES
.else
MAKE_ARGS+=	USE_SSL=NO
.endif

.if ${PORT_OPTIONS:MDEBUG}
CFLAGS+=	-ggdb -DDEBUG
.else
CFLAGS+=	-DNDEBUG
.endif

.include <bsd.port.pre.mk>

CFLAGS+=	-I./src/ -I${LOCALBASE}/include
MAKE_ARGS+=	UHUB_PREFIX="${PREFIX}" UHUB_CONF_DIR="${PREFIX}/etc/uhub" \
		SILENT=NO CC="${CC}" CFLAGS="${CFLAGS}"

post-patch:
	@${REINPLACE_CMD} -e 's|/etc/uhub/|${PREFIX}&|' ${WRKSRC}/doc/uhub.conf
	@${REINPLACE_CMD} -e 's|/etc/uhub/|${PREFIX}&|' ${WRKSRC}/src/uhub.h

do-install:
	@${INSTALL_PROGRAM} ${WRKSRC}/uhub ${PREFIX}/bin/uhub
	@${MKDIR} ${PREFIX}/etc/uhub
	@${INSTALL_DATA} ${WRKSRC}/doc/uhub.conf ${PREFIX}/etc/uhub/uhub.conf.sample
	@${INSTALL_DATA} ${WRKSRC}/doc/users.conf ${PREFIX}/etc/uhub/users.conf.sample
	@${INSTALL_DATA} /dev/null ${PREFIX}/etc/uhub/motd.txt.sample
	@${INSTALL_DATA} /dev/null ${PREFIX}/etc/uhub/rules.txt.sample
.for i in uhub.conf users.conf motd.txt rules.txt
	@[ ! -f ${PREFIX}/etc/uhub/${i} ] \
	&& ${CP} -p ${PREFIX}/etc/uhub/${i}.sample ${PREFIX}/etc/uhub/${i}
.endfor

.include <bsd.port.post.mk>