aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authorrm <rm@FreeBSD.org>2013-06-12 02:28:30 +0800
committerrm <rm@FreeBSD.org>2013-06-12 02:28:30 +0800
commit7bfb9b992e2b875a00350822caf4e1ab7e1102fb (patch)
tree85f36bc101cb816fdbd3dd63ed30e677381c6e83 /databases
parentd9fc3a4be15df7de40fe3f6825c88bf4fd9951e4 (diff)
downloadfreebsd-ports-gnome-7bfb9b992e2b875a00350822caf4e1ab7e1102fb.tar.gz
freebsd-ports-gnome-7bfb9b992e2b875a00350822caf4e1ab7e1102fb.tar.zst
freebsd-ports-gnome-7bfb9b992e2b875a00350822caf4e1ab7e1102fb.zip
- add rc.d script
- add the patch that fixes posix_fadvise64 linuxism: swift tries to call posix_fadvise64, which does not exists on FreeBSD and does not needed because off_t is 8 bytes on both 32 and 64-bit platforms, so posix_fadvise should be called instead. This has been reported upstream (#1179268) but there is no reaction so far. - bump PORTREVISION PR: 178738 Submitted by: trociny Approved by: maintainer timeout (3 weeks)
Diffstat (limited to 'databases')
-rw-r--r--databases/py-swift/Makefile2
-rw-r--r--databases/py-swift/files/patch-utils.py17
-rw-r--r--databases/py-swift/files/swift.in116
3 files changed, 135 insertions, 0 deletions
diff --git a/databases/py-swift/Makefile b/databases/py-swift/Makefile
index 8391740474d1..0eeb84570ac9 100644
--- a/databases/py-swift/Makefile
+++ b/databases/py-swift/Makefile
@@ -3,6 +3,7 @@
PORTNAME= swift
PORTVERSION= 1.8.0
+PORTREVISION= 1
CATEGORIES= databases python
MASTER_SITES= http://launchpadlibrarian.net/136145662/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -24,6 +25,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}eventlet>=0.9.8:${PORTSDIR}/net/py-eventlet
USE_PYTHON= -2.7
USE_PYDISTUTILS= easy_install
+USE_RC_SUBR= swift
MAN1= swift-account-auditor.1 \
swift-account-reaper.1 \
diff --git a/databases/py-swift/files/patch-utils.py b/databases/py-swift/files/patch-utils.py
new file mode 100644
index 000000000000..4675a9812c2e
--- /dev/null
+++ b/databases/py-swift/files/patch-utils.py
@@ -0,0 +1,17 @@
+--- swift/common/utils.py.orig 2013-05-18 14:10:21.000000000 +0300
++++ swift/common/utils.py 2013-05-18 14:09:06.000000000 +0300
+@@ -274,12 +274,12 @@ def drop_buffer_cache(fd, offset, length
+ """
+ global _posix_fadvise
+ if _posix_fadvise is None:
+- _posix_fadvise = load_libc_function('posix_fadvise64')
++ _posix_fadvise = load_libc_function('posix_fadvise')
+ # 4 means "POSIX_FADV_DONTNEED"
+ ret = _posix_fadvise(fd, ctypes.c_uint64(offset),
+ ctypes.c_uint64(length), 4)
+ if ret != 0:
+- logging.warn("posix_fadvise64(%s, %s, %s, 4) -> %s"
++ logging.warn("posix_fadvise(%s, %s, %s, 4) -> %s"
+ % (fd, offset, length, ret))
+
+
diff --git a/databases/py-swift/files/swift.in b/databases/py-swift/files/swift.in
new file mode 100644
index 000000000000..e663a45e3756
--- /dev/null
+++ b/databases/py-swift/files/swift.in
@@ -0,0 +1,116 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: swift
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable swift:
+#
+# swift_enable (bool): Set it to "YES" to enable swift.
+# Default is "NO".
+# swift_servers (list): Specify servers to run as a space separated
+# list of possible values:
+# account, account-reaper, account-replicator,
+# container, container-auditor, container-replicator,
+# container-sync, container-updater,
+# object, object-auditor, object-expirer,
+# object-replicator, object-updater,
+# proxy.
+# The following aliases may be used:
+# "ACCOUNT" -- all account servers;
+# "EXPIRER" -- object-expirer;
+# "CONTAINER" -- all container server;
+# "OBJECT" -- all object servers;
+# "PROXY" -- all proxy servers;
+# "STORAGE" -- all storage node servers
+# (alias for "ACCOUNT CONTAINER OBJECT");
+# "ALL" -- all servers
+# (alias for "ACCOUNT CONTAINER EXPIRER OBJECT PROXY").
+# Default is "ALL".
+
+. /etc/rc.subr
+
+name="swift"
+rcvar=swift_enable
+
+extra_commands="reload shutdown status"
+reload_cmd="swift_init reload"
+shutdown_cmd="swift_init shutdown"
+start_cmd="swift_init start"
+status_cmd="swift_init status"
+stop_cmd="swift_init stop"
+
+required_files=%%PREFIX%%/etc/swift/swift.conf
+
+PATH=%%PREFIX%%/bin:$PATH
+
+load_rc_config $name
+
+: ${swift_enable:="NO"}
+: ${swift_servers:="ALL"}
+
+swift_expand_servers()
+{
+ local x
+
+ for x; do
+ case "${x}" in
+ ALL)
+ swift_expand_servers PROXY
+ swift_expand_servers EXPIRER
+ ;&
+ STORAGE)
+ swift_expand_servers ACCOUNT
+ swift_expand_servers CONTAINER
+ swift_expand_servers OBJECT
+ ;;
+ ACCOUNT)
+ echo account
+ echo account-reaper
+ echo account-replicator
+ ;;
+ EXPIRER)
+ echo object-expirer
+ ;;
+ CONTAINER)
+ echo container
+ echo container-auditor
+ echo container-replicator
+ echo container-sync
+ echo container-updater
+ ;;
+ OBJECT)
+ echo object
+ echo object-auditor
+ echo object-replicator
+ echo object-updater
+ ;;
+ PROXY)
+ echo proxy
+ ;;
+ account|account-reaper|account-replicator|\
+ container|container-auditor|container-replicator|\
+ container-sync|container-updater|\
+ object|object-auditor|object-expirer|object-replicator|\
+ object-updater|\
+ proxy)
+ echo "${x}"
+ ;;
+ *)
+ warn "unknown service: ${x}"
+ exit 1
+ ;;
+ esac
+ done | sort -u
+}
+
+swift_init()
+{
+ local cmd=$1
+
+ swift-init `swift_expand_servers ${swift_servers}` ${cmd}
+}
+
+run_rc_command "$1"