Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Nov 2013 08:47:39 +0000 (UTC)
From:      Veniamin Gvozdikov <vg@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r334648 - in head/databases/tarantool: . files
Message-ID:  <201311230847.rAN8ldMa011905@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vg
Date: Sat Nov 23 08:47:39 2013
New Revision: 334648
URL: http://svnweb.freebsd.org/changeset/ports/334648

Log:
  - 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

Added:
  head/databases/tarantool/files/patch-CMakeLists.txt   (contents, props changed)
  head/databases/tarantool/files/patch-test_share_tarantool_tgz.cfg   (contents, props changed)
Deleted:
  head/databases/tarantool/files/patch-src_CMakeLists.txt
Modified:
  head/databases/tarantool/Makefile
  head/databases/tarantool/distinfo
  head/databases/tarantool/files/patch-test_CMakeLists.txt
  head/databases/tarantool/files/pkg-message.in   (contents, props changed)
  head/databases/tarantool/files/tarantool.in   (contents, props changed)
  head/databases/tarantool/pkg-plist

Modified: head/databases/tarantool/Makefile
==============================================================================
--- head/databases/tarantool/Makefile	Sat Nov 23 07:00:36 2013	(r334647)
+++ head/databases/tarantool/Makefile	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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 stor
 
 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
-
-OPTIONS_DEFINE=	CLIENT MYSQL PGSQL
+CMAKE_ARGS=	-DCMAKE_MAN_DIR=man \
+		-DCMAKE_SYSCONF_DIR=${ETCDIR} \
+		-DCMAKE_LOCALSTATE_DIR=${DATADIR}
+
+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}
 

Modified: head/databases/tarantool/distinfo
==============================================================================
--- head/databases/tarantool/distinfo	Sat Nov 23 07:00:36 2013	(r334647)
+++ head/databases/tarantool/distinfo	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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

Added: head/databases/tarantool/files/patch-CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/tarantool/files/patch-CMakeLists.txt	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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")

Modified: head/databases/tarantool/files/patch-test_CMakeLists.txt
==============================================================================
--- head/databases/tarantool/files/patch-test_CMakeLists.txt	Sat Nov 23 07:00:36 2013	(r334647)
+++ head/databases/tarantool/files/patch-test_CMakeLists.txt	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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()

Added: head/databases/tarantool/files/patch-test_share_tarantool_tgz.cfg
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/tarantool/files/patch-test_share_tarantool_tgz.cfg	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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"

Modified: head/databases/tarantool/files/pkg-message.in
==============================================================================
--- head/databases/tarantool/files/pkg-message.in	Sat Nov 23 07:00:36 2013	(r334647)
+++ head/databases/tarantool/files/pkg-message.in	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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"
 #
 #
 #########################################################

Modified: head/databases/tarantool/files/tarantool.in
==============================================================================
--- head/databases/tarantool/files/tarantool.in	Sat Nov 23 07:00:36 2013	(r334647)
+++ head/databases/tarantool/files/tarantool.in	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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"

Modified: head/databases/tarantool/pkg-plist
==============================================================================
--- head/databases/tarantool/pkg-plist	Sat Nov 23 07:00:36 2013	(r334647)
+++ head/databases/tarantool/pkg-plist	Sat Nov 23 08:47:39 2013	(r334648)
@@ -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%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311230847.rAN8ldMa011905>