aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@FreeBSD.org>2012-02-17 16:49:41 +0000
committerVsevolod Stakhov <vsevolod@FreeBSD.org>2012-02-17 16:49:41 +0000
commit2b78e2e20bff219fff3086f3832bd7c7c8bf838f (patch)
tree8fcdd2cfcb4c2b3251b6649813b926b04f2b3910 /net
parent5233ac598d7407d58cddeef18ec403893d3ac2fd (diff)
downloadports-2b78e2e20bff219fff3086f3832bd7c7c8bf838f.tar.gz
ports-2b78e2e20bff219fff3086f3832bd7c7c8bf838f.zip
Notes
Diffstat (limited to 'net')
-rw-r--r--net/beanstalkd/Makefile15
-rw-r--r--net/beanstalkd/distinfo4
-rw-r--r--net/beanstalkd/files/beanstalkd.in81
-rw-r--r--net/beanstalkd/files/patch-conn.h13
-rw-r--r--net/beanstalkd/files/patch-tube.h17
5 files changed, 85 insertions, 45 deletions
diff --git a/net/beanstalkd/Makefile b/net/beanstalkd/Makefile
index 73be245177c3..a75e62284c6c 100644
--- a/net/beanstalkd/Makefile
+++ b/net/beanstalkd/Makefile
@@ -6,25 +6,22 @@
#
PORTNAME= beanstalkd
-PORTVERSION= 1.4.6
-PORTREVISION= 1
+PORTVERSION= 1.5
CATEGORIES= net
MASTER_SITES= http://cloud.github.com/downloads/kr/beanstalkd/
MAINTAINER= vsevolod@FreeBSD.org
COMMENT= Fast, distributed, in-memory workqueue service
-LIB_DEPENDS= event-1.4:${PORTSDIR}/devel/libevent
-
+LICENSE= MIT
USE_RC_SUBR= beanstalkd
-USE_GMAKE= yes
-GNU_CONFIGURE= yes
-MAKE_ENV+= EVENT_CFLAGS=-I${LOCALBASE}/include EVENT_LDFLAGS=-L${LOCALBASE}/lib
+USE_GMAKE= yes
PLIST_FILES= bin/beanstalkd
+SUB_LIST+= RC_SUBR_SUFFIX=${RC_SUBR_SUFFIX}
-PORTDOCS= protocol.txt
-MAN1= beanstalkd.1
+PORTDOCS= protocol.txt
+MAN1= beanstalkd.1
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/beanstalkd ${PREFIX}/bin
diff --git a/net/beanstalkd/distinfo b/net/beanstalkd/distinfo
index 15e135805207..fe5a224f5a4b 100644
--- a/net/beanstalkd/distinfo
+++ b/net/beanstalkd/distinfo
@@ -1,2 +1,2 @@
-SHA256 (beanstalkd-1.4.6.tar.gz) = a03aca5ccd87c2a1bb6cdaf38d3463c9f987090f4eb6cd9c7f6e03d3d54d3ac9
-SIZE (beanstalkd-1.4.6.tar.gz) = 140858
+SHA256 (beanstalkd-1.5.tar.gz) = ad39ccca490f58dc48df8609e2b6acfddcd200890c62f3d4b0d1ac4de713467e
+SIZE (beanstalkd-1.5.tar.gz) = 61494
diff --git a/net/beanstalkd/files/beanstalkd.in b/net/beanstalkd/files/beanstalkd.in
index e01e1778818b..7c21d27fff3e 100644
--- a/net/beanstalkd/files/beanstalkd.in
+++ b/net/beanstalkd/files/beanstalkd.in
@@ -4,6 +4,7 @@
#
# PROVIDE: beanstalkd
# REQUIRE: DAEMON
+# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to run beanstalkd:
#
@@ -13,21 +14,93 @@
# Default is empty "".
# beanstalkd_user (user): Set user to run beanstalkd.
# Default is "nobody".
-#
+# beanstalkd_profiles (str): Set to "" by default.
+# Define your profiles here.
. /etc/rc.subr
name="beanstalkd"
rcvar=beanstalkd_enable
+_piddir="/var/run/beanstalkd"
+pidfile="${_piddir}/beanstalkd.pid"
+
load_rc_config ${name}
+if [ -n "$2" ]; then
+ profile="$2"
+ if [ -n "${beanstalkd_profiles}" ]; then
+ pidfile="${_piddir}/beanstalkd.${profile}.pid"
+ eval beanstalkd_enable="\${beanstalkd_${profile}_enable:-${beanstalkd_enable}}"
+ eval beanstalkd_flags="\${beanstalkd_${profile}_flags:-${beanstalkd_flags}}"
+ else
+ echo "%%PREFIX%%/etc/rc.d/beanstalkd%%RC_SUBR_SUFFIX%%: extra argument ignored"
+ fi
+else
+ if [ -n "${beanstalkd_profiles}" -a -n "$1" ]; then
+ for profile in ${beanstalkd_profiles}; do
+ eval _enable="\${beanstalkd_${profile}_enable}"
+ case "${_enable:-${beanstalkd_enable}}" in
+ [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+ continue
+ ;;
+ [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+ ;;
+ *)
+ if test -z "$_enable"; then
+ _var=beanstalkd_enable
+ else
+ _var=beanstalkd_"${profile}"_enable
+ fi
+ warn "Bad value" \
+ "'${_enable:-${beanstalkd_enable}}'" \
+ "for ${_var}. " \
+ "Profile ${profile} skipped."
+ continue
+ ;;
+ esac
+ echo "===> beanstalkd profile: ${profile}"
+ if %%PREFIX%%/etc/rc.d/beanstalkd%%RC_SUBR_SUFFIX%% $1 ${profile} ; then
+ success="${profile} ${success:-}"
+ else
+ failed="${profile} (${retcode}) ${failed:-}"
+ fi
+ done
+ exit 0
+ fi
+fi
+
+beanstalkd_poststop()
+{
+ if [ -n "${profile}" ]; then
+ [ -e "$pidfile" ] && unlink $pidfile
+ else
+ local file
+
+ for file in ${_piddir}/* ; do
+ case "$file" in
+ *\*)
+ continue ;;
+ esac
+ unlink $file
+ done
+ fi
+}
+
+beanstalkd_prestart()
+{
+ install -d -o $beanstalkd_user -g $beanstalkd_user -m 755 $_piddir
+}
+
: ${beanstalkd_enable="NO"}
: ${beanstalkd_user="nobody"}
-command=%%PREFIX%%/bin/beanstalkd
-command_args="-d -u ${beanstalkd_user}"
+procname=%%PREFIX%%/bin/beanstalkd
+command="/usr/sbin/daemon"
+command_args="-p ${pidfile} ${procname} ${beanstalkd_flags}"
+unset beanstalkd_flags
-unset beanstalkd_user
+start_precmd="${name}_prestart"
+stop_postcmd="${name}_poststop"
run_rc_command "$1"
diff --git a/net/beanstalkd/files/patch-conn.h b/net/beanstalkd/files/patch-conn.h
deleted file mode 100644
index a46c764f4d40..000000000000
--- a/net/beanstalkd/files/patch-conn.h
+++ /dev/null
@@ -1,13 +0,0 @@
---- conn.h.orig 2011-06-24 15:38:41.000000000 +0400
-+++ conn.h 2011-06-24 15:39:11.000000000 +0400
-@@ -72,9 +72,9 @@
-
- job out_job;
- int out_job_sent;
-- struct job reserved_jobs; /* doubly-linked list header */
- tube use;
- struct ms watch;
-+ struct job reserved_jobs; /* doubly-linked list header */
- };
-
- conn make_conn(int fd, char start_state, tube use, tube watch);
diff --git a/net/beanstalkd/files/patch-tube.h b/net/beanstalkd/files/patch-tube.h
deleted file mode 100644
index 133b49692e2c..000000000000
--- a/net/beanstalkd/files/patch-tube.h
+++ /dev/null
@@ -1,17 +0,0 @@
---- tube.h.orig 2011-06-24 15:37:57.000000000 +0400
-+++ tube.h 2011-06-24 15:38:13.000000000 +0400
-@@ -35,13 +35,13 @@
- char name[MAX_TUBE_NAME_LEN];
- struct pq ready;
- struct pq delay;
-- struct job buried;
- struct ms waiting; /* set of conns */
- struct stats stat;
- unsigned int using_ct;
- unsigned int watching_ct;
- usec pause;
- usec deadline_at;
-+ struct job buried;
- };
-
- extern struct ms tubes;