View | Details | Raw Unified | Return to bug 161109 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-3 / +2 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	memcached
8
PORTNAME=	memcached
9
PORTVERSION=	1.4.7
9
PORTVERSION=	1.4.7
10
PORTREVISION=	1
10
CATEGORIES=	databases
11
CATEGORIES=	databases
11
MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE} \
12
MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE} \
12
		${MASTER_SITE_GENTOO}
13
		${MASTER_SITE_GENTOO}
Lines 31-37 Link Here
31
PLIST_FILES=	bin/memcached \
32
PLIST_FILES=	bin/memcached \
32
		bin/memcached-tool \
33
		bin/memcached-tool \
33
		include/memcached/protocol_binary.h
34
		include/memcached/protocol_binary.h
34
PLIST_DIRS=	include/memcached /var/run/memcached
35
PLIST_DIRS=	include/memcached
35
36
36
PORTDOCS=	protocol.txt readme.txt
37
PORTDOCS=	protocol.txt readme.txt
37
38
Lines 65-72 Link Here
65
post-install:
66
post-install:
66
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/memcached-tool ${PREFIX}/bin
67
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/memcached-tool ${PREFIX}/bin
67
	${INSTALL_MAN} ${WRKSRC}/doc/${MAN1} ${MAN1PREFIX}/man/man1
68
	${INSTALL_MAN} ${WRKSRC}/doc/${MAN1} ${MAN1PREFIX}/man/man1
68
	@${MKDIR} -p /var/run/memcached
69
	@${CHOWN} nobody:nobody /var/run/memcached
70
.if !defined(NOPORTDOCS)
69
.if !defined(NOPORTDOCS)
71
	@${ECHO_MSG} "===>   Installing documentation for ${PKGNAME}"
70
	@${ECHO_MSG} "===>   Installing documentation for ${PKGNAME}"
72
	@${MKDIR} ${DOCSDIR}
71
	@${MKDIR} ${DOCSDIR}
(-)files/memcached.in (-16 / +26 lines)
Lines 1-9 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
#
2
3
# $FreeBSD: ports/databases/memcached/files/memcached.in,v 1.6 2011/08/14 00:44:33 swills Exp $
3
# $FreeBSD: ports/databases/memcached/files/memcached.in,v 1.6 2011/08/14 00:44:33 swills Exp $
4
#
4
#
5
# PROVIDE: memcached
5
# PROVIDE: memcached
6
# REQUIRE: DAEMON
6
# REQUIRE: LOGIN
7
# KEYWORD: shutdown
7
# KEYWORD: shutdown
8
#
8
#
9
# Add the following lines to /etc/rc.conf to run memcached:
9
# Add the following lines to /etc/rc.conf to run memcached:
Lines 16-51 Link Here
16
#				Default is "nobody".
16
#				Default is "nobody".
17
# memcached_profiles (str):     Set to "" by default.
17
# memcached_profiles (str):     Set to "" by default.
18
#                               Define your profiles here.
18
#                               Define your profiles here.
19
#
20
19
21
. /etc/rc.subr
20
. /etc/rc.subr
22
21
23
name="memcached"
22
name="memcached"
24
rcvar=${name}_enable
23
rcvar=${name}_enable
25
24
26
_pidprefix="/var/run/memcached/memcached"
25
_piddir="/var/run/memcached"
27
pidfile="${_pidprefix}.pid"
26
pidfile="${_piddir}/memcached.pid"
28
27
29
load_rc_config ${name}
28
load_rc_config ${name}
30
29
31
if [ -n "$2" ]; then
30
if [ -n "$2" ]; then
32
	profile="$2"
31
	profile="$2"
33
	if [ "x${memcached_profiles}" != "x" ]; then
32
	if [ "x${memcached_profiles}" != "x" ]; then
34
		pidfile="${_pidprefix}.${profile}.pid"
33
		pidfile="${_piddir}/memcached.${profile}.pid"
35
		eval memcached_enable="\${memcached_${profile}_enable:-${memcached_enable}}"
34
		eval memcached_enable="\${memcached_${profile}_enable:-${memcached_enable}}"
36
		eval memcached_flags="\${memcached_${profile}_flags:-${memcached_flags}}"
35
		eval memcached_flags="\${memcached_${profile}_flags:-${memcached_flags}}"
37
	else
36
	else
38
		echo "$0: extra argument ignored"
37
		echo "$0: extra argument ignored"
39
	fi
38
	fi
40
else
39
else
41
	if [ "x${memcached_profiles}" != "x" -a "x$1" != "x" ]; then
40
	if [ -n "${memcached_profiles}" -a -n "$1" ]; then
42
		for profile in ${memcached_profiles}; do
41
		for profile in ${memcached_profiles}; do
43
			eval _enable="\${memcached_${profile}_enable}"
42
			eval _enable="\${memcached_${profile}_enable}"
44
			case "x${_enable:-${memcached_enable}}" in
43
			case "${_enable:-${memcached_enable}}" in
45
			x[Nn][Oo]|x[Ff][Aa][Ll][Ss][Ee]|x[Oo][Ff][Ff]|x0)
44
			[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
46
				continue
45
				continue
47
				;;
46
				;;
48
			x[Yy][Ee][Ss]|x[Tt][Rr][Uu][Ee]|x[Oo][Nn]|x1)
47
			[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
49
				;;
48
				;;
50
			*)
49
			*)
51
				if test -z "$_enable"; then
50
				if test -z "$_enable"; then
Lines 53-59 Link Here
53
				else
52
				else
54
					_var=memcached_"${profile}"_enable
53
					_var=memcached_"${profile}"_enable
55
				fi
54
				fi
56
				echo "Bad value" \
55
				warn "Bad value" \
57
				    "'${_enable:-${memcached_enable}}'" \
56
				    "'${_enable:-${memcached_enable}}'" \
58
				    "for ${_var}. " \
57
				    "for ${_var}. " \
59
				    "Profile ${profile} skipped."
58
				    "Profile ${profile} skipped."
Lines 61-82 Link Here
61
				;;
60
				;;
62
			esac
61
			esac
63
			echo "===> memcached profile: ${profile}"
62
			echo "===> memcached profile: ${profile}"
64
			/usr/local/etc/rc.d/memcached $1 ${profile}
63
			if $0 $1 ${profile} ; then
65
			retcode="$?"
66
			if [ "0${retcode}" -ne 0 ]; then
67
				failed="${profile} (${retcode}) ${failed:-}"
68
			else
69
				success="${profile} ${success:-}"
64
				success="${profile} ${success:-}"
65
			else
66
				failed="${profile} (${retcode}) ${failed:-}"
70
			fi
67
			fi
71
		done
68
		done
72
		exit 0
69
		exit 0
73
	fi
70
	fi
74
fi
71
fi
75
72
73
memcached_poststop()
74
{
75
	local file
76
77
	for file in ${_piddir}/* ; do
78
		case "$file" in *\*) continue ;; esac
79
		unlink $file
80
	done
81
}
82
76
: ${memcached_enable="NO"}
83
: ${memcached_enable="NO"}
77
: ${memcached_user="nobody"}
84
: ${memcached_user="nobody"}
78
85
79
command=%%PREFIX%%/bin/memcached
86
command=%%PREFIX%%/bin/memcached
80
command_args="-d -u ${memcached_user} -P ${pidfile} "
87
command_args="-d -u ${memcached_user} -P ${pidfile} "
81
88
89
start_precmd="install -d -o $memcached_user -g $memcached_user -m 755 $_piddir"
90
stop_postcmd="${name}_poststop"
91
82
run_rc_command "$1"
92
run_rc_command "$1"

Return to bug 161109