diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-db/drizzle | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-db/drizzle')
-rw-r--r-- | dev-db/drizzle/Manifest | 1 | ||||
-rw-r--r-- | dev-db/drizzle/drizzle-7.2.4.ebuild | 168 | ||||
-rw-r--r-- | dev-db/drizzle/files/drizzle-7.2.3+automake-1.12.patch | 33 | ||||
-rw-r--r-- | dev-db/drizzle/files/drizzle-7.2.3-libtool.patch | 13 | ||||
-rw-r--r-- | dev-db/drizzle/files/drizzle-7.2.4+boost-1.50.patch | 90 | ||||
-rw-r--r-- | dev-db/drizzle/files/drizzle-7.2.4-fix-boost_thread-detection.patch | 18 | ||||
-rw-r--r-- | dev-db/drizzle/files/drizzle.conf.d | 1 | ||||
-rw-r--r-- | dev-db/drizzle/files/drizzle.init.d | 134 | ||||
-rw-r--r-- | dev-db/drizzle/files/drizzle.init.d.2 | 127 | ||||
-rw-r--r-- | dev-db/drizzle/metadata.xml | 50 |
10 files changed, 635 insertions, 0 deletions
diff --git a/dev-db/drizzle/Manifest b/dev-db/drizzle/Manifest new file mode 100644 index 000000000000..684b6fc0ca74 --- /dev/null +++ b/dev-db/drizzle/Manifest @@ -0,0 +1 @@ +DIST drizzle-7.2.4-alpha.tar.gz 20075673 SHA256 dddc58949c28ccbdd8351b25540858235a7d98efb634e7bc98abd4f5ab034677 SHA512 1053c9b73588542b32398168fc4aae96a19479222571fb4ba35feb1fa6e99961366fc63a4141bf86bdba7f5db1960ed895b3a688789d05ee8d4bd46d0ab681cd WHIRLPOOL 4b2e97f7276eb447f27bc5b0244e31d47cba2acc0fde16d6e10dc0d47ba680885e035b9cf9dda8dff171279a76fbd24f34d2754ac1342b203d56316bb4d34233 diff --git a/dev-db/drizzle/drizzle-7.2.4.ebuild b/dev-db/drizzle/drizzle-7.2.4.ebuild new file mode 100644 index 000000000000..d7eb1687552f --- /dev/null +++ b/dev-db/drizzle/drizzle-7.2.4.ebuild @@ -0,0 +1,168 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit python flag-o-matic libtool autotools eutils pam user versionator + +MY_P="${P}-alpha" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Database optimized for Cloud and Net applications" +HOMEPAGE="http://drizzle.org" +SRC_URI="http://launchpad.net/drizzle/$(get_version_component_range 1-2)/${PV}/+download/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug tcmalloc doc memcache curl pam gearman +md5 ldap v8" + +RDEPEND="tcmalloc? ( dev-util/google-perftools ) + sys-libs/readline + sys-apps/util-linux + dev-libs/libpcre + dev-libs/openssl + >=dev-libs/libevent-1.4 + >=dev-libs/protobuf-2.1.0 + dev-libs/libaio + >=dev-libs/boost-1.52.0-r1:=[threads] + gearman? ( >=sys-cluster/gearmand-0.12 ) + pam? ( sys-libs/pam ) + curl? ( net-misc/curl ) + memcache? ( >=dev-libs/libmemcached-0.39 ) + md5? ( >=dev-libs/libgcrypt-1.4.2:0 ) + ldap? ( net-nds/openldap ) + v8? ( dev-lang/v8 ) + !dev-db/libdrizzle" + +DEPEND="${RDEPEND} + =dev-lang/python-2* + sys-devel/gettext + dev-util/intltool + dev-util/gperf + sys-devel/flex + dev-python/sphinx + doc? ( app-doc/doxygen )" + +pkg_setup() { + enewuser drizzle -1 -1 /dev/null nogroup + python_set_active_version 2 + python_pkg_setup +} + +src_prepare() { + epatch \ + "${FILESDIR}/${PN}-7.2.3-libtool.patch" \ + "${FILESDIR}/${PN}-7.2.3+automake-1.12.patch" \ + "${FILESDIR}/${PN}-7.2.4+boost-1.50.patch" \ + "${FILESDIR}/${P}-fix-boost_thread-detection.patch" + + python_convert_shebangs -r 2 . + + epatch_user + eautoreconf +} + +src_configure() { + local myconf= + + if use debug; then + append-cppflags -DDEBUG + fi + + # while I applaud upstreams goal of 0 compiler warnings + # the 1412 release didn't achieve it. + append-flags -Wno-error + + # NOTE disable-all and without-all no longer recognized options + # NOTE using --enable on some plugins can cause test failures. + # --with should be used instead. A discussion about this here: + # https://bugs.launchpad.net/drizzle/+bug/598659 + # TODO (upstream) + # $(use_with memcache memcached-stats-plugin) \ + # $(use_with memcache memcached-functions-plugin) \ + + econf \ + --disable-static \ + --disable-dependency-tracking \ + --disable-mtmalloc \ + --without-hello-world-plugin \ + --disable-rabbitmq-plugin --without-rabbitmq-plugin \ + --disable-zeromq-plugin --without-zeromq-plugin \ + --with-auth-test-plugin \ + --with-auth-file-plugin \ + --with-simple-user-policy-plugin \ + --enable-logging-stats-plugin \ + --with-logging-stats-plugin \ + --enable-console-plugin \ + $(use_enable gearman libgearman) \ + $(use_enable ldap libldap) \ + $(use_enable memcache libmemcached) \ + $(use_enable tcmalloc) \ + $(use_with curl auth-http-plugin) \ + $(use_with gearman gearman-udf-plugin) \ + $(use_with gearman logging-gearman-plugin) \ + $(use_with ldap auth-ldap-plugin) \ + $(use_with md5 md5-plugin) \ + $(use_with pam auth-pam-plugin) \ + $(use_with v8 js-plugin) \ + ${myconf} +} + +src_compile() { + emake V=1 all $(use doc && echo doxygen) +} + +# currently not working as of 7.2.3 +RESTRICT=test + +src_test() { + if [[ ${EUID} == 0 ]]; then + eerror "You cannot run tests as root." + eerror "Please enable FEATURES=userpriv before proceeding." + return 1 + fi + + default +} + +DOCS=( AUTHORS NEWS README ) + +src_install() { + default + + find "${D}" -name '*.la' -delete || die + + if use doc; then + docinto apidoc + pushd docs/html + dohtml -r . + popd + fi + + newinitd "${FILESDIR}"/drizzle.init.d.2 drizzled + newconfd "${FILESDIR}"/drizzle.conf.d drizzled + + if ! use gearman; then + sed -i -e '/need gearmand/d' "${D}"/etc/init.d/drizzled \ + || die "unable to sed init script (gearman)" + fi + + if ! use memcache; then + sed -i -e '/need memcached/d' "${D}"/etc/init.d/drizzled \ + || die "unable to sed init script (memcache)" + fi + + keepdir /var/log/drizzle + keepdir /var/lib/drizzle/drizzled + keepdir /etc/drizzle + + fperms 0755 /var/log/drizzle + fperms -R 0700 /var/lib/drizzle + + fowners drizzle:nogroup /var/log/drizzle + fowners -R drizzle:nogroup /var/lib/drizzle + + pamd_mimic system-auth drizzle auth account session +} diff --git a/dev-db/drizzle/files/drizzle-7.2.3+automake-1.12.patch b/dev-db/drizzle/files/drizzle-7.2.3+automake-1.12.patch new file mode 100644 index 000000000000..4f33dc557a5a --- /dev/null +++ b/dev-db/drizzle/files/drizzle-7.2.3+automake-1.12.patch @@ -0,0 +1,33 @@ +Index: drizzle-7.2.3/m4/pandora_canonical.m4 +=================================================================== +--- drizzle-7.2.3.orig/m4/pandora_canonical.m4 ++++ drizzle-7.2.3/m4/pandora_canonical.m4 +@@ -98,9 +98,9 @@ AC_DEFUN([PANDORA_CANONICAL_TARGET],[ + AC_CANONICAL_TARGET + + m4_if(PCT_DONT_SUPRESS_INCLUDE,yes,[ +- AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability subdir-objects foreign tar-ustar) ++ AM_INIT_AUTOMAKE(-Wall -Wno-portability subdir-objects foreign tar-ustar) + ],[ +- AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability nostdinc subdir-objects foreign tar-ustar) ++ AM_INIT_AUTOMAKE(-Wall -Wno-portability nostdinc subdir-objects foreign tar-ustar) + ]) + + m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) +Index: drizzle-7.2.3/tests/include.am +=================================================================== +--- drizzle-7.2.3.orig/tests/include.am ++++ drizzle-7.2.3/tests/include.am +@@ -101,10 +101,10 @@ EXTRA_DIST += \ + check-local: tests/var/drizzle test-drizzle + + tests/var: +- $(mkdir_p) tests/var ++ $(MKDIR_P) tests/var + + tests/var/drizzle: tests/var +- $(mkdir_p) tests/var/drizzle ++ $(MKDIR_P) tests/var/drizzle + + + # dtr - a shortcut for executing test-run.pl diff --git a/dev-db/drizzle/files/drizzle-7.2.3-libtool.patch b/dev-db/drizzle/files/drizzle-7.2.3-libtool.patch new file mode 100644 index 000000000000..609b8adfd67e --- /dev/null +++ b/dev-db/drizzle/files/drizzle-7.2.3-libtool.patch @@ -0,0 +1,13 @@ +Index: drizzle-7.2.3/libdrizzle-1.0/include.am +=================================================================== +--- drizzle-7.2.3.orig/libdrizzle-1.0/include.am ++++ drizzle-7.2.3/libdrizzle-1.0/include.am +@@ -48,7 +48,7 @@ libdrizzle_1_0_libdrizzle_la_LDFLAGS= \ + -version-info \ + $(LIBDRIZZLE_LIBRARY_VERSION) + +-libdrizzle_1_0_libdrizzle_la_LIBADD= $(LIBSSL) ++libdrizzle_1_0_libdrizzle_la_LIBADD= $(LTLIBSSL) + + libdrizzle_1_0_libdrizzle_la_SOURCES= \ + libdrizzle/column.cc \ diff --git a/dev-db/drizzle/files/drizzle-7.2.4+boost-1.50.patch b/dev-db/drizzle/files/drizzle-7.2.4+boost-1.50.patch new file mode 100644 index 000000000000..0b10d74020cd --- /dev/null +++ b/dev-db/drizzle/files/drizzle-7.2.4+boost-1.50.patch @@ -0,0 +1,90 @@ +Index: drizzle-7.2.4-alpha/client/drizzleslap.cc +=================================================================== +--- drizzle-7.2.4-alpha.orig/client/drizzleslap.cc ++++ drizzle-7.2.4-alpha/client/drizzleslap.cc +@@ -1934,7 +1934,7 @@ static void timer_thread() + boost::mutex::scoped_lock scopedLock(timer_alarm_mutex); + + boost::xtime xt; +- xtime_get(&xt, boost::TIME_UTC); ++ xtime_get(&xt, boost::TIME_UTC_); + xt.sec += opt_timer_length; + + (void)timer_alarm_threshold.timed_wait(scopedLock, xt); +Index: drizzle-7.2.4-alpha/configure.ac +=================================================================== +--- drizzle-7.2.4-alpha.orig/configure.ac ++++ drizzle-7.2.4-alpha/configure.ac +@@ -111,7 +111,6 @@ PANDORA_DRIZZLE_BUILD + PANDORA_HAVE_BOOST_TEST + PANDORA_HAVE_LIBSQLITE3 + +- + ######################################################################### + + +Index: drizzle-7.2.4-alpha/drizzled/drizzled.cc +=================================================================== +--- drizzle-7.2.4-alpha.orig/drizzled/drizzled.cc ++++ drizzle-7.2.4-alpha/drizzled/drizzled.cc +@@ -460,7 +460,7 @@ void close_connections() + while (select_thread_in_use) + { + boost::xtime xt; +- xtime_get(&xt, boost::TIME_UTC); ++ xtime_get(&xt, boost::TIME_UTC_); + xt.sec += 2; + + for (uint32_t tmp=0 ; tmp < 10 && select_thread_in_use; tmp++) +Index: drizzle-7.2.4-alpha/drizzled/table/cache.cc +=================================================================== +--- drizzle-7.2.4-alpha.orig/drizzled/table/cache.cc ++++ drizzle-7.2.4-alpha/drizzled/table/cache.cc +@@ -263,7 +263,7 @@ bool Cache::removeTable(Session& session + table::Cache::removeTable routine. + */ + boost::xtime xt; +- xtime_get(&xt, boost::TIME_UTC); ++ xtime_get(&xt, boost::TIME_UTC_); + xt.sec += 10; + boost::mutex::scoped_lock scoped(table::Cache::mutex(), boost::adopt_lock_t()); + COND_refresh.timed_wait(scoped, xt); +Index: drizzle-7.2.4-alpha/drizzled/thr_lock.cc +=================================================================== +--- drizzle-7.2.4-alpha.orig/drizzled/thr_lock.cc ++++ drizzle-7.2.4-alpha/drizzled/thr_lock.cc +@@ -170,7 +170,7 @@ static enum enum_thr_lock_result wait_fo + if (can_deadlock) + { + boost::xtime xt; +- xtime_get(&xt, boost::TIME_UTC); ++ xtime_get(&xt, boost::TIME_UTC_); + xt.sec += table_lock_wait_timeout; + if (not cond->timed_wait(scoped, xt)) + { +Index: drizzle-7.2.4-alpha/plugin/sleep/sleep.cc +=================================================================== +--- drizzle-7.2.4-alpha.orig/plugin/sleep/sleep.cc ++++ drizzle-7.2.4-alpha/plugin/sleep/sleep.cc +@@ -98,7 +98,7 @@ int64_t Item_func_sleep::val_int() + + try { + boost::xtime xt; +- xtime_get(&xt, boost::TIME_UTC); ++ xtime_get(&xt, boost::TIME_UTC_); + xt.nsec += (uint64_t)(dtime * 1000000000ULL); + session.getThread()->sleep(xt); + } +Index: drizzle-7.2.4-alpha/drizzled/message/include.am +=================================================================== +--- drizzle-7.2.4-alpha.orig/drizzled/message/include.am ++++ drizzle-7.2.4-alpha/drizzled/message/include.am +@@ -40,7 +40,7 @@ lib_LTLIBRARIES += drizzled/message/libd + drizzled_message_libdrizzledmessage_la_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR} + + drizzled_message_libdrizzledmessage_la_SOURCES = drizzled/message/statement_transform.cc +-drizzled_message_libdrizzledmessage_la_LIBADD= ${LTLIBPROTOBUF} $(GCOV_LIBS) drizzled/libcharset.la ++drizzled_message_libdrizzledmessage_la_LIBADD= ${LTLIBPROTOBUF} $(GCOV_LIBS) $(BOOST_LIBS) drizzled/libcharset.la + + nobase_dist_pkginclude_HEADERS+= \ + drizzled/message/statement_transform.h diff --git a/dev-db/drizzle/files/drizzle-7.2.4-fix-boost_thread-detection.patch b/dev-db/drizzle/files/drizzle-7.2.4-fix-boost_thread-detection.patch new file mode 100644 index 000000000000..e33e6e59afd1 --- /dev/null +++ b/dev-db/drizzle/files/drizzle-7.2.4-fix-boost_thread-detection.patch @@ -0,0 +1,18 @@ +--- m4/pandora_have_libboost_thread.m4.orig 2014-02-12 13:52:43.580001598 +0400 ++++ m4/pandora_have_libboost_thread.m4 2014-02-12 13:53:24.288002974 +0400 +@@ -17,13 +17,13 @@ + CXXFLAGS="${PTHREAD_CFLAGS} ${CXXFLAGS}" + + AC_LANG_PUSH(C++) +- AC_LIB_HAVE_LINKFLAGS(boost_thread-mt,,[ ++ AC_LIB_HAVE_LINKFLAGS(boost_thread-mt,boost_system-mt,[ + #include <boost/thread.hpp> + ],[ + boost::thread id; + ]) + AS_IF([test "x${ac_cv_libboost_thread_mt}" = "xno"],[ +- AC_LIB_HAVE_LINKFLAGS(boost_thread,,[ ++ AC_LIB_HAVE_LINKFLAGS(boost_thread,boost_system,[ + #include <boost/thread.hpp> + ],[ + boost::thread id; diff --git a/dev-db/drizzle/files/drizzle.conf.d b/dev-db/drizzle/files/drizzle.conf.d new file mode 100644 index 000000000000..c8a797897a56 --- /dev/null +++ b/dev-db/drizzle/files/drizzle.conf.d @@ -0,0 +1 @@ +DRIZZLE_EXTRA="" diff --git a/dev-db/drizzle/files/drizzle.init.d b/dev-db/drizzle/files/drizzle.init.d new file mode 100644 index 000000000000..e3185ae0863b --- /dev/null +++ b/dev-db/drizzle/files/drizzle.init.d @@ -0,0 +1,134 @@ +#!/sbin/runscript +# Copyright 1999-2011 Pavel Stratil, senbonzakura.eu +# Some functions were taken from debian init script. Licensed under GPL-2 +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +######################### +### Construct vars ###### +######################### + + +SUFFIX=".${SVCNAME#*.}" +[ "${SUFFIX}" == ".drizzled" ] && SUFFIX='' + +BASE_CNF="/etc/drizzle/drizzled" +BASE_PID="/var/run/drizzle/drizzled" +BASE_LOG="/var/log/drizzle/drizzled" +BASE_DIR="/var/lib/drizzle/drizzled" + +PIDFILE="${BASE_PID}${SUFFIX}.pid" +CNFFILE="${BASE_CNF}${SUFFIX}.cnf" +LOGFILE="${BASE_LOG}${SUFFIX}.log" +DATADIR="${BASE_DIR}${SUFFIX}" +DRIZZLE="/usr/bin/drizzle" +DRIZZLE_USER="drizzle" +DRIZZLE_DAEMON="/usr/sbin/drizzled" +DRIZZLE_EXTRA="" + +######################### +### Helper functions #### +######################### + + +# +# drizzle_status() checks if there is a server running and if it is accessible. +# "check_alive" insists on a pingable server, "check_dead" also fails +# if there is a lost drizzled in the process list +# Usage: boolean drizzle_status [check_alive|check_dead] [warn|nowarn] +# +drizzle_status() { + ping_output=`$DRIZZLE --ping 2>&1`; ping_alive=$(( ! $? )) + ps_alive=0 + if [ -f "$PIDFILE" ] && ps `cat $PIDFILE` >/dev/null 2>&1; then ps_alive=1; fi + + if [ "$1" = "check_alive" -a $ping_alive = 1 ] || + [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then + return 0 # EXIT_SUCCESS + else + if [ "$2" = "warn" ]; then + echo -e "$ps_alive processes alive and '$DRIZZLE --ping' resulted in\n$ping_output\n" + fi + return 1 # EXIT_FAILURE + fi +} + +######################### +### Main ################ +######################### + +checkconfig() { + # TODO: --print-defaults no longer a valid option. Needs to be rewritten. + #CNFDATADIR=`drizzle_get_param datadir` + #if [ -z "${CNFDATADIR}" ] ; then + # ewarn "Datadir not set in ${CNFFILE}." + # ewarn "Trying to use ${DATADIR}" + #else + DATADIR="${CNFDATADIR}" + #fi + + if [[ ! -d "${DATADIR}" ]] ; then + eerror "Drizzle datadir is empty or invalid." + eerror "Please check your configuration ${CNFFILE} and DRIZZLE_EXTRA" + return 1 + fi + + if [ ! -f "${CNFFILE}" ]; then + eerror "The configuration file $CNFFILE was not found!" + fi +} + +depend() { + use localmount + use gearmand + use memcached + + # TODO use drizzle_get_param() to decide if gearmand and memcached + # are needed. Then the useflag based sed-ing of this script + # can be removed from the ebuild. +} + + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --pidfile ${PIDFILE} --stop \ + --exec ${DRIZZLE_DAEMON} + eend $? + drizzle_status check_dead warn +} + +start() { + #checkconfig + ebegin "Starting ${SVCNAME}" + # Test if ${BASE_PID}, ${BASE_LOG} and ${LOG_FILE} exist, create if not. + [ ! -e ${BASE_PID} ] && mkdir -p ${BASE_PID} && chown ${DRIZZLE_USER}:nogroup ${BASE_PID} + [ ! -e ${BASE_LOG} ] && mkdir -p ${BASE_LOG} && chown ${DRIZZLE_USER}:nogroup ${BASE_LOG} + [ ! -e ${LOGFILE} ] && touch ${LOGFILE} && chown ${DRIZZLE_USER}:nogroup ${LOGFILE} + start-stop-daemon --background --pidfile ${PIDFILE} --stderr ${LOGFILE} \ + --user ${DRIZZLE_USER} --start --exec ${DRIZZLE_DAEMON} -- \ + --datadir=${DATADIR} --pid-file=${PIDFILE} --user=${DRIZZLE_USER} \ + ${DRIZZLE_EXTRA} + eend $? + + # TODO in order to have replication always working we should add the + # --server-id=# option. AFAIK only integers are allowed, though + # ${HOSTNAME}${SVCNAME}${SUFFIX} whould be much easier to handle. + + for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do + sleep 1 + if drizzle_status check_alive nowarn ; then break ; fi + done + if drizzle_status check_alive warn ; then + einfo "${SVCNAME} is alive!" + else + eerror "${SVCNAME} died!" + fi +} + +status() { + if drizzle_status check_alive nowarn; then + einfo "status: started" + else + einfo "status: stopped" + fi +} diff --git a/dev-db/drizzle/files/drizzle.init.d.2 b/dev-db/drizzle/files/drizzle.init.d.2 new file mode 100644 index 000000000000..4b44ec0d51e9 --- /dev/null +++ b/dev-db/drizzle/files/drizzle.init.d.2 @@ -0,0 +1,127 @@ +#!/sbin/runscript +# Copyright 1999-2012 Pavel Stratil, senbonzakura.eu +# Some functions were taken from debian init script. Licensed under GPL-2 +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +######################### +### Construct vars ###### +######################### + + +SUFFIX=".${SVCNAME#*.}" +[ "${SUFFIX}" == ".drizzled" ] && SUFFIX='' + +DIR_PID="/run/drizzle" +DIR_LOG="/var/log/drizzle" + +BASE_CNF="/etc/drizzle/drizzled" +BASE_PID="${DIR_PID}/drizzled" +BASE_LOG="${DIR_LOG}/drizzled" +BASE_DIR="/var/lib/drizzle/drizzled" + +CNFFILE="${BASE_CNF}${SUFFIX}.cnf" +LOGFILE="${BASE_LOG}${SUFFIX}.log" +DATADIR="${BASE_DIR}${SUFFIX}" +DRIZZLE="/usr/bin/drizzle" +DRIZZLE_USER="drizzle" + +pidfile="${BASE_PID}${SUFFIX}.pid" +command="/usr/sbin/drizzled" +command_args="--daemon --datadir=${DATADIR} --pid-file=${pidfile} --user=${DRIZZLE_USER} --syslog.errmsg-enable ${DRIZZLE_EXTRA}" + +start_stop_daemon_args="--user ${DRIZZLE_USER} --wait 5000" + +######################### +### Helper functions #### +######################### + + +# +# drizzle_status() checks if there is a server running and if it is accessible. +# "check_alive" insists on a pingable server, "check_dead" also fails +# if there is a lost drizzled in the process list +# Usage: boolean drizzle_status [check_alive|check_dead] [warn|nowarn] +# +drizzle_status() { + ping_output=`$DRIZZLE --ping 2>&1`; ping_alive=$(( ! $? )) + ps_alive=0 + if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi + + if [ "$1" = "check_alive" -a $ping_alive = 1 ] || + [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then + return 0 # EXIT_SUCCESS + else + if [ "$2" = "warn" ]; then + echo -e "$ps_alive processes alive and '$DRIZZLE --ping' resulted in\n$ping_output\n" + fi + return 1 # EXIT_FAILURE + fi +} + +######################### +### Main ################ +######################### + +checkconfig() { + # TODO: --print-defaults no longer a valid option. Needs to be rewritten. + #CNFDATADIR=`drizzle_get_param datadir` + #if [ -z "${CNFDATADIR}" ] ; then + # ewarn "Datadir not set in ${CNFFILE}." + # ewarn "Trying to use ${DATADIR}" + #else + DATADIR="${CNFDATADIR}" + #fi + + if [[ ! -d "${DATADIR}" ]] ; then + eerror "Drizzle datadir is empty or invalid." + eerror "Please check your configuration ${CNFFILE} and DRIZZLE_EXTRA" + return 1 + fi + + if [ ! -f "${CNFFILE}" ]; then + eerror "The configuration file $CNFFILE was not found!" + fi +} + +depend() { + use localmount + use logger + use gearmand + use memcached + + # TODO use drizzle_get_param() to decide if gearmand and memcached + # are needed. Then the useflag based sed-ing of this script + # can be removed from the ebuild. +} + +start_pre() { + checkpath -d -o ${DRIZZLE_USER}:nogroup ${DIR_PID} ${DIR_LOG} + checkpath -f -o ${DRIZZLE_USER}:nogroup ${LOGFILE} +} + +start_post() { + for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do + sleep 1 + if drizzle_status check_alive nowarn ; then break ; fi + done + if drizzle_status check_alive warn ; then + einfo "${SVCNAME} is alive!" + else + eerror "${SVCNAME} died!" + fi +} + +stop_post() { + drizzle_status check_dead warn +} + +status() { + if drizzle_status check_alive nowarn; then + mark_service_started drizzled + einfo "status: started" + else + mark_service_stopped drizzled + einfo "status: stopped" + fi +} diff --git a/dev-db/drizzle/metadata.xml b/dev-db/drizzle/metadata.xml new file mode 100644 index 000000000000..ed2cb0bbc5fa --- /dev/null +++ b/dev-db/drizzle/metadata.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>proxy-maintainers</herd> + <maintainer> + <email>pavel.stratil-jun@fenix.cz</email> + <description>Proxied co-maintainer, assign bugs to him</description> + </maintainer> + <maintainer> + <email>flameeyes@gentoo.org</email> + </maintainer> + <use> + <flag name="doc"> + Build the API documentation for the package, using + <pkg>app-doc/doxygen</pkg>. Warning, this might take over an + hour on slower machines. + </flag> + <flag name="memcache"> + Enable the memcache plugin for user-defined functions and + statistics in I_S tables (using + <pkg>dev-libs/libmemcached</pkg>). + + Currently restricts tests because of an upstream testsuite bug. + </flag> + <flag name="gearman"> + Enable the gearman plugins for user-defined functions and + logging (using <pkg>sys-cluster/gearman</pkg>). + </flag> + <flag name="curl"> + Enable the HTTP authentication plugin (using + <pkg>net-misc/curl</pkg>). This is needed for the tests to apply + properly. + </flag> + <flag name="pam"> + Enable the PAM authentication plugin (using + <pkg>sys-libs/pam</pkg>). The configuration file created will be + /etc/pam.d/drizzle. + </flag> + <flag name="md5"> + Enable the MD5 plugin, using <pkg>dev-libs/libgcrypt</pkg>; this + replaces the older openssl and gnutls USE flags. + </flag> + <flag name="v8"> + Use <pkg>dev-lang/v8</pkg>. + </flag> + </use> + <upstream> + <remote-id type="launchpad">drizzle</remote-id> + </upstream> +</pkgmetadata> |