aboutsummaryrefslogtreecommitdiff
path: root/security/knock/Makefile
blob: b0b8584bf31119bb9b2a8b82d17ad5573e1b5e63 (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
# New ports collection makefile for:	knock
# Date Created:				2006-03-17
# Whom:					Shaun Amott <shaun@inerd.com>
#
# $FreeBSD$
#

PORTNAME=	knock
PORTVERSION=	0.5.20051124
PORTREVISION=	1
CATEGORIES=	security
MASTER_SITES=	${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR=	shaun

MAINTAINER=	sbrabez@gmail.com
COMMENT=	A flexible port-knocking server and client

GNU_CONFIGURE=	yes

CFLAGS+=	-I${LOCALBASE}/include

OPTIONS=	SERVER		"Install knockd server"		on \
		CLIENT		"Install knock client"		on

RUNDIR=		/var/run
SUB_LIST=	RUNDIR=${RUNDIR}

.include <bsd.port.pre.mk>

.if defined(WITH_SERVER)
MAN1=		knockd.1
USE_RC_SUBR=	knockd.sh
PLIST_FILES+=	bin/knockd
PLIST_FILES+=	etc/knockd.conf.sample
.endif

.if defined(WITH_CLIENT)
MAN1+=		knock.1
PLIST_FILES+=	bin/knock
.endif

pre-configure:
.if defined(WITHOUT_SERVER) && defined(WITHOUT_CLIENT)
IGNORE=		at least one component must be selected for installation
.endif

post-patch:
	@${REINPLACE_CMD} -e "s#%%PREFIX%%#${PREFIX}#g"	\
			  -e "s#%%RUNDIR%%#${RUNDIR}#g"	\
			  -e "s#eth0#fxp0#g"		\
			  ${WRKSRC}/src/knockd.c

	@${REINPLACE_CMD} -e "s/#VERSION#/${PORTVERSION}/g" \
			  -e "s#eth0#fxp0#g"		    \
			  ${WRKSRC}/doc/knock.1.in	    \
			  ${WRKSRC}/doc/knockd.1.in

do-install:
.if defined(WITH_SERVER)
	${INSTALL_PROGRAM} ${WRKSRC}/knockd ${PREFIX}/bin
	${INSTALL_DATA} ${WRKSRC}/knockd.conf ${PREFIX}/etc/knockd.conf.sample
.endif

.if defined(WITH_CLIENT)
	${INSTALL_PROGRAM} ${WRKSRC}/knock ${PREFIX}/bin
.endif

post-install-script:
.if defined(WITH_SERVER)
	${INSTALL_MAN} ${WRKSRC}/doc/knockd.1.in ${MAN1PREFIX}/man/man1/knockd.1
.endif

.if defined(WITH_CLIENT)
	${INSTALL_MAN} ${WRKSRC}/doc/knock.1.in ${MAN1PREFIX}/man/man1/knock.1
.endif

.include <bsd.port.post.mk>