summaryrefslogtreecommitdiff
path: root/databases/phpmyadmin/Makefile
blob: 9b1e1fc6e7f49fd1ce3932027f0ca3d0cd6103f3 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# $NetBSD: Makefile,v 1.156.4.1 2019/06/16 17:43:39 spz Exp $

DISTNAME=	phpMyAdmin-4.9.0.1-all-languages
PKGNAME=	${PHP_PKG_PREFIX}-${DISTNAME:S/-all-languages//:tl}
CATEGORIES=	databases www
MASTER_SITES=	https://files.phpmyadmin.net/phpMyAdmin/${PKGVERSION_NOREV}/
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	tm@NetBSD.org
HOMEPAGE=	https://www.phpmyadmin.net/
COMMENT=	Set of PHP-scripts to adminstrate MySQL over the WWW
LICENSE=	gnu-gpl-v2

DEPENDS+=	${PHP_PKG_PREFIX}-bz2>=5.3.0:../../archivers/php-bz2
DEPENDS+=	${PHP_PKG_PREFIX}-zip>=5.3.0:../../archivers/php-zip
DEPENDS+=	${PHP_PKG_PREFIX}-zlib>=5.3.0:../../archivers/php-zlib
DEPENDS+=	${PHP_PKG_PREFIX}-mbstring>=5.3.0:../../converters/php-mbstring
DEPENDS+=	${PHP_PKG_PREFIX}-gettext>=5.3.0:../../devel/php-gettext
DEPENDS+=	${PHP_PKG_PREFIX}-mysqli>=5.3.0:../../databases/php-mysqli
DEPENDS+=	${PHP_PKG_PREFIX}-gd>=5.3.0:../../graphics/php-gd
DEPENDS+=	${PHP_PKG_PREFIX}-json>=5.3.0:../../textproc/php-json

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

.if ${PKG_PHP_VERSION} < 71
DEPENDS+=	${PHP_PKG_PREFIX}-mcrypt>=5.3.0:../../security/php-mcrypt
.else
DEPENDS+=	${PHP_PKG_PREFIX}-pecl-mcrypt>=1.0.1:../../security/php-pecl-mcrypt
.endif

USE_TOOLS+=	pax

APACHE_USER?=	www
APACHE_GROUP?=	www

PKG_GROUPS=	${APACHE_GROUP}
PKG_USERS=	${APACHE_USER}:${APACHE_GROUP}
BUILD_DEFS+=	APACHE_USER APACHE_GROUP VARBASE

PKG_USERS_VARS=		APACHE_USER
PKG_GROUPS_VARS=	APACHE_GROUP

PKG_SYSCONFSUBDIR=	phpmyadmin

FILES_SUBST+=	APACHE_GROUP=${APACHE_GROUP} APACHE_USER=${APACHE_USER}
FILES_SUBST+=	PMCONFDIR=${PMCONFDIR} PMVARDIR=${PMVARDIR}
MESSAGE_SUBST+=	PMCONFDIR=${PMCONFDIR} PMCONFFILE=${PMCONFFILE}

DOC_FILES=	ChangeLog CODE_OF_CONDUCT.md CONTRIBUTING.md DCO LICENSE \
		README RELEASE-DATE-${PKGVERSION_NOREV}

EXDIR=		${PREFIX}/share/examples/phpmyadmin
PMCONFDIR=	${PKG_SYSCONFDIR}
PMCONFFILE=	${PKG_SYSCONFDIR}/config.inc.php
PMDIR=		${PREFIX}/share/phpmyadmin
PMVARDIR=	${VARBASE}/phpmyadmin

REPLACE_INTERPRETER+=	php
REPLACE.php.old=	/usr/bin/env php
REPLACE.php.new=	${PREFIX}/bin/php
REPLACE_FILES.php=	vendor/bin/highlight-query vendor/bin/lint-query
REPLACE_FILES.php+=	vendor/phpmyadmin/sql-parser/bin/highlight-query
REPLACE_FILES.php+=	vendor/phpmyadmin/sql-parser/bin/lint-query
REPLACE_FILES.php+=	vendor/phpmyadmin/sql-parser/bin/tokenize-query

REPLACE_SH+=	vendor/twig/twig/drupal_test.sh

CONF_FILES+=	${EXDIR}/apache.conf ${PKG_SYSCONFDIR}/apache.conf

SRCS=		*.css *.ico *.php *.txt doc js libraries locale setup \
		sql templates themes vendor

NO_BUILD=		yes

SUBST_CLASSES+=		paths
SUBST_FILES.paths+=	${WRKDIR}/phpmyadmin.conf
SUBST_FILES.paths+=	${WRKSRC}/libraries/vendor_config.php
SUBST_SED.paths+=	-e "s|@PMDIR@|${PMDIR}|g"
SUBST_SED.paths+=	-e "s|@PMVARDIR@|${PMVARDIR}|g"
SUBST_SED.paths+=	-e "s|@PMCONFDIR@|${PMCONFDIR}/|g"
SUBST_STAGE.paths=	post-configure

INSTALLATION_DIRS+=	${PREFIX}/share/doc/phpmyadmin \
			${PREFIX}/share/examples/phpmyadmin

post-extract:
	${CP} ${FILESDIR}/phpmyadmin.conf ${WRKDIR}

do-install:
	cd ${WRKSRC} && pax -rw ${SRCS} ${DESTDIR}${PMDIR}
	${INSTALL_DATA} ${WRKSRC}/config.sample.inc.php ${DESTDIR}${EXDIR}
	${INSTALL_DATA} ${WRKSRC}/examples/* ${DESTDIR}${EXDIR}
	${LN} -fs ${EXDIR} ${DESTDIR}${PMDIR}/examples
	cd ${WRKSRC} && \
		${INSTALL_DATA} ${DOC_FILES} \
			${DESTDIR}${PREFIX}/share/doc/phpmyadmin
	${INSTALL_DATA} ${WRKDIR}/phpmyadmin.conf ${DESTDIR}${EXDIR}/apache.conf

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