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
|
2004-02-04 15:56:17 +00:00
|
|
|
PORTVERSION= 5.0.0
|
2004-03-08 08:58:24 +00:00
|
|
|
PORTREVISION?= 2
|
1997-06-18 19:35:30 +00:00
|
|
|
CATEGORIES= databases
|
2004-02-04 15:56:17 +00:00
|
|
|
MASTER_SITES= ftp://planetmirror.com/pub/mysql/Downloads/MySQL-5.0/ \
|
|
|
|
http://www.softagency.co.jp/MySQL/Downloads/MySQL-5.0/ \
|
|
|
|
ftp://sunsite.dk/mirrors/mysql/Downloads/MySQL-5.0/ \
|
|
|
|
http://mysql.mediatraffic.fi/Downloads/MySQL-5.0/ \
|
|
|
|
ftp://filepile.tiscali.de/mirror/mysql/Downloads/MySQL-5.0/ \
|
|
|
|
http://mirrors.tilian.co.uk/mysql.com/Downloads/MySQL-5.0/ \
|
|
|
|
ftp://ftp.rtfm.no/pub/mysql/Downloads/MySQL-5.0/ \
|
|
|
|
http://www.mysql.cz/Downloads/MySQL-5.0/ \
|
|
|
|
ftp://ftp.u-paris10.fr/mysql.com/Downloads/MySQL-5.0/ \
|
2004-05-18 11:37:49 +00:00
|
|
|
http://mysql.proserve.nl/Downloads/MySQL-5.0/ \
|
2004-02-04 15:56:17 +00:00
|
|
|
ftp://ftp.free.fr/pub/MySQL/Downloads/MySQL-5.0/
|
2003-01-31 16:02:39 +00:00
|
|
|
PKGNAMESUFFIX?= -server
|
2003-04-18 16:17:47 +00:00
|
|
|
DISTNAME= ${PORTNAME}-${PORTVERSION}-alpha
|
2003-01-31 16:02:39 +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-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-02-04 15:56:17 +00:00
|
|
|
USE_GNOME= lthack
|
2004-03-14 06:17:56 +00:00
|
|
|
USE_LIBTOOL_VER= 13
|
2003-03-24 17:02:58 +00:00
|
|
|
USE_REINPLACE= 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
|
|
|
|
CONFIGURE_ARGS+=--with-openssl
|
|
|
|
.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
|
2003-12-11 15:58:26 +00:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
|
|
|
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
|
2003-12-11 15:58:26 +00:00
|
|
|
LIB_DEPENDS+= lthread.3:${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
|
2003-12-11 15:58:26 +00:00
|
|
|
LIB_DEPENDS+= lthread.2:${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-02-04 15:56:17 +00:00
|
|
|
PLIST_SUB= DB_DIR=${DB_DIR}
|
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
|
|
|
|
|
2003-03-24 17:02:58 +00:00
|
|
|
DOCS= manual.html manual.txt manual_toc.html
|
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."
|
|
|
|
@${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)."
|
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-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
|
2003-12-11 15:58:26 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|install: install-am|install:|g" ${WRKSRC}/include/Makefile.in
|
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
|
|
|
|
2003-01-31 16:02:39 +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
|
|
|
|
|
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
|
2002-11-10 20:24:24 +00:00
|
|
|
@${SED} "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)
|
2003-03-24 17:02:58 +00:00
|
|
|
@${MKDIR} ${DOCSDIR}/Flags
|
2003-01-31 16:02:39 +00:00
|
|
|
.for doc in ${DOCS}
|
2003-03-24 17:02:58 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/Docs/${doc} ${DOCSDIR}
|
1997-06-18 19:35:30 +00:00
|
|
|
.endfor
|
2003-03-24 17:02:58 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/Docs/Flags/*.gif ${DOCSDIR}/Flags
|
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:
|
2004-02-29 10:53:29 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|SUBDIRS =|SUBDIRS = include @sql_client_dirs@ tests scripts man|g" ${WRKSRC}/Makefile.in
|
|
|
|
@${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
|
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
|
|
|
|
|
|
|
|
RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50
|
|
|
|
|
|
|
|
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
|
1999-07-01 08:44:49 +00:00
|
|
|
|
2001-01-21 11:49:48 +00:00
|
|
|
.include <bsd.port.post.mk>
|