1PORTNAME=	phpMyAdmin
2DISTVERSION=	4.9.11
3PORTREVISION=	3
4CATEGORIES=	databases www
5MASTER_SITES=	https://files.phpmyadmin.net/${PORTNAME}/${DISTVERSION}/
6DISTNAME=	${PORTNAME}-${DISTVERSION}-all-languages
7PKGNAMESUFFIX=	${PHP_PKGNAMESUFFIX}
8
9MAINTAINER=	ports@MidnightBSD.org
10COMMENT=	Set of PHP-scripts to manage MySQL over the web
11WWW=		https://www.phpmyadmin.net/
12
13LICENSE=	gpl2
14LICENSE_FILE=	${WRKSRC}/LICENSE
15
16CONFLICTS_INSTALL=	phpmyadmin5
17
18USES=		cpe php:web,flavors tar:xz
19CPE_PRODUCT=	${PORTNAME:tl}
20
21NO_ARCH=	yes
22NO_BUILD=	yes
23.if !defined(WITHOUT_PHP_DEPENDS)
24
25# Note: composer.json files in the source list pcre as a required
26# extension, but pcre is compiled into PHP as standard on BSD.
27# spl, libsodium are only required in the bundled vendor code. PMA
28# could, in principle, also use the PHP dbase extension, but it's not
29# available for PHP >= 7.0 and of only minority interest.
30
31USE_PHP=	ctype filter iconv mysqli session xml
32.endif
33
34# Note: default settings will pull in X11 client support.  If you don't
35# want this, either turn off GD in the config dialog, or else turn off
36# FONTCONFIG in the graphics/gd port options.
37
38OPTIONS_DEFINE=		BZ2 CURL GD GMP MBSTRING OPCACHE \
39			SODIUM ZIP ZLIB
40OPTIONS_DEFAULT=	BZ2 GD MBSTRING ZIP ZLIB
41
42BZ2_DESC=	PHP bzip2 library support
43CURL_DESC=	PHP curl support
44GD_DESC=	PHP GD library support (requires X11)
45GMP_DESC=	PHP GMP library support
46MBSTRING_DESC=	PHP Multi-byte String support
47OPCACHE_DESC=	PHP Opcache support
48SODIUM_DESC=	PHP libsodium support (only available for PHP >= 7.2)
49ZIP_DESC=	PHP Zip compression support
50ZLIB_DESC=	PHP ZLIB support
51
52.include <bsd.mport.options.mk>
53
54WANT_PHP_WEB=	yes
55
56GROUPS?=	${WWWGRP}
57CFG_FILE=	config.inc.php
58
59PLIST=		${WRKDIR}/plist
60PLIST_SUB+=	PMA_GRP=${GROUPS}
61
62SUB_LIST+=	PKGNAME=${PKGNAME}	        \
63		CFG_FILE=${WWWDIR}/${CFG_FILE}
64SUB_FILES+=	pkg-message
65
66
67.if !defined(WITHOUT_PHP_DEPENDS)
68
69.for opt in ${OPTIONS_DEFINE}
70.    if ${PORT_OPTIONS:M${opt}}
71USE_PHP+=	${opt:tl}
72.    endif
73.endfor
74
75.endif
76
77.SILENT:
78
79post-patch:
80	cd ${WRKSRC} ; \
81	for emptydir in $$( ${FIND} . -type d -empty -print ) ; do \
82	    ${TOUCH} $${emptydir}/.keep-me ; \
83	done ; \
84	${CP} ${FILESDIR}/${CFG_FILE}.sample ${WRKSRC}/${CFG_FILE}.sample ; \
85	${FIND} . ! -type d ! -name ${CFG_FILE}.sample ! -name '*.bak' | \
86	    ${SORT} | ${SED} -e "s,^\.,%%WWWDIR%%,"   >${PLIST} ; \
87	${CAT} ${PKGDIR}/pkg-plist-chunk	     >>${PLIST} ; \
88	for emptydir in $$( ${FIND} . -type d -empty -print | \
89		${SED} -e "s,^\.,%%WWWDIR%%," ) ; do \
90	    ${ECHO} "@dir $${emptydir}"		     >>${PLIST} ; \
91	done ; \
92
93do-install:
94	cd ${WRKSRC} ; \
95	for src in $$( ${FIND} . ! -name .cvsignore ! -name '*.bak' ) ; do \
96	    dst=${WWWDIR}$${src#.} ; \
97	    if ${TEST} -d "$$src" ; then \
98		${MKDIR} "$$dst" ; \
99	    else \
100		${INSTALL_DATA} "$$src" "$$dst" ; \
101	    fi \
102	done
103	@${MKDIR} ${WWWDIR}/tmp
104
105.include <bsd.port.mk>
106