summaryrefslogtreecommitdiffstats
path: root/security/acme-client/Makefile
blob: 18881cdcd24d32913ed90c5b627a58df52f5857d (plain)
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
# Created by: Bernard Spil <brnrd@FreeBSD.org>
# $FreeBSD$

PORTNAME=	acme-client
PORTVERSION=	0.1.16
DISTVERSIONPREFIX=	portable-
CATEGORIES=	security
MASTER_SITES=	https://kristaps.bsd.lv/${PORTNAME}/snapshots/ \
		LOCAL/brnrd

MAINTAINER=	brnrd@FreeBSD.org
COMMENT=	Native C client for Let's Encrypt, designed for security

LICENSE=	ISCL

RUN_DEPENDS=	${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss

USES=		gmake tar:tgz ssl

MAKEFILE=	GNUmakefile
MAKE_ENV=	PREFIX=${STAGEDIR}/${PREFIX}

WWWDIR=		${PREFIX}/www/acme

SAMPLE_FILES=	acme-client.sh.sample deploy.sh.sample
SUB_FILES=	000.acme-client.sh pkg-message ${SAMPLE_FILES}
SUB_LIST=	PORTNAME=${PORTNAME}

PERIODIC_DIRS=	etc/periodic/weekly
PERIODIC_FILES=	000.acme-client.sh

post-patch:
	${REINPLACE_CMD} -e "s|/etc/|${PREFIX}/etc/|g" \
		-e "s|/var/www/acme|${WWWDIR}|" \
		${WRKSRC}/main.c ${WRKSRC}/acme-client.1

post-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/${PERIODIC_DIRS}
	${INSTALL_SCRIPT} ${WRKDIR}/${PERIODIC_FILES} ${STAGEDIR}${PREFIX}/${PERIODIC_DIRS}/${PERIODIC_FILES}
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/acme-client
.	for d in etc/ssl/acme etc/ssl/acme/private \
		etc/acme www/acme
		${MKDIR} ${STAGEDIR}${PREFIX}/${d}
.	endfor
.	for d in ${SAMPLE_FILES}
		${INSTALL_SCRIPT} ${WRKDIR}/${d} ${STAGEDIR}${PREFIX}/etc/acme/${d}
.	endfor

.include <bsd.port.pre.mk>

.if ! ${SSL_DEFAULT:Mlibressl*}
BUILD_DEPENDS+=		${NONEXISTENT}:security/libressl:stage
CPPFLAGS+=		-I${WRKDIR}/libressl/include
LDFLAGS+=		-L${WRKDIR}/libressl/lib
. ifnmake describe
STAGEDIR_libressl!=	${MAKE} -V STAGEDIR -C ${PORTSDIR}/security/libressl
. endif

pre-configure:
	@(cd ${STAGEDIR_libressl}${LOCALBASE} && ${COPYTREE_SHARE} \
		. ${WRKDIR}/libressl "! -name *.so*")
.endif # SSL_DEFAULT

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud