svn commit: r320622 - in head/databases/py-swift: . files
Ruslan Makhmatkhanov
rm at FreeBSD.org
Tue Jun 11 18:28:31 UTC 2013
Author: rm
Date: Tue Jun 11 18:28:30 2013
New Revision: 320622
URL: http://svnweb.freebsd.org/changeset/ports/320622
Log:
- 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)
Added:
head/databases/py-swift/files/
head/databases/py-swift/files/patch-utils.py (contents, props changed)
head/databases/py-swift/files/swift.in (contents, props changed)
Modified:
head/databases/py-swift/Makefile (contents, props changed)
Modified: head/databases/py-swift/Makefile
==============================================================================
--- head/databases/py-swift/Makefile Tue Jun 11 18:25:17 2013 (r320621)
+++ head/databases/py-swift/Makefile Tue Jun 11 18:28:30 2013 (r320622)
@@ -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}even
USE_PYTHON= -2.7
USE_PYDISTUTILS= easy_install
+USE_RC_SUBR= swift
MAN1= swift-account-auditor.1 \
swift-account-reaper.1 \
Added: head/databases/py-swift/files/patch-utils.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/databases/py-swift/files/patch-utils.py Tue Jun 11 18:28:30 2013 (r320622)
@@ -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))
+
+
Added: head/databases/py-swift/files/swift.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/databases/py-swift/files/swift.in Tue Jun 11 18:28:30 2013 (r320622)
@@ -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"
More information about the svn-ports-all
mailing list