summaryrefslogtreecommitdiff
path: root/www/php-fpm/Makefile
blob: 5f24cfd65579113ea7f5c2cd5763e4b271445a62 (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
65
# $NetBSD: Makefile,v 1.22 2017/10/27 08:49:01 taca Exp $

PKGNAME=	${PHP_PKG_PREFIX}-fpm-${PHP_VERSION}
CATEGORIES=	www

HOMEPAGE=	https://php-fpm.org/
MAINTAINER=	filip@joyent.com
COMMENT=	FPM interface for ${PKG_PHP}
LICENSE=	2-clause-bsd

USE_TOOLS+=	pkg-config

USE_PHP_EXT_PATCHES=	yes
LIBTOOL_OVERRIDE=	# empty

.include "../../mk/bsd.prefs.mk"

FPM_USER?=		${APACHE_USER}
FPM_GROUP?=		${APACHE_GROUP}

BUILD_DEFS+=		VARBASE FPM_USER FPM_GROUP

PKG_USERS_VARS=		FPM_USER
PKG_GROUPS_VARS=	FPM_GROUP
PKG_GROUPS=		${FPM_GROUP}
PKG_USERS=		${FPM_USER}:${FPM_GROUP}

PKG_GECOS.${FPM_USER}=	PHP FPM daemon user
PKG_SHELL.${FPM_USER}=	${NOLOGIN}

EGDIR=			${PREFIX}/share/examples/php
CONF_FILES=		${EGDIR}/php-fpm.conf ${PKG_SYSCONFDIR}/php-fpm.conf
AUTO_MKDIRS=		yes

.include "../../lang/php/phpversion.mk"

PLIST_VARS+=		fpmdotd

.if ${PKG_PHP_VERSION} >= 70
CONF_FILES+=		${EGDIR}/php-fpm.d/www.conf ${PKG_SYSCONFDIR}/php-fpm.d/www.conf
OWN_DIRS+=		${PKG_SYSCONFDIR}/php-fpm.d
INSTALLATION_DIRS+=	${EGDIR}/php-fpm.d
PLIST.fpmdotd=		yes
.endif

CONFIGURE_ARGS+=	--enable-fpm
CONFIGURE_ARGS+=	--with-fpm-user=${FPM_USER}
CONFIGURE_ARGS+=	--with-fpm-group=${FPM_GROUP}

SMF_NAME=		php-fpm
RCD_SCRIPTS=		php_fpm
MESSAGE_SUBST+=		CGIDIR=${CGIDIR}
MESSAGE_SUBST+=		VARBASE=${VARBASE}

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/sapi/fpm/php-fpm ${DESTDIR}${PREFIX}/sbin/php-fpm
	${INSTALL_MAN} ${WRKSRC}/sapi/fpm/php-fpm.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/
	${INSTALL_DATA} ${WRKSRC}/sapi/fpm/php-fpm.conf ${DESTDIR}${EGDIR}
.if ${PKG_PHP_VERSION} >= 70
	${INSTALL_DATA} ${WRKSRC}/sapi/fpm/www.conf ${DESTDIR}${EGDIR}/php-fpm.d
.endif

.include "${PHPPKGSRCDIR}/Makefile.php"
.include "${PHPPKGSRCDIR}/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"