2003-01-31 17:02:39 +01:00
|
|
|
# New ports collection makefile for: MySQL-server
|
|
|
|
# Date created: Sun Mar 3 12:20:35 CET 2002
|
|
|
|
# Whom: Alex Dupre <sysadmin@alexdupre.com>
|
1997-06-18 21:35:30 +02:00
|
|
|
#
|
1999-08-25 07:28:01 +02:00
|
|
|
# $FreeBSD$
|
1997-06-18 21:35:30 +02:00
|
|
|
#
|
|
|
|
|
2003-01-31 17:02:39 +01:00
|
|
|
PORTNAME?= mysql
|
2003-02-04 15:13:34 +01:00
|
|
|
PORTVERSION= 4.0.10
|
2002-12-14 17:00:39 +01:00
|
|
|
PORTREVISION?= 0
|
1997-06-18 21:35:30 +02:00
|
|
|
CATEGORIES= databases
|
2003-01-31 17:02:39 +01:00
|
|
|
MASTER_SITES= ftp://mysql.secsup.org/pub/software/mysql/Downloads/MySQL-4.0/ \
|
|
|
|
http://mysql.tzone.it/Downloads/MySQL-4.0/ \
|
|
|
|
ftp://planetmirror.com/pub/mysql/Downloads/MySQL-4.0/ \
|
|
|
|
http://www.softagency.co.jp/MySQL/Downloads/MySQL-4.0/ \
|
|
|
|
ftp://sunsite.dk/mirrors/mysql/Downloads/MySQL-4.0/ \
|
|
|
|
http://mysql.mediatraffic.fi/Downloads/MySQL-4.0/ \
|
|
|
|
ftp://filepile.tiscali.de/mirror/mysql/Downloads/MySQL-4.0/ \
|
|
|
|
http://mirrors.tilian.co.uk/mysql.com/Downloads/MySQL-4.0/ \
|
|
|
|
ftp://ftp.rtfm.no/pub/mysql/Downloads/MySQL-4.0/ \
|
|
|
|
http://www.mysql.cz/Downloads/MySQL-4.0/ \
|
|
|
|
ftp://ftp.u-paris10.fr/mysql.com/Downloads/MySQL-4.0/ \
|
|
|
|
http://mysql.oms-net.nl/Downloads/MySQL-4.0/ \
|
|
|
|
ftp://ftp.free.fr/pub/MySQL/Downloads/MySQL-4.0/
|
|
|
|
PKGNAMESUFFIX?= -server
|
|
|
|
DISTNAME= ${PORTNAME}-${PORTVERSION}-gamma
|
|
|
|
|
|
|
|
MAINTAINER= sysadmin@alexdupre.com
|
|
|
|
|
|
|
|
SLAVEDIRS= databases/mysql40-client
|
1999-08-11 22:56:03 +02:00
|
|
|
DB_DIR?= /var/db/mysql
|
2003-01-31 17:02:39 +01:00
|
|
|
USE_PERL5_RUN= yes
|
1999-06-05 21:00:43 +02:00
|
|
|
USE_LIBTOOL= yes
|
2003-01-31 17:02:39 +01:00
|
|
|
|
|
|
|
GNU_CONFIGURE= yes
|
1999-08-11 22:56:03 +02:00
|
|
|
CONFIGURE_ARGS= --localstatedir=${DB_DIR} \
|
1997-06-18 21:35:30 +02:00
|
|
|
--without-debug \
|
1998-03-28 15:43:39 +01:00
|
|
|
--without-readline \
|
2000-10-19 11:17:57 +02:00
|
|
|
--without-bench \
|
2003-01-31 17:02:39 +01:00
|
|
|
--without-extra-tools \
|
2001-01-07 14:52:24 +01:00
|
|
|
--with-libwrap \
|
2003-01-31 17:02:39 +01:00
|
|
|
--with-raid \
|
|
|
|
--with-mysqlfs \
|
|
|
|
--with-vio \
|
2001-12-18 23:41:48 +01:00
|
|
|
--with-low-memory \
|
2002-06-20 16:47:47 +02:00
|
|
|
--with-comment='FreeBSD port: ${PKGNAME}' \
|
2003-01-31 17:02:39 +01:00
|
|
|
--with-server-suffix='' \
|
|
|
|
--program-prefix=''
|
2001-12-18 23:41:48 +01:00
|
|
|
|
1999-09-17 21:51:56 +02:00
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
2002-09-03 23:31:38 +02:00
|
|
|
CONFIGURE_ARGS+=--enable-assembler --with-berkeley-db
|
2001-03-04 19:50:21 +01:00
|
|
|
.endif
|
2001-01-25 02:03:09 +01:00
|
|
|
.if defined(WITH_CHARSET) && ${WITH_CHARSET} != ""
|
|
|
|
CONFIGURE_ARGS+=--with-charset=${WITH_CHARSET}
|
2002-11-17 16:58:19 +01:00
|
|
|
.endif
|
2001-01-25 02:03:09 +01:00
|
|
|
.if defined(WITH_XCHARSET) && ${WITH_XCHARSET} != ""
|
|
|
|
CONFIGURE_ARGS+=--with-extra-charsets=${WITH_XCHARSET}
|
|
|
|
.endif
|
2003-01-31 17:02:39 +01:00
|
|
|
.if defined(WITH_OPENSSL)
|
|
|
|
USE_OPENSSL= yes
|
|
|
|
CONFIGURE_ARGS+=--with-openssl
|
|
|
|
.endif
|
2001-12-17 23:50:46 +01:00
|
|
|
.if defined(BUILD_STATIC)
|
2003-01-31 17:02:39 +01:00
|
|
|
CONFIGURE_ARGS+=--with-mysqld-ldflags=-all-static
|
2001-12-17 23:50:46 +01:00
|
|
|
.endif
|
|
|
|
.if defined(BUILD_OPTIMIZED)
|
2003-01-31 17:02:39 +01:00
|
|
|
CFLAGS+= -mcpu=i686
|
2001-05-23 22:26:06 +02:00
|
|
|
.endif
|
2002-02-14 23:11:45 +01:00
|
|
|
.if defined(THREAD_SAFE_CLIENT)
|
|
|
|
CONFIGURE_ARGS+=--enable-thread-safe-client
|
|
|
|
.endif
|
2001-01-21 12:49:48 +01:00
|
|
|
|
2003-01-31 17:02:39 +01:00
|
|
|
CFLAGS+= -O3 -fno-omit-frame-pointer
|
2001-01-21 12:49:48 +01:00
|
|
|
CXXFLAGS= ${CFLAGS} -felide-constructors -fno-rtti
|
2003-01-31 17:02:39 +01:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
2001-01-21 12:49:48 +01:00
|
|
|
.if ${OSVERSION} >= 400002
|
|
|
|
CXXFLAGS+= -fno-exceptions
|
|
|
|
.endif
|
2002-11-13 11:38:20 +01:00
|
|
|
.if ${OSVERSION} < 500000
|
2003-01-31 17:02:39 +01:00
|
|
|
CXX= ${CC}
|
2002-11-13 11:38:20 +01:00
|
|
|
.endif
|
1997-06-18 21:35:30 +02:00
|
|
|
|
2001-08-13 23:50:34 +02:00
|
|
|
# MySQL-Server part
|
|
|
|
.if !defined(CLIENT_ONLY)
|
2003-01-31 17:02:39 +01:00
|
|
|
RUN_DEPENDS= mysql:${PORTSDIR}/databases/mysql40-client \
|
2001-08-18 23:57:18 +02:00
|
|
|
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-Mysql
|
2001-08-13 23:50:34 +02:00
|
|
|
|
2003-01-31 17:02:39 +01:00
|
|
|
PLIST_SUB= MYSQL_VERSION=${PORTVERSION}-gamma
|
2001-08-13 23:50:34 +02:00
|
|
|
|
2003-02-04 15:13:34 +01:00
|
|
|
ONLY_FOR_ARCHS= i386 alpha sparc64
|
2003-01-31 17:02:39 +01:00
|
|
|
|
|
|
|
DOCS= manual.html manual.ps manual_toc.html manual.txt manual.texi \
|
|
|
|
include.texi
|
2002-08-19 15:27:52 +02:00
|
|
|
|
2001-01-25 02:03:09 +01:00
|
|
|
pre-fetch:
|
|
|
|
@${ECHO} ""
|
|
|
|
@${ECHO} "You may use the following build options:"
|
|
|
|
@${ECHO} ""
|
2003-01-31 17:02:39 +01: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 23:50:34 +02:00
|
|
|
@${ECHO} " DB_DIR=directory Set alternate directory for database files"
|
|
|
|
@${ECHO} " (default is /var/db/mysql)."
|
2003-01-31 17:02:39 +01:00
|
|
|
@${ECHO} " SKIP_INSTALL_DB=yes Skip database initialization"
|
|
|
|
@${ECHO} " (useful for upgrades)."
|
|
|
|
@${ECHO} " SKIP_DNS_CHECK=yes Don't run resolveip to do an additional"
|
2001-08-13 23:50:34 +02:00
|
|
|
@${ECHO} " DNS check before inserting local hostname to"
|
2003-01-31 17:02:39 +01:00
|
|
|
@${ECHO} " mysql database"
|
|
|
|
@${ECHO} " (use if your machine has no official DNS entry)."
|
2001-12-17 23:50:46 +01:00
|
|
|
@${ECHO} " BUILD_STATIC=yes Build a static version of mysqld."
|
2003-01-31 17:02:39 +01:00
|
|
|
@${ECHO} " BUILD_OPTIMIZED=yes Add -mcpu=i686 to CFLAGS."
|
2001-01-25 02:03:09 +01:00
|
|
|
@${ECHO} ""
|
|
|
|
|
2003-01-31 17:02:39 +01: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-08-05 14:01:09 +02:00
|
|
|
.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB)
|
1997-06-18 21:35:30 +02:00
|
|
|
pre-install:
|
1999-08-11 22:56:03 +02:00
|
|
|
@${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}."
|
|
|
|
@${ECHO} ""
|
|
|
|
@${ECHO} "In order to preserve your existing data, you should:"
|
|
|
|
@${ECHO} " - dump all your databases"
|
|
|
|
@${ECHO} " - kill mysql if it is running"
|
|
|
|
@${ECHO} " - delete the ${DB_DIR} directory"
|
|
|
|
@${ECHO} " - run 'make install'"
|
|
|
|
@${ECHO} " - start up mysql"
|
|
|
|
@${ECHO} " - re-create all of your database"
|
|
|
|
@${ECHO} " - re-load your data"
|
|
|
|
@${ECHO} ""
|
|
|
|
@${ECHO} "If you understand the consequences of this upgrade, please re-build this"
|
|
|
|
@${ECHO} "port with the environment variable OVERWRITE_DB defined."
|
|
|
|
@${FALSE}
|
1998-12-01 03:56:08 +01:00
|
|
|
.endif
|
1997-06-18 21:35:30 +02:00
|
|
|
|
|
|
|
post-install:
|
1998-12-01 03:56:08 +01:00
|
|
|
.if !defined(PACKAGE_BUILDING)
|
2001-08-05 14:01:09 +02:00
|
|
|
.if !defined(SKIP_INSTALL_DB)
|
2001-08-13 23:50:34 +02:00
|
|
|
.if defined(SKIP_DNS_CHECK)
|
2001-08-05 14:01:09 +02:00
|
|
|
${PREFIX}/bin/mysql_install_db --force
|
|
|
|
.else
|
1998-09-06 21:58:26 +02:00
|
|
|
${PREFIX}/bin/mysql_install_db
|
2001-08-05 14:01:09 +02:00
|
|
|
.endif
|
|
|
|
.endif
|
1999-08-11 22:56:03 +02:00
|
|
|
@${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
1998-12-01 03:56:08 +01:00
|
|
|
.endif
|
2002-11-10 21:24:24 +01: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 21:01:07 +02:00
|
|
|
@${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh
|
1998-09-06 21:58:26 +02:00
|
|
|
|
|
|
|
.if !defined(NOPORTDOCS)
|
2003-01-31 17:02:39 +01:00
|
|
|
${MKDIR} ${DOCSDIR}/Flags
|
|
|
|
.for doc in ${DOCS}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/Docs/${doc} ${DOCSDIR}
|
1997-06-18 21:35:30 +02:00
|
|
|
.endfor
|
2003-01-31 17:02:39 +01:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/Docs/Flags/*.gif ${DOCSDIR}/Flags
|
1998-09-06 21:58:26 +02:00
|
|
|
.endif
|
|
|
|
|
2000-04-03 00:15:13 +02:00
|
|
|
# MySQL-Client part
|
1999-07-01 10:44:49 +02:00
|
|
|
.else
|
2001-01-06 00:40:52 +01:00
|
|
|
MAN1= isamchk.1 isamlog.1 mysql.1 mysql_zap.1 mysqlaccess.1 \
|
2003-01-31 17:02:39 +01:00
|
|
|
mysqladmin.1 mysqld.1 mysqld_multi.1 mysqld_safe.1 mysqldump.1 \
|
|
|
|
mysqlshow.1 perror.1 replace.1
|
1999-07-01 10:44:49 +02:00
|
|
|
|
2000-09-23 20:57:11 +02:00
|
|
|
INSTALLS_SHLIB= yes
|
|
|
|
LDCONFIG_DIRS= %%PREFIX%%/lib/mysql
|
|
|
|
|
1999-07-01 10:44:49 +02:00
|
|
|
CONFIGURE_ARGS+=--without-server
|
|
|
|
MAKE_ENV= CLIENT_ONLY="${CLIENT_ONLY}"
|
|
|
|
|
|
|
|
post-install:
|
2002-02-11 14:35:35 +01:00
|
|
|
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-client.sh > ${PREFIX}/etc/rc.d/000.mysql-client.sh
|
2002-02-12 12:39:26 +01:00
|
|
|
@${CHMOD} 750 ${PREFIX}/etc/rc.d/000.mysql-client.sh
|
2001-01-21 12:49:48 +01:00
|
|
|
|
2000-10-19 11:17:57 +02:00
|
|
|
.endif
|
1999-07-01 10:44:49 +02:00
|
|
|
|
2001-01-21 12:49:48 +01:00
|
|
|
.include <bsd.port.post.mk>
|