2003-04-18 16:17:47 +00:00
|
|
|
# New ports collection makefile for: MySQL-server
|
|
|
|
# Date created: Fri Apr 11 10:06:26 CET 2003
|
|
|
|
# Whom: Alex Dupre <sysadmin@alexdupre.com>
|
1997-06-18 19:35:30 +00:00
|
|
|
#
|
1999-08-25 05:28:01 +00:00
|
|
|
# $FreeBSD$
|
1997-06-18 19:35:30 +00:00
|
|
|
#
|
|
|
|
|
2003-01-31 16:02:39 +00:00
|
|
|
PORTNAME?= mysql
|
2005-01-10 13:17:30 +00:00
|
|
|
PORTVERSION= 5.0.2
|
2004-10-24 21:28:03 +00:00
|
|
|
PORTREVISION?= 0
|
1997-06-18 19:35:30 +00:00
|
|
|
CATEGORIES= databases
|
2005-01-10 13:17:30 +00:00
|
|
|
MASTER_SITES= ${MASTER_SITE_MYSQL}
|
|
|
|
MASTER_SITE_SUBDIR= MySQL-5.0
|
2003-01-31 16:02:39 +00:00
|
|
|
PKGNAMESUFFIX?= -server
|
2005-01-10 13:17:30 +00:00
|
|
|
DISTNAME= ${PORTNAME}-${PORTVERSION}-alpha
|
2004-10-21 21:30:07 +00:00
|
|
|
|
2004-02-04 15:56:17 +00:00
|
|
|
MAINTAINER= ale@FreeBSD.org
|
2003-03-06 19:23:19 +00:00
|
|
|
COMMENT?= Multithreaded SQL database (server)
|
2003-01-31 16:02:39 +00:00
|
|
|
|
2004-10-24 21:28:03 +00:00
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-alpha
|
2004-02-04 15:56:17 +00:00
|
|
|
SLAVEDIRS= databases/mysql50-client
|
|
|
|
PKGINSTALL?= ${WRKDIR}/pkg-install
|
1999-08-11 20:56:03 +00:00
|
|
|
DB_DIR?= /var/db/mysql
|
2004-09-24 16:21:27 +00:00
|
|
|
USE_LIBTOOL_VER=15
|
2003-03-24 17:02:58 +00:00
|
|
|
USE_REINPLACE= yes
|
2004-10-24 21:28:03 +00:00
|
|
|
USE_RC_SUBR= yes
|
2003-01-31 16:02:39 +00:00
|
|
|
|
2003-03-24 17:02:58 +00:00
|
|
|
CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
|
1999-08-11 20:56:03 +00:00
|
|
|
CONFIGURE_ARGS= --localstatedir=${DB_DIR} \
|
1997-06-18 19:35:30 +00:00
|
|
|
--without-debug \
|
1998-03-28 14:43:39 +00:00
|
|
|
--without-readline \
|
2003-04-18 16:17:47 +00:00
|
|
|
--without-libedit \
|
2000-10-19 09:17:57 +00:00
|
|
|
--without-bench \
|
2003-01-31 16:02:39 +00:00
|
|
|
--without-extra-tools \
|
2001-01-07 13:52:24 +00:00
|
|
|
--with-libwrap \
|
2003-01-31 16:02:39 +00:00
|
|
|
--with-mysqlfs \
|
|
|
|
--with-vio \
|
2001-12-18 22:41:48 +00:00
|
|
|
--with-low-memory \
|
2003-03-25 23:39:43 +00:00
|
|
|
--with-comment='FreeBSD port: ${PKGNAME}' \
|
|
|
|
--enable-thread-safe-client
|
2001-12-18 22:41:48 +00:00
|
|
|
|
2003-10-03 16:10:16 +00:00
|
|
|
.ifdef USE_MYSQL
|
|
|
|
.error You have `USE_MYSQL' variable defined either in environment or in make(1) arguments. Please undefine and try again.
|
|
|
|
.endif
|
|
|
|
|
2001-01-25 01:03:09 +00:00
|
|
|
.if defined(WITH_CHARSET) && ${WITH_CHARSET} != ""
|
|
|
|
CONFIGURE_ARGS+=--with-charset=${WITH_CHARSET}
|
2002-11-17 15:58:19 +00:00
|
|
|
.endif
|
2001-01-25 01:03:09 +00:00
|
|
|
.if defined(WITH_XCHARSET) && ${WITH_XCHARSET} != ""
|
|
|
|
CONFIGURE_ARGS+=--with-extra-charsets=${WITH_XCHARSET}
|
|
|
|
.endif
|
2003-01-31 16:02:39 +00:00
|
|
|
.if defined(WITH_OPENSSL)
|
|
|
|
USE_OPENSSL= yes
|
2005-01-10 13:17:30 +00:00
|
|
|
CONFIGURE_ARGS+=--with-openssl=${OPENSSLBASE}
|
2003-01-31 16:02:39 +00:00
|
|
|
.endif
|
2001-12-17 22:50:46 +00:00
|
|
|
.if defined(BUILD_STATIC)
|
2003-01-31 16:02:39 +00:00
|
|
|
CONFIGURE_ARGS+=--with-mysqld-ldflags=-all-static
|
2001-12-17 22:50:46 +00:00
|
|
|
.endif
|
2005-01-10 13:17:30 +00:00
|
|
|
.if defined(WITHOUT_INNODB)
|
|
|
|
CONFIGURE_ARGS+=--without-innodb
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_NDB)
|
|
|
|
CONFIGURE_ARGS+=--with-ndbcluster
|
|
|
|
.endif
|
2003-12-11 15:58:26 +00:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2004-09-24 16:21:27 +00:00
|
|
|
.if ${ARCH} == "i386"
|
2003-12-11 15:58:26 +00:00
|
|
|
CONFIGURE_ARGS+=--enable-assembler --with-berkeley-db
|
2001-05-23 20:26:06 +00:00
|
|
|
.endif
|
2003-02-23 15:08:25 +00:00
|
|
|
.if defined(WITH_LINUXTHREADS)
|
|
|
|
CONFIGURE_ARGS+=--with-named-thread-libs='-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
|
|
|
|
CONFIGURE_ARGS+=-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
|
|
|
|
CFLAGS+= -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE
|
|
|
|
CFLAGS+= -I${LOCALBASE}/include/pthread/linuxthreads
|
2003-02-25 00:33:10 +00:00
|
|
|
.if ${OSVERSION} > 500000
|
2005-01-10 14:13:52 +00:00
|
|
|
LIB_DEPENDS+= lthread.[35]:${PORTSDIR}/devel/linuxthreads
|
2003-03-26 23:27:15 +00:00
|
|
|
CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r -llstdc++ -llsupc++'
|
2003-02-25 00:33:10 +00:00
|
|
|
.else
|
2005-01-10 14:13:52 +00:00
|
|
|
LIB_DEPENDS+= lthread.[24]:${PORTSDIR}/devel/linuxthreads
|
2003-03-26 23:27:15 +00:00
|
|
|
CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r'
|
2003-02-25 00:33:10 +00:00
|
|
|
.endif
|
2004-02-04 15:56:17 +00:00
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+=--with-named-thread-libs=${PTHREAD_LIBS}
|
|
|
|
CFLAGS+= ${PTHREAD_CFLAGS}
|
2003-02-23 15:08:25 +00:00
|
|
|
.endif
|
2001-01-21 11:49:48 +00:00
|
|
|
|
2003-12-11 15:58:26 +00:00
|
|
|
.if ${OSVERSION} < 500000
|
|
|
|
CXX= ${CC}
|
|
|
|
.endif
|
|
|
|
.if defined(BUILD_OPTIMIZED)
|
2003-01-31 16:02:39 +00:00
|
|
|
CFLAGS+= -O3 -fno-omit-frame-pointer
|
2003-12-11 15:58:26 +00:00
|
|
|
.if ${OSVERSION} > 500000 || (defined(USE_GCC) && (${USE_GCC} == 3.0 || ${USE_GCC} == 3.1 || ${USE_GCC} == 3.2 || ${USE_GCC} == 3.3))
|
|
|
|
CFLAGS+= -fno-gcse
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
CXXFLAGS+= ${CFLAGS} -felide-constructors -fno-rtti
|
2001-01-21 11:49:48 +00:00
|
|
|
.if ${OSVERSION} >= 400002
|
|
|
|
CXXFLAGS+= -fno-exceptions
|
|
|
|
.endif
|
1997-06-18 19:35:30 +00:00
|
|
|
|
2001-08-13 21:50:34 +00:00
|
|
|
# MySQL-Server part
|
2004-02-29 10:53:29 +00:00
|
|
|
.if !defined(CLIENT_ONLY) && !defined(SCRIPTS_ONLY)
|
|
|
|
USE_MYSQL= yes
|
|
|
|
WANT_MYSQL_VER= 50
|
2004-02-04 15:56:17 +00:00
|
|
|
|
|
|
|
LATEST_LINK= mysql50-server
|
2003-12-26 16:56:52 +00:00
|
|
|
|
2004-02-04 15:56:17 +00:00
|
|
|
CONFLICTS= mysql-server-3.* mysql-server-4.*
|
2001-08-13 21:50:34 +00:00
|
|
|
|
2004-10-24 21:28:03 +00:00
|
|
|
PLIST_SUB= DB_DIR=${DB_DIR} \
|
|
|
|
VER=${PORTVERSION}-alpha
|
2005-01-10 13:17:30 +00:00
|
|
|
.if defined(WITH_NDB)
|
|
|
|
PLIST_SUB+= NDB=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= NDB="@comment "
|
|
|
|
.endif
|
2003-01-31 16:02:39 +00:00
|
|
|
|
2004-02-29 10:53:29 +00:00
|
|
|
MAN1= isamchk.1 isamlog.1 mysqld.1 \
|
|
|
|
mysqld_safe.1 perror.1 replace.1
|
|
|
|
|
2005-01-10 13:17:30 +00:00
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
PORTDOCS= manual.html manual.txt manual_toc.html
|
|
|
|
.endif
|
2002-08-19 13:27:52 +00:00
|
|
|
|
2003-12-11 15:58:26 +00:00
|
|
|
INFO= mysql
|
|
|
|
|
2001-01-25 01:03:09 +00:00
|
|
|
pre-fetch:
|
|
|
|
@${ECHO} ""
|
|
|
|
@${ECHO} "You may use the following build options:"
|
|
|
|
@${ECHO} ""
|
2003-01-31 16:02:39 +00:00
|
|
|
@${ECHO} " WITH_CHARSET=charset Define the primary built-in charset (latin1)."
|
|
|
|
@${ECHO} " WITH_XCHARSET=list Define other built-in charsets (may be 'all')."
|
|
|
|
@${ECHO} " WITH_OPENSSL=yes Enable secure connections."
|
2001-08-13 21:50:34 +00:00
|
|
|
@${ECHO} " DB_DIR=directory Set alternate directory for database files"
|
|
|
|
@${ECHO} " (default is /var/db/mysql)."
|
2003-03-24 17:02:58 +00:00
|
|
|
@${ECHO} " WITH_LINUXTHREADS=yes Use the linuxthreads pthread library."
|
2004-10-24 21:28:03 +00:00
|
|
|
@${ECHO} " WITH_PROC_SCOPE_PTH=yes Use process scope threads"
|
|
|
|
@${ECHO} " (try it if you use libpthread)."
|
2003-03-24 17:02:58 +00:00
|
|
|
@${ECHO} " OVERWRITE_DB=yes Re-initialize default databases."
|
2003-12-11 15:58:26 +00:00
|
|
|
@${ECHO} " BUILD_OPTIMIZED=yes Enable compiler optimizations"
|
|
|
|
@${ECHO} " (use it if you need speed)."
|
2001-12-17 22:50:46 +00:00
|
|
|
@${ECHO} " BUILD_STATIC=yes Build a static version of mysqld."
|
2003-12-11 15:58:26 +00:00
|
|
|
@${ECHO} " (use it if you need even more speed)."
|
2005-01-10 13:17:30 +00:00
|
|
|
@${ECHO} " WITHOUT_INNODB=yes Disable support for InnoDB table handler."
|
2005-01-10 13:22:45 +00:00
|
|
|
@${ECHO} " WITH_NDB=yes Enable support for NDB Cluster."
|
2001-01-25 01:03:09 +00:00
|
|
|
@${ECHO} ""
|
|
|
|
|
2003-03-24 17:02:58 +00:00
|
|
|
post-patch:
|
2004-02-29 10:53:29 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|SUBDIRS =|SUBDIRS = include @docs_dirs@ @sql_server_dirs@ scripts man support-files|g" ${WRKSRC}/Makefile.in
|
2004-10-24 21:28:03 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|all: config.h|all: config.h all-local|g" ${WRKSRC}/Makefile.in
|
2004-03-08 08:58:24 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|bin_SCRIPTS =|bin_SCRIPTS = @server_scripts@ mysql_create_system_tables|g" ${WRKSRC}/scripts/Makefile.in
|
2004-03-02 12:17:32 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|dist_pkgdata_DATA =|dist_pkgdata_DATA = fill_help_tables.sql|g" ${WRKSRC}/scripts/Makefile.in
|
2004-02-29 10:53:29 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|man_MANS =|man_MANS = ${MAN1}|g" ${WRKSRC}/man/Makefile.in
|
2004-10-24 21:28:03 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|install-data-am: install-pkgincludeHEADERS|install-data-am:|g" ${WRKSRC}/include/Makefile.in
|
|
|
|
.if defined(WITH_PROC_SCOPE_PTH)
|
|
|
|
@${REINPLACE_CMD} -e "s|PTHREAD_SCOPE_SYSTEM|PTHREAD_SCOPE_PROCESS|g" ${WRKSRC}/sql/mysqld.cc
|
|
|
|
.endif
|
2004-02-04 15:56:17 +00:00
|
|
|
|
|
|
|
post-build:
|
|
|
|
@${SED} "s|%%DB_DIR%%|${DB_DIR}|g" ${PKGDIR}/pkg-install > ${WRKDIR}/pkg-install
|
2003-03-24 17:02:58 +00:00
|
|
|
|
1997-06-18 19:35:30 +00:00
|
|
|
post-install:
|
1998-12-01 02:56:08 +00:00
|
|
|
.if !defined(PACKAGE_BUILDING)
|
2003-12-11 15:58:26 +00:00
|
|
|
.if exists(${DB_DIR}) && defined(OVERWRITE_DB) && ${OVERWRITE_DB:L} != "no"
|
2003-02-05 15:34:09 +00:00
|
|
|
@${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true
|
|
|
|
.endif
|
2003-12-11 15:58:26 +00:00
|
|
|
.if !exists(${DB_DIR}) || (defined(OVERWRITE_DB) && ${OVERWRITE_DB:L} != "no")
|
2003-09-28 21:47:53 +00:00
|
|
|
${PREFIX}/bin/mysql_install_db --ldata=${DB_DIR}
|
2001-08-05 12:01:09 +00:00
|
|
|
.endif
|
1999-08-11 20:56:03 +00:00
|
|
|
@${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
1998-12-01 02:56:08 +00:00
|
|
|
.endif
|
2004-10-24 21:28:03 +00:00
|
|
|
@${SED} "s|%%RC_SUBR%%|${RC_SUBR}|g;s|%%PREFIX%%|${PREFIX}|g;s|%%DB_DIR%%|${DB_DIR}|g" < \
|
|
|
|
${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh
|
1999-08-22 19:01:07 +00:00
|
|
|
@${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh
|
1998-09-06 19:58:26 +00:00
|
|
|
.if !defined(NOPORTDOCS)
|
2005-01-10 13:17:30 +00:00
|
|
|
@${MKDIR} ${DOCSDIR}
|
|
|
|
.for doc in ${PORTDOCS}
|
2003-03-24 17:02:58 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/Docs/${doc} ${DOCSDIR}
|
1997-06-18 19:35:30 +00:00
|
|
|
.endfor
|
2003-12-11 15:58:26 +00:00
|
|
|
.endif
|
1998-09-06 19:58:26 +00:00
|
|
|
|
1999-07-01 08:44:49 +00:00
|
|
|
.else
|
2004-02-29 10:53:29 +00:00
|
|
|
# MySQL-Client part
|
|
|
|
.if defined(CLIENT_ONLY)
|
2004-02-04 15:56:17 +00:00
|
|
|
LATEST_LINK= mysql50-client
|
|
|
|
|
|
|
|
CONFLICTS= mysql-client-3.* mysql-client-4.*
|
2003-12-26 16:56:52 +00:00
|
|
|
|
2004-02-29 10:53:29 +00:00
|
|
|
MAN1= mysql.1 mysqladmin.1 mysqldump.1 mysqlshow.1
|
1999-07-01 08:44:49 +00:00
|
|
|
|
2000-09-23 18:57:11 +00:00
|
|
|
INSTALLS_SHLIB= yes
|
|
|
|
LDCONFIG_DIRS= %%PREFIX%%/lib/mysql
|
|
|
|
|
1999-07-01 08:44:49 +00:00
|
|
|
CONFIGURE_ARGS+=--without-server
|
2003-03-24 17:02:58 +00:00
|
|
|
|
|
|
|
post-patch:
|
2005-01-10 13:17:30 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|SUBDIRS =|SUBDIRS = include @sql_client_dirs@ scripts man|g" ${WRKSRC}/Makefile.in
|
|
|
|
@${REINPLACE_CMD} -e "s|install-exec-am: install-pkglibLIBRARIES|install-exec-am:|g" ${WRKSRC}/strings/Makefile.in
|
2004-10-24 21:28:03 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|all: config.h|all: config.h all-local|g" ${WRKSRC}/Makefile.in
|
2004-02-29 10:53:29 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|bin_SCRIPTS =|bin_SCRIPTS = mysql_config mysql_fix_privilege_tables mysqlbug|g" ${WRKSRC}/scripts/Makefile.in
|
2004-03-02 12:17:32 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|dist_pkgdata_DATA =|dist_pkgdata_DATA = mysql_fix_privilege_tables.sql|g" ${WRKSRC}/scripts/Makefile.in
|
2004-02-29 10:53:29 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|man_MANS =|man_MANS = ${MAN1}|g" ${WRKSRC}/man/Makefile.in
|
2004-10-24 21:28:03 +00:00
|
|
|
.if defined(WITH_PROC_SCOPE_PTH)
|
|
|
|
@${REINPLACE_CMD} -e "s|PTHREAD_SCOPE_SYSTEM|PTHREAD_SCOPE_PROCESS|g" ${WRKSRC}/tools/mysqlmanager.c
|
|
|
|
.endif
|
1999-07-01 08:44:49 +00:00
|
|
|
|
|
|
|
post-install:
|
2002-02-11 13:35:35 +00:00
|
|
|
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-client.sh > ${PREFIX}/etc/rc.d/000.mysql-client.sh
|
2002-02-12 11:39:26 +00:00
|
|
|
@${CHMOD} 750 ${PREFIX}/etc/rc.d/000.mysql-client.sh
|
2004-02-29 10:53:29 +00:00
|
|
|
|
|
|
|
.else
|
|
|
|
# MySQL-Scripts part
|
|
|
|
USE_MYSQL= yes
|
|
|
|
WANT_MYSQL_VER= 50
|
|
|
|
USE_PERL5= yes
|
|
|
|
|
2005-01-10 13:17:30 +00:00
|
|
|
RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50
|
|
|
|
.if ${PERL_LEVEL} <= 500800
|
|
|
|
RUN_DEPENDS+= ${SITE_PERL}/File/Temp.pm:${PORTSDIR}/devel/p5-File-Temp
|
|
|
|
.endif
|
|
|
|
|
2004-02-29 10:53:29 +00:00
|
|
|
|
|
|
|
LATEST_LINK= mysql50-scripts
|
|
|
|
|
|
|
|
CONFLICTS= mysql-scripts-3.* mysql-scripts-4.*
|
|
|
|
|
|
|
|
MAN1= mysql_zap.1 mysqlaccess.1 mysqld_multi.1 mysql_fix_privilege_tables.1
|
|
|
|
|
|
|
|
SCRIPTS= msql2mysql mysql_fix_extensions mysql_setpermission \
|
|
|
|
mysql_secure_installation mysql_zap mysqlaccess \
|
|
|
|
mysql_convert_table_format mysql_find_rows mysqlhotcopy \
|
2004-03-08 08:58:24 +00:00
|
|
|
mysqldumpslow mysql_explain_log mysql_tableinfo mysqld_multi
|
2004-02-29 10:53:29 +00:00
|
|
|
|
|
|
|
post-patch:
|
|
|
|
@${REINPLACE_CMD} -e "s|SUBDIRS =|SUBDIRS = scripts man|g" ${WRKSRC}/Makefile.in
|
|
|
|
@${REINPLACE_CMD} -e "s|bin_SCRIPTS =|bin_SCRIPTS = ${SCRIPTS}|g" ${WRKSRC}/scripts/Makefile.in
|
|
|
|
@${REINPLACE_CMD} -e "s|install-exec-am install-data-am|install-exec-am|g" ${WRKSRC}/scripts/Makefile.in
|
|
|
|
@${REINPLACE_CMD} -e "s|man_MANS =|man_MANS = ${MAN1}|g" ${WRKSRC}/man/Makefile.in
|
|
|
|
.endif
|
2000-10-19 09:17:57 +00:00
|
|
|
.endif
|
2005-01-10 13:17:30 +00:00
|
|
|
# Common part
|
|
|
|
post-extract:
|
|
|
|
@${CP} /usr/include/tcpd.h ${WRKSRC}/sql/mytcpd.h
|
1999-07-01 08:44:49 +00:00
|
|
|
|
2005-01-10 13:40:21 +00:00
|
|
|
.if defined(WITH_OPENSSL) && defined(BUILD_STATIC)
|
|
|
|
pre-configure:
|
|
|
|
@${ECHO} "You can't use the BUILD_STATIC option when using OpenSSL."
|
|
|
|
@${FALSE}
|
|
|
|
.endif
|
|
|
|
|
2001-01-21 11:49:48 +00:00
|
|
|
.include <bsd.port.post.mk>
|