Line 0
Link Here
|
|
|
1 |
# New ports collection makefile for: phpMyAdmin |
2 |
# Date created: 19 Jan 2001 |
3 |
# Whom: nbm |
4 |
# |
5 |
# $FreeBSD: ports/databases/phpmyadmin/Makefile,v 1.77 2007/10/30 09:24:24 miwi Exp $ |
6 |
# |
7 |
|
8 |
PORTNAME= phpMyAdmin |
9 |
DISTVERSION= 2.11.2 |
10 |
CATEGORIES= databases www |
11 |
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} |
12 |
MASTER_SITE_SUBDIR= phpmyadmin |
13 |
DISTNAME= ${PORTNAME}-${PORTVERSION}-all-languages |
14 |
|
15 |
MAINTAINER= m.seaman@infracaninophile.co.uk |
16 |
COMMENT= A set of PHP-scripts to manage MySQL over the web |
17 |
|
18 |
USE_BZIP2= yes |
19 |
NO_BUILD= yes |
20 |
.if !defined(WITHOUT_PHP_DEPENDS) |
21 |
USE_PHP= ctype mysql pcre session |
22 |
.endif |
23 |
|
24 |
SUB_LIST+= "MYADMDIR=${MYADMDIR}" \ |
25 |
"PKGNAME=${PKGNAME}" |
26 |
SUB_FILES= pkg-message |
27 |
|
28 |
# Unfortunately can't make WITH_SUPHP part of the OPTIONS selection, |
29 |
# since it has to be processed before just about anything else. |
30 |
|
31 |
.if defined(WITH_SUPHP) && !defined(WITHOUT_SUPHP) |
32 |
|
33 |
PKGNAMESUFFIX= -suphp |
34 |
RUN_DEPENDS+= ${LOCALBASE}/sbin/suphp:${PORTSDIR}/www/suphp |
35 |
WANT_PHP_CGI= yes |
36 |
|
37 |
MYADMUSR?= phpmyadm |
38 |
|
39 |
SUB_LIST+= "MYADMUSR=${MYADMUSR}" \ |
40 |
"MYADMGRP=${MYADMGRP}" |
41 |
SUB_FILES+= pkg-install pkg-deinstall |
42 |
|
43 |
.else |
44 |
|
45 |
WANT_PHP_WEB= yes |
46 |
|
47 |
.endif |
48 |
|
49 |
# Copy the way lang/php{4,5}-extensions deals with its OPTIONS -- avoids |
50 |
# problems with include of bsd.port.pre.mk |
51 |
|
52 |
OPTIONS= BZ2 "bzip2 library support" on \ |
53 |
GD "GD library support" on \ |
54 |
MYSQLI "Improved MySQL support" off \ |
55 |
OPENSSL "OpenSSL support" on \ |
56 |
PDF "PDFlib support (implies GD)" on \ |
57 |
ZLIB "ZLIB support" on \ |
58 |
MCRYPT "MCrypt library support" on \ |
59 |
MBSTRING "Multi-byte character-set string support" on |
60 |
|
61 |
PORT_DBDIR?= /var/db/ports |
62 |
LATEST_LINK= ${PORTNAME}${PKGNAMESUFFIX} |
63 |
OPTIONSFILE?= ${PORT_DBDIR}/${LATEST_LINK}/options |
64 |
|
65 |
.if exists(${OPTIONSFILE}) |
66 |
.include "${OPTIONSFILE}" |
67 |
.endif |
68 |
|
69 |
.if !defined(WITHOUT_PHP_DEPENDS) |
70 |
# Options that default to on: |
71 |
.for opt in BZ2 GD OPENSSL PDF ZLIB MCRYPT MBSTRING |
72 |
. if !defined(WITHOUT_${opt}) || defined(WITH_${opt}) |
73 |
USE_PHP+= ${opt:L} |
74 |
. endif |
75 |
.endfor |
76 |
|
77 |
# Options that default to off: |
78 |
.for opt in MYSQLI |
79 |
. if defined(WITH_${opt}) && !defined(WITHOUT_${opt}) |
80 |
USE_PHP+= ${opt:L} |
81 |
. endif |
82 |
.endfor |
83 |
.endif |
84 |
|
85 |
# MYADMUSR is only used WITH_SUPHP |
86 |
MYADMDIR?= www/phpMyAdmin |
87 |
MYADMGRP?= ${WWWGRP} |
88 |
CFGFILE= config.inc.php |
89 |
|
90 |
PLIST= ${WRKDIR}/plist |
91 |
PLIST_SUB+= MYADMDIR=${MYADMDIR} MYADMGRP=${MYADMGRP} |
92 |
|
93 |
.SILENT: |
94 |
|
95 |
do-build: |
96 |
@${DO_NADA} |
97 |
|
98 |
pre-everything:: |
99 |
${ECHO_MSG} "" |
100 |
${ECHO_MSG} "You may use the following additional build option:" |
101 |
${ECHO_MSG} "" |
102 |
${ECHO_MSG} " WITH_SUPHP=yes Install appropriately for use with" |
103 |
${ECHO_MSG} " the www/suphp port [default: no]" |
104 |
${ECHO_MSG} "" |
105 |
${ECHO_MSG} "Note that selecting the MYSQLI option will only work" |
106 |
${ECHO_MSG} "with PHP5 and MySQL 4.1.x" |
107 |
${ECHO_MSG} "" |
108 |
${ECHO_MSG} "If you want to use PHP4, for best results, please" |
109 |
${ECHO_MSG} "install lang/php4 before attempting to install" |
110 |
${ECHO_MSG} "databases/phpmyadmin" |
111 |
${ECHO_MSG} "" |
112 |
|
113 |
# When creating a package, empty directories will not be generated |
114 |
# from the pkg tarball. Therefore make sure no directories are empty. |
115 |
|
116 |
post-patch: |
117 |
cd ${WRKSRC} ; \ |
118 |
for emptydir in $$( ${FIND} . -type d -empty -print ) ; do \ |
119 |
${TOUCH} $${emptydir}/.keep-me ; \ |
120 |
done |
121 |
${CP} ${FILESDIR}/${CFGFILE}.sample ${WRKSRC}/${CFGFILE}.sample |
122 |
cd ${WRKSRC} ; \ |
123 |
${FIND} . ! -type d ! -name ${CFGFILE}.sample | ${SORT} | \ |
124 |
${SED} -e "s,^\.,%%MYADMDIR%%," >${PLIST} ; \ |
125 |
${CAT} ${PKGDIR}/pkg-plist-chunk >>${PLIST} ; \ |
126 |
${FIND} . -type d | ${SORT} -r | ${SED} \ |
127 |
-e "s,^\.$$,@dirrmtry %%MYADMDIR%%," \ |
128 |
-e "s,^\.,@dirrm %%MYADMDIR%%," >>${PLIST} |
129 |
|
130 |
pre-install: |
131 |
.if defined(WITH_SUPHP) |
132 |
${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL |
133 |
.endif |
134 |
|
135 |
do-install: install-app install-conf |
136 |
|
137 |
install-app: |
138 |
cd ${WRKSRC} ; \ |
139 |
for src in $$( ${FIND} . ! -name .cvsignore ) ; do \ |
140 |
dst=${PREFIX}/${MYADMDIR}$${src#.} ; \ |
141 |
if ${TEST} -d $$src ; then \ |
142 |
${MKDIR} $$dst ; \ |
143 |
else \ |
144 |
${INSTALL_DATA} $$src $$dst ; \ |
145 |
fi \ |
146 |
done |
147 |
|
148 |
install-conf: install-app |
149 |
cd ${PREFIX}/${MYADMDIR} ; \ |
150 |
${CHMOD} 0640 ${CFGFILE}.sample ; \ |
151 |
${CHGRP} ${MYADMGRP} ${CFGFILE}.sample ; \ |
152 |
if ${TEST} ! -f ${CFGFILE} ; then \ |
153 |
${CP} -p ${CFGFILE}.sample ${CFGFILE} ; \ |
154 |
fi |
155 |
|
156 |
post-install: |
157 |
.if defined(WITH_SUPHP) |
158 |
${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL |
159 |
.endif |
160 |
${CAT} ${PKGMESSAGE} |
161 |
|
162 |
.include <bsd.port.mk> |