aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authorvg <vg@FreeBSD.org>2013-11-23 16:47:39 +0800
committervg <vg@FreeBSD.org>2013-11-23 16:47:39 +0800
commit0374c882722484da67200c0c9cb3b455a94a7a95 (patch)
treee873567005a25699a83102620d7ffc442d8141b7 /databases
parent0392e89c2ee41ec43add27610435bbc6eb58380c (diff)
downloadfreebsd-ports-gnome-0374c882722484da67200c0c9cb3b455a94a7a95.tar.gz
freebsd-ports-gnome-0374c882722484da67200c0c9cb3b455a94a7a95.tar.zst
freebsd-ports-gnome-0374c882722484da67200c0c9cb3b455a94a7a95.zip
- Update to new version
- Fixed bugs at init script - Added auto init storage at init script - Added more information at pkg-message - Groupped plugins Submitted by: myself
Diffstat (limited to 'databases')
-rw-r--r--databases/tarantool/Makefile24
-rw-r--r--databases/tarantool/distinfo4
-rw-r--r--databases/tarantool/files/patch-CMakeLists.txt11
-rw-r--r--databases/tarantool/files/patch-src_CMakeLists.txt12
-rw-r--r--databases/tarantool/files/patch-test_CMakeLists.txt23
-rw-r--r--databases/tarantool/files/patch-test_share_tarantool_tgz.cfg22
-rw-r--r--databases/tarantool/files/pkg-message.in18
-rw-r--r--databases/tarantool/files/tarantool.in28
-rw-r--r--databases/tarantool/pkg-plist11
9 files changed, 113 insertions, 40 deletions
diff --git a/databases/tarantool/Makefile b/databases/tarantool/Makefile
index 6b320c2ed0e1..7e46c35e6fee 100644
--- a/databases/tarantool/Makefile
+++ b/databases/tarantool/Makefile
@@ -3,6 +3,7 @@
PORTNAME= tarantool
PORTVERSION= 1.5.1
+PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://tarantool.org/dist/
DISTNAME= ${PORTNAME}-${PORTVERSION}-${TR_REV}-src
@@ -12,15 +13,20 @@ COMMENT= High performance key/value storage server
LICENSE= BSD
-TR_REV= 96-gae1ec01
+TR_REV= 248-g1f7eab2
MAKE_JOBS_UNSAFE=yes
USES= cmake gettext:build gmake iconv perl5 compiler:c++11-lang
USE_LDCONFIG= yes
USE_RC_SUBR= ${PORTNAME}
SUB_FILES= pkg-message
-CMAKE_ARGS= -DCMAKE_MAN_DIR=man
+CMAKE_ARGS= -DCMAKE_MAN_DIR=man \
+ -DCMAKE_SYSCONF_DIR=${ETCDIR} \
+ -DCMAKE_LOCALSTATE_DIR=${DATADIR}
-OPTIONS_DEFINE= CLIENT MYSQL PGSQL
+OPTIONS_DEFINE= CLIENT
+OPTIONS_GROUP= PLUGINS
+OPTIONS_GROUP_PLUGINS= MYSQL PGSQL
+PLUGINS_DESC= Plugins list
CLIENT_DESC= Enable client
DEBUG_DESC= Enable debug
MYSQL_DESC= Install MySQL plugin
@@ -30,8 +36,6 @@ OPTIONS_DEFAULT=CLIENT
MAN1= tarantool_box.1
-NO_STAGE= yes
-
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MCLIENT}
@@ -51,9 +55,7 @@ CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Rel \
.endif
.if ${PORT_OPTIONS:MMYSQL}
-CMAKE_ARGS+= -DWITH_MYSQL=ON \
- -DMYSQL_INCLUDE_DIR=${LOCALBASE}/include/mysql \
- -DMYSQL_LIBRARIES=${LOCALBASE}/lib/mysql
+CMAKE_ARGS+= -DWITH_MYSQL=ON
PLIST_SUB+= MYSQL=""
USE_MYSQL= yes
.else
@@ -70,6 +72,12 @@ CMAKE_ARGS+= -DWITH_POSTGRESQL=OFF
PLIST_SUB+= PGSQL="@comment "
.endif
+.if ${PORT_OPTIONS:MMYSQL} || ${PORT_OPTIONS:MPGSQL}
+PLIST_SUB+= PLUGINS=""
+.else
+PLIST_SUB+= PLUGINS="@comment "
+.endif
+
post-install:
@${CAT} ${PKGMESSAGE}
diff --git a/databases/tarantool/distinfo b/databases/tarantool/distinfo
index 0effca1b8e7b..4a0be4d8eecc 100644
--- a/databases/tarantool/distinfo
+++ b/databases/tarantool/distinfo
@@ -1,2 +1,2 @@
-SHA256 (tarantool-1.5.1-96-gae1ec01-src.tar.gz) = f9e927904a0e2097771ea3e53a62ee48cff6cd08c83621836a69edcfe410e8a1
-SIZE (tarantool-1.5.1-96-gae1ec01-src.tar.gz) = 2786139
+SHA256 (tarantool-1.5.1-248-g1f7eab2-src.tar.gz) = 7586ceaba1528e690220b9504222434f6d2dd249b709356f8be015a0eeb262d0
+SIZE (tarantool-1.5.1-248-g1f7eab2-src.tar.gz) = 2816462
diff --git a/databases/tarantool/files/patch-CMakeLists.txt b/databases/tarantool/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..afd67964cc6e
--- /dev/null
+++ b/databases/tarantool/files/patch-CMakeLists.txt
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig 2013-11-22 16:46:37.651143426 +0400
++++ CMakeLists.txt 2013-11-22 16:50:55.948120860 +0400
+@@ -147,7 +147,7 @@ if (NOT DEFINED CMAKE_SYSCONF_DIR)
+ set (CMAKE_SYSCONF_DIR "etc")
+ endif()
+ if (NOT DEFINED CMAKE_LOCALSTATE_DIR)
+- set (CMAKE_LOCALSTATE_DIR "var")
++ set (CMAKE_LOCALSTATE_DIR "var/lib/tarantool")
+ endif()
+ if (NOT DEFINED CMAKE_MAN_DIR)
+ set (CMAKE_MAN_DIR "man")
diff --git a/databases/tarantool/files/patch-src_CMakeLists.txt b/databases/tarantool/files/patch-src_CMakeLists.txt
deleted file mode 100644
index 76841b2f711c..000000000000
--- a/databases/tarantool/files/patch-src_CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
---- src/CMakeLists.txt.orig 2013-09-30 17:30:23.623968376 +0000
-+++ src/CMakeLists.txt 2013-09-30 17:30:50.254969720 +0000
-@@ -153,7 +153,8 @@
- endif()
-
- if (TARGET_OS_FREEBSD AND NOT TARGET_OS_DEBIAN_FREEBSD)
-- set (common_libraries ${common_libraries} intl)
-+ find_library (INTL intl)
-+ set (common_libraries ${common_libraries} ${INTL})
- endif()
-
- if (ENABLE_BACKTRACE AND HAVE_BFD)
diff --git a/databases/tarantool/files/patch-test_CMakeLists.txt b/databases/tarantool/files/patch-test_CMakeLists.txt
index 30e9bdc5e5c7..13dfc9b14b51 100644
--- a/databases/tarantool/files/patch-test_CMakeLists.txt
+++ b/databases/tarantool/files/patch-test_CMakeLists.txt
@@ -1,11 +1,18 @@
---- test/CMakeLists.txt.orig 2013-09-08 19:12:21.819118224 +0000
-+++ test/CMakeLists.txt 2013-09-08 19:13:09.021114858 +0000
-@@ -22,7 +22,5 @@ if (ENABLE_RPM)
- else()
- install (FILES ${CMAKE_SOURCE_DIR}/test/share/tarantool_tgz.cfg
- DESTINATION "${CMAKE_SYSCONF_DIR}"
+--- test/CMakeLists.txt.orig 2013-11-22 15:05:16.000000000 +0400
++++ test/CMakeLists.txt 2013-11-22 19:07:51.591802946 +0400
+@@ -16,7 +16,7 @@
+ macro(install_cfg type_cfg dest)
+ install (FILES ${CMAKE_SOURCE_DIR}/test/share/tarantool_${type_cfg}.cfg
+ DESTINATION ${dest}
- RENAME "tarantool.cfg")
-- install (FILES ${CMAKE_SOURCE_DIR}/test/box/00000000000000000001.snap
-- DESTINATION "${CMAKE_LOCALSTATE_DIR}/lib/tarantool")
+ RENAME "tarantool.cfg.sample")
+ endmacro(install_cfg)
+
+ if (ENABLE_RPM)
+@@ -31,5 +31,5 @@
+ endif()
+
+ install (FILES ${CMAKE_SOURCE_DIR}/test/box/00000000000000000001.snap
+- DESTINATION "${CMAKE_LOCALSTATE_DIR}/lib/tarantool")
++ DESTINATION "${CMAKE_LOCALSTATE_DIR}")
endif()
diff --git a/databases/tarantool/files/patch-test_share_tarantool_tgz.cfg b/databases/tarantool/files/patch-test_share_tarantool_tgz.cfg
new file mode 100644
index 000000000000..ba05e300c8f7
--- /dev/null
+++ b/databases/tarantool/files/patch-test_share_tarantool_tgz.cfg
@@ -0,0 +1,22 @@
+--- test/share/tarantool_tgz.cfg.orig 2013-11-22 20:37:20.623185968 +0400
++++ test/share/tarantool_tgz.cfg 2013-11-22 20:38:47.452245623 +0400
+@@ -11,11 +11,11 @@
+ #
+ # Store the pid in this file. Relative to
+ # startup dir.
+-pid_file = "box.pid"
++pid_file = "/var/run/tarantool.pid"
+
+ #
+ # Pipe all the logs to the console
+-#logger=""
++logger="cat - >> /var/log/tarantool.log"
+
+ #
+ # Read only and read-write port.
+@@ -46,4 +46,4 @@
+
+ #
+ # working directory (daemon will chdir(2) to it)
+-work_dir = "var/lib/tarantool"
++work_dir = "/var/db/tarantool"
diff --git a/databases/tarantool/files/pkg-message.in b/databases/tarantool/files/pkg-message.in
index fa50213a377e..360ac5048b51 100644
--- a/databases/tarantool/files/pkg-message.in
+++ b/databases/tarantool/files/pkg-message.in
@@ -3,11 +3,19 @@
#
# After install you'll need:
#
-# Edit example config:
-# %%ETCDIR%%/tarantool.cfg.sample
-# Init storage:
-# %%PREFIX%%/bin/tarantool_box --init-storage \
-# -c %%ETCDIR%%/tarantool.cfg
+# Edit/copy example config:
+# %%ETCDIR%%/tarantool.cfg.sample to
+# %%ETCDIR%%/tarantool.cfg
+#
+# Configuration at /etc/rc.conf:
+#
+# * Enable tarantool on startup:
+# tarantool_enable="YES"
+# * Change config (Default %%ETCDIR%%/tarantool.cfg):
+# tarantool_config="%%ETCDIR%%/tarantool.cfg"
+# * Path to storage, depended by option work_dir at:
+# %%ETCDIR%%/tarantool.cfg
+# tarantool_data="/var/db/tarantool"
#
#
#########################################################
diff --git a/databases/tarantool/files/tarantool.in b/databases/tarantool/files/tarantool.in
index 692db9b3cf87..12500db02a18 100644
--- a/databases/tarantool/files/tarantool.in
+++ b/databases/tarantool/files/tarantool.in
@@ -8,6 +8,7 @@
#
# tarantool_enable="YES"
# tarantool_config=""
+# tarantool_data="/var/db/tarantool"
#
. /etc/rc.subr
@@ -19,9 +20,34 @@ load_rc_config "$name"
tarantool_enable=${tarantool_enable:-"NO"}
tarantool_config=${tarantool_config:-"%%ETCDIR%%/$name.cfg"}
+tarantool_data=${tarantool_data:-"/var/db/tarantool"}
command="%%PREFIX%%/bin/tarantool_box"
-command_args="--daemonize --config ${tarantool_config}"
+command_args="--config=${tarantool_config} --background"
pidfile="/var/run/$name.pid"
+start_precmd="${name}_prestart"
+
+tarantool_prestart()
+{
+ if ! [ -d ${tarantool_data} ]
+ then
+ eval mkdir -p ${tarantool_data}
+ fi
+
+ if ! [ -f "${tarantool_data}/00000000000000000001.snap" ]
+ then
+ if ! [ -f ${tarantool_config} ]
+ then
+ echo "===> Install default config file."
+ eval cp "%%ETCDIR%%/tarantool.cfg.sample" ${tarantool_config}
+ echo "===> Install default snapshot."
+ eval cp "%%DATADIR%%/00000000000000000001.snap" ${tarantool_data}
+ else
+ echo "===> Init tarantool storage by ${tarantool_config}"
+ eval ${command} --config=${tarantool_config} --init-storage
+ fi
+ fi
+}
+
run_rc_command "$1"
diff --git a/databases/tarantool/pkg-plist b/databases/tarantool/pkg-plist
index 61ed541249b9..75796772cda8 100644
--- a/databases/tarantool/pkg-plist
+++ b/databases/tarantool/pkg-plist
@@ -2,7 +2,7 @@ bin/tarancheck
bin/tarantar
bin/tarantool_box
%%CLIENT%%bin/tarantool
-etc/tarantool.cfg.sample
+%%ETCDIR%%/tarantool.cfg.sample
include/tarantool/tnt.h
include/tarantool/tnt_buf.h
include/tarantool/tnt_call.h
@@ -53,7 +53,10 @@ lib/libtarantoolrpl.a
%%DOCSDIR%%/README.md
%%DOCSDIR%%/box-protocol.txt
%%DOCSDIR%%/LICENSE
-@dirrm %%DOCSDIR%%
+%%DATADIR%%/00000000000000000001.snap
+@dirrmtry %%ETCDIR%%
@dirrm include/tarantool
-@dirrmtry lib/tarantool/plugins
-@dirrmtry lib/tarantool
+%%PLUGINS%%@dirrm lib/tarantool/plugins
+%%PLUGINS%%@dirrm lib/tarantool
+@dirrm %%DOCSDIR%%
+@dirrm %%DATADIR%%