Makefile revision 7391
842ae4bd224140319ae7feec1872b93dfd491143fielding#
842ae4bd224140319ae7feec1872b93dfd491143fielding# CDDL HEADER START
842ae4bd224140319ae7feec1872b93dfd491143fielding#
842ae4bd224140319ae7feec1872b93dfd491143fielding# The contents of this file are subject to the terms of the
842ae4bd224140319ae7feec1872b93dfd491143fielding# Common Development and Distribution License (the "License").
842ae4bd224140319ae7feec1872b93dfd491143fielding# You may not use this file except in compliance with the License.
1f728f035fca81594193e198b40bfa732b1c02ebtrawick#
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# or http://www.opensolaris.org/os/licensing.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# See the License for the specific language governing permissions
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# and limitations under the License.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd#
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# When distributing Covered Code, include this CDDL HEADER in each
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# If applicable, add the following below this CDDL HEADER, with the
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# fields enclosed by brackets "[]" replaced with your own identifying
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh# information: Portions Copyright [yyyy] [name of copyright owner]
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh#
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh# CDDL HEADER END
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh#
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh#
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh#
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# This variable has no impact on perl build, it is here merely to satisfy
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# "modernized" gate infrastructure. The bitness of the module is driven by the
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# bitness of perl interpreter itself. That is hardcoded in
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# $(WS_MAKE_RULES)/makemaker.mk
1f728f035fca81594193e198b40bfa732b1c02ebtrawickBUILD_BITS = 64
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
1f728f035fca81594193e198b40bfa732b1c02ebtrawickinclude ../../../make-rules/shared-macros.mk
1f728f035fca81594193e198b40bfa732b1c02ebtrawick
1f728f035fca81594193e198b40bfa732b1c02ebtrawickCOMPONENT_NAME= DBD-mysql
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbbCOMPONENT_VERSION= 4.040
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawickIPS_COMPONENT_VERSION= 4040
1f728f035fca81594193e198b40bfa732b1c02ebtrawickHUMAN_VERSION= $(COMPONENT_VERSION)
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcCOMPONENT_ARCHIVE_HASH= \
886cd69ebf69e990dbc365be87ff8ea7cd681904rbb sha256:a3438bba3cce02b13870b146b9db76a519b98e978d9dfe8516a63daff2989040
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbbCOMPONENT_ARCHIVE_URL= http://search.cpan.org/CPAN/authors/id/M/MI/MICHIELB/$(COMPONENT_ARCHIVE)
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcCOMPONENT_PROJECT_URL= https://github.com/perl5-dbi/DBD-mysql
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcCOMPONENT_BUGDB= perl-mod/dbd-mysql
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletc
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcTPNO= 32689
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb
2a503ad7fa6fc3572647e915a0d7f31a17d11b1drbb
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# MySQL 5.7 is not available in S11.
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickifeq ($(BUILD_TYPE), evaluation)
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickPUBLISH_STAMP=
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickelse
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcBUILD_STYLE= makemaker
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcLICENSE=DBD-mysql.license
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcBUILD_TARGET= $(BUILD_$(MK_BITS)) $(LICENSE)
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcinclude $(WS_MAKE_RULES)/common.mk
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickendif
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickCLEAN_PATHS += $(LICENSE)
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickCOMPONENT_TEST_TARGETS = test
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcCOMPONENT_TEST_TRANSFORMS += \
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletc '-e "s/[0-9][0-9]* wallclock secs (.*CPU)$$/<TIMINGS REMOVED>/" ' \
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletc '-e "s/^\(\# mysql_[a-z][a-z]* is: \).*/\1<REMOVED>/" ' \
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletc '-e "s/^\(\# SQL_DBMS_VER is \).*/\1<REMOVED>/" ' \
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick '-e "s/^\(\# Driver version is \).*/\1<REMOVED>/" ' \
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick '-e "/chmod 644 \"mysql.bs\"/d"' \
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawick '-e "/Running Mkbootstrap/d"'
8d290205047d88e37555019fe9a26f1c5ece7023gregames
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcASLR_MODE = $(ASLR_NOT_APPLICABLE)
8d290205047d88e37555019fe9a26f1c5ece7023gregames
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcMYSQL_VERSION = 5.7
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcMYSQL_BINDIR = $(USRDIR)/mysql/$(MYSQL_VERSION)/bin
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcMYSQL_TEST_USER = root
c6a06ed5b9ec5600bedefc11bbc22919fe170ad4jailletcMYSQL_TEST_PASSWORD = new-password
8d290205047d88e37555019fe9a26f1c5ece7023gregamesMYSQL_TEST_DATADIR = $(COMPONENT_TEST_BUILD_DIR)/test_datadir
8d290205047d88e37555019fe9a26f1c5ece7023gregames
8d290205047d88e37555019fe9a26f1c5ece7023gregamesCOMPONENT_TEST_ENV += MYSQL_HISTFILE=/dev/null
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawick
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickCONFIGURE_OPTIONS += --mysql_config="$(MYSQL_BINDIR)/mysql_config"
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickCONFIGURE_OPTIONS += --testuser=$(MYSQL_TEST_USER)
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickCONFIGURE_OPTIONS += --testpassword=$(MYSQL_TEST_PASSWORD)
67f6dca9f3c35eb904c7b29a220db6c4482374dctrawickCONFIGURE_OPTIONS += --testsocket=CHANGEME
8d290205047d88e37555019fe9a26f1c5ece7023gregames
8d290205047d88e37555019fe9a26f1c5ece7023gregames# !!!!!!!!! workaround for 22552923
db3fa7db7c7910f2f23c3e3ffe0cf9f41a1899b9trawickMYSQL_LIBS = $(shell $(MYSQL_BINDIR)/mysql_config --libs)
12d7cc79eeb598697b4c9046991035d91fac2476ndCONFIGURE_OPTIONS += --libs="$(MYSQL_LIBS) -lCrun"
12d7cc79eeb598697b4c9046991035d91fac2476nd# !!!!!!!!! workaround for 22552923
12d7cc79eeb598697b4c9046991035d91fac2476nd
12d7cc79eeb598697b4c9046991035d91fac2476nd# For the testing we need to run mysql database first. The database needs it's
12d7cc79eeb598697b4c9046991035d91fac2476nd# directory, which will be $(MYSQL_TEST_DATADIR). The directory will also
1f728f035fca81594193e198b40bfa732b1c02ebtrawick# contain socket over which the testing will be performed. Problem is that the
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh# path can be maximally 107 characters long. To overcome that limit, we'll
# create a symlink in /tmp pointing to the directory and refer the database to
# that symlink. The symlink must have random name, so that multiple tests may
# be executed simultaneously. Problem is that we have to specify the symlink
# name during configure. To overcome that I specify the socket name as
# 'CHANGEME' and "fix" the tests once I know the name of symlink.
# Second challenge is to make sure that the mysql daemon will be stopped once
# the tests end (finish or are interrupted). There are three mechanisms to do
# that.
# a) mysql stores it's pid to $(MYSQL_TEST_DATADIR)/pid
# b) the COMPONENT_PRE_TEST_ACTION runs a background task which kills the
# daemon in 10 minutes no matter what.
# c) the COMPONENT_POST_TEST_ACTION kills both the mysql daemon and the
# background task
# If you want to keep mysqld running for your own testing purposes, delete all
# the lines containing 'kill' in COMPONENT_PRE_TEST_ACTION and whole
# COMPONENT_POST_TEST_ACTION. Then run "gmake test" once which will both run
# the DB and configure the module to use it. After that you can "cd builds/..."
# and "gmake test" directly there.
# Normally the noise from background jobs is sent to /dev/null so that it does
# not clobber the terminal. For debugging you can leave SILENT empty which will
# even turn on more output
SILENT = >/dev/null 2>&1
ifeq ($(strip $(SILENT)),)
SET_X = set -x;
MYSQLD_VERBOSE =
else
SET_X =
MYSQLD_VERBOSE = --verbose
endif
COMPONENT_PRE_TEST_ACTION = ( \
$(SET_X) cd "$(@D)"; \
\
: "Prepare the testing directory and create the symlink to it"; \
$(RM) -r "$(MYSQL_TEST_DATADIR)"; \
mkdir "$(MYSQL_TEST_DATADIR)"; \
TEST_LINK=`mktemp -t dbd-mysql-test.XXXXXX`; \
$(RM) "$$TEST_LINK"; \
ln -s $(MYSQL_TEST_DATADIR) "$$TEST_LINK"; \
\
: "alter the tests to use the path we just created"; \
$(PERL) -pi -e "s,('testsocket' => ').*?',\$$1/$$TEST_LINK/socket'," t/mysql.mtest ;\
\
: "Initialize mysql DB"; \
"$(MYSQL_BINDIR)/mysqld" \
--initialize-insecure \
--datadir="$$TEST_LINK" \
--basedir=/usr/mysql/$(MYSQL_VERSION) $(SILENT) ; \
\
echo "$$TEST_LINK" > "$$TEST_LINK"/test_link; \
\
: "Run the daemon in background. --gdb makes it possible to terminate mysqld via Ctrl+C"; \
"$(MYSQL_BINDIR)/mysqld" \
$(MYSQLD_VERBOSE) \
--skip-networking \
-u "$(MYSQL_TEST_USER)"\
--datadir="$$TEST_LINK" \
--socket="$$TEST_LINK"/socket \
--pid-file="$$TEST_LINK"/pid \
--gdb \
$(SILENT) & \
: "Now wait for the database to be online"; \
sleep 10; \
if [ ! -e "$$TEST_LINK/socket" ]; then \
: "We were not able to bring up the database?"; \
PID=`cat "$$TEST_LINK"/pid`; \
ps -p $$PID && kill $$PID || : \
$(RM) "$$TEST_LINK"; \
exit 1; \
fi; \
\
: "Set admin password"; \
"$(MYSQL_BINDIR)/mysqladmin" \
--socket "$$TEST_LINK"/socket \
-u "$(MYSQL_TEST_USER)" \
password "$(MYSQL_TEST_PASSWORD)" ; \
\
: "Create a database"; \
"$(MYSQL_BINDIR)/mysqladmin" \
--socket "$$TEST_LINK"/socket \
-u "$(MYSQL_TEST_USER)" \
--password="$(MYSQL_TEST_PASSWORD)" \
create test; \
\
: "Run job which will kill mysqld in 10 minutes"; \
( $(SET_X) PID=`cat "$$TEST_LINK"/pid`; sleep 600; ps -p $$PID && kill $$PID || : ) $(SILENT) & \
echo $$! > "$$TEST_LINK"/pid_of_guard; \
)
COMPONENT_POST_TEST_ACTION = ( \
( $(SET_X) PID=`cat $(MYSQL_TEST_DATADIR)/pid`; [ -n "$$PID" ] && ps -p $$PID && kill $$PID || : ) $(SILENT); \
( $(SET_X) PID=`cat $(MYSQL_TEST_DATADIR)/pid_of_guard`; [ -n "$$PID" ] && ps -p $$PID && kill $$PID || : ) $(SILENT); \
( $(SET_X) if [ -e "$(MYSQL_TEST_DATADIR)/test_link" ]; then rm -f `cat "$(MYSQL_TEST_DATADIR)/test_link"`; fi ) $(SILENT); \
)
$(LICENSE): $(LICENSE).template
$(PERL) -pe 's/COMPONENT_VERSION/$(COMPONENT_VERSION)/g' "$<" > "$@"
REQUIRED_PACKAGES += database/mysql-57/library
REQUIRED_PACKAGES += library/perl-5/database
REQUIRED_PACKAGES += system/library/c++-runtime