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

Collapse All | Expand All

(-)databases/Makefile (+1 lines)
Lines 38-43 Link Here
38
    SUBDIR += clickhouse
38
    SUBDIR += clickhouse
39
    SUBDIR += cockroach
39
    SUBDIR += cockroach
40
    SUBDIR += couchdb
40
    SUBDIR += couchdb
41
    SUBDIR += couchdb2
41
    SUBDIR += courier-authlib-mysql
42
    SUBDIR += courier-authlib-mysql
42
    SUBDIR += courier-authlib-pgsql
43
    SUBDIR += courier-authlib-pgsql
43
    SUBDIR += courier-authlib-userdb
44
    SUBDIR += courier-authlib-userdb
(-)databases/couchdb2/Makefile (+102 lines)
Line 0 Link Here
1
# Created by: Reshad Patuck <reshadpatuck1@gmail.com>
2
# $FreeBSD$
3
4
PORTNAME=	couchdb2
5
PORTVERSION=	2.1.1
6
CATEGORIES=	databases
7
MASTER_SITES=	APACHE/couchdb/source/${PORTVERSION}
8
DISTNAME=	apache-couchdb-${PORTVERSION}
9
10
MAINTAINER=	reshadpatuck1@gmail.com
11
COMMENT=	JSON document database with HTTP API and scalable multi-master sync
12
13
LICENSE=	APACHE20 BSD3CLAUSE ISCL WTFPL OFL11
14
LICENSE_COMB=	multi
15
16
LIB_DEPENDS=	libicudata.so:devel/icu \
17
		libmozjs185.so:lang/spidermonkey185
18
BUILD_DEPENDS=  ${LOCALBASE}/bin/rebar:devel/rebar
19
20
#CONFLICTS=	couchdb-1*
21
22
USERS=		couchdb
23
GROUPS=		couchdb
24
25
USES=		cpe gmake libtool ssl
26
USE_RC_SUBR=	couchdb2
27
CPE_VENDOR=	apache
28
HAS_CONFIGURE=	yes
29
USE_LDCONFIG=	yes
30
31
CONFIGURE_ARGS = --skip-deps --user couchdb
32
33
ALL_TARGET=	release
34
35
PLIST=${WRKDIR}/couchdb2-pkg-plist
36
37
OPTIONS_DEFINE=	DOCS WITH_CURL FAUXTON
38
OPTIONS_SUB=	yes
39
OPTIONS_DEFAULT=DOCS FAUXTON
40
DOCS_DESC=	Build documentation and manpages
41
WITH_CURL_DESC=	Request that couchjs is linked to cURL
42
FAUXTON_DESC=	Build Fauxton
43
OTPVER20_DESC=  Use Erlang OTP20 instead of OTP19
44
OPTIONS_GROUP=  ENV
45
OPTIONS_GROUP_ENV = OTPVER20
46
47
WITH_CURL_BUILD_DEPENDS=${LOCALBASE}/lib/libcurl.so:ftp/curl
48
49
OTPVER20_BUILD_DEPENDS=${LOCALBASE}/lib/erlang20/bin/erlc:lang/erlang-runtime20
50
OTPVER20_BUILD_DEPENDS_OFF=${LOCALBASE}/lib/erlang19/bin/erlc:lang/erlang-runtime19
51
52
.include <bsd.port.options.mk>
53
54
.if ! ${PORT_OPTIONS:MDOCS}
55
CONFIGURE_ARGS+=--disable-docs
56
.endif
57
58
.if ! ${PORT_OPTIONS:MFAUXTON}
59
CONFIGURE_ARGS+=--disable-fauxton
60
.endif
61
62
.if ${PORT_OPTIONS:MWITH_CURL}
63
CONFIGURE_ARGS+=-c
64
.endif
65
66
.if ${PORT_OPTIONS:MOTPVER20}
67
MAKE_ENV=       PATH=${LOCALBASE}/lib/erlang20/bin:${PATH}
68
.else
69
MAKE_ENV=       PATH=${LOCALBASE}/lib/erlang19/bin:${PATH}
70
.endif
71
72
pre-install:
73
	# Cleanup source
74
	${FIND} ${WRKSRC} -type f -name '*.a' -exec ${RM} {} +
75
	${FIND} ${WRKSRC} -type f -name '*.c' -exec ${RM} {} +
76
	${FIND} ${WRKSRC} -type f -name '*.o' -exec ${RM} {} +
77
78
	${CP} pkg-plist ${PLIST}
79
	@${MKDIR} ${STAGEDIR}${ETCDIR}
80
	${MV} ${WRKSRC}/rel/couchdb/etc/local.ini ${STAGEDIR}/${ETCDIR}/local.ini.sample
81
	${FIND} ${WRKSRC}/rel/couchdb -type f | ${SED} 's|^${WRKSRC}/rel/couchdb|libexec/couchdb2|' >> ${PLIST}
82
83
do-install:
84
85
	# Make required staging directories
86
	@${MKDIR} \
87
	    ${STAGEDIR}/var/db/couchdb2 \
88
	    ${STAGEDIR}/var/log/couchdb2 \
89
	    ${STAGEDIR}/var/run/couchdb2
90
91
.if ${PORT_OPTIONS:MDOCS}
92
	${INSTALL_MAN} ${WRKSRC}/share/docs/man/apachecouchdb.1 \
93
	    ${STAGEDIR}${MANPREFIX}/man/man1
94
.endif
95
96
	# Copy configs
97
	${CP} ${WRKSRC}/rel/couchdb/etc/vm.args   ${STAGEDIR}/${ETCDIR}/vm.args.sample
98
99
	# Copy couchdb files.
100
	${CP} -R -p ${WRKSRC}/rel/couchdb ${STAGEDIR}${PREFIX}/libexec/couchdb2
101
102
.include <bsd.port.mk>
(-)databases/couchdb2/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1526653079
2
SHA256 (apache-couchdb-2.1.1.tar.gz) = d5f255abc871ac44f30517e68c7b30d1503ec0f6453267d641e00452c04e7bcc
3
SIZE (apache-couchdb-2.1.1.tar.gz) = 12132981
(-)databases/couchdb2/files/couchdb2.in (+79 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# $FreeBSD$
4
#
5
# PROVIDE: couchdb2
6
# REQUIRE: LOGIN
7
# KEYWORD: shutdown
8
#
9
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
10
# to enable this service:
11
#
12
# couchdb2_enable (bool):       Set to NO by default.
13
#                               Set it to YES to enable couchdb2.
14
15
. /etc/rc.subr
16
17
name="couchdb2"
18
rcvar=couchdb2_enable
19
20
start_cmd="${name}_start"
21
stop_cmd="${name}_stop"
22
status_cmd="${name}_status"
23
24
load_rc_config $name
25
26
: ${couchdb2_enable:="NO"}
27
: ${couchdb2_user="couchdb"}
28
: ${couchdb2_erl_flags="-couch_ini %%PREFIX%%/libexec/couchdb2/etc/default.ini %%ETCDIR%%/local.ini"}
29
30
31
command="%%PREFIX%%/libexec/couchdb2/bin/couchdb"
32
pidfile="/var/run/${name}.pid"
33
34
couchdb2_start()
35
{
36
    export ERL_FLAGS="${couchdb2_erl_flags}"
37
    daemon -p ${pidfile} -f -u ${couchdb2_user} ${command}
38
}
39
40
couchdb2_stop()
41
{
42
    echo -n "Stopping ${name}: "
43
    retval=0
44
    if ! status_quiet 
45
    then
46
        echo "already stopped"
47
        return 1
48
    else
49
        couchdb2_pids=`pgrep -u ${couchdb2_user} beam\*`
50
        kill ${couchdb2_pids}
51
        wait_for_pids ${couchdb2_pids}
52
        retval=$?
53
        echo "stopped"
54
    fi
55
    return $retval
56
}
57
58
couchdb2_status()
59
{
60
    pgrep -u ${couchdb2_user} beam\* > /dev/null && status="$?" || status="$?"
61
    if [ "${status}" = 0 ]; then
62
        echo "${name} is running"
63
        return 0
64
    elif [ "${status}" = 4 ]; then
65
        echo "could not access PID file for ${name}"
66
        return ${status}
67
    else
68
        echo "${name} is not running"
69
        return ${status}
70
    fi
71
}
72
73
status_quiet()
74
{
75
    couchdb2_status >/dev/null 2>&1
76
}
77
78
run_rc_command $1
79
(-)databases/couchdb2/files/patch-rel_overlay_bin_couchdb (+16 lines)
Line 0 Link Here
1
--- rel/overlay/bin/couchdb.orig	2017-11-01 02:52:10 UTC
2
+++ rel/overlay/bin/couchdb
3
@@ -26,6 +26,12 @@ export BINDIR="$ROOTDIR/erts-$ERTS_VSN/b
4
 export EMU=beam
5
 export PROGNAME=`echo $0 | sed 's/.*\///'`
6
 
7
+if [ -f /usr/local/etc/couchdb2/vm.args ]; then
8
+	ARGSFILE=/usr/local/etc/couchdb2/vm.args
9
+else
10
+	ARGSFILE="$ROOTDIR/etc/vm.args"
11
+fi
12
+
13
 exec "$BINDIR/erlexec" -boot "$ROOTDIR/releases/$APP_VSN/couchdb" \
14
-     -args_file "$ROOTDIR/etc/vm.args" \
15
+     -args_file $ARGSFILE \
16
      -config "$ROOTDIR/releases/$APP_VSN/sys.config" "$@"
(-)databases/couchdb2/files/patch-rel_overlay_etc_local.ini (+20 lines)
Line 0 Link Here
1
--- rel/overlay/etc/local.ini.orig	2017-11-01 02:52:10 UTC
2
+++ rel/overlay/etc/local.ini
3
@@ -7,6 +7,9 @@
4
 [couchdb]
5
 ;max_document_size = 4294967296 ; bytes
6
 ;os_process_timeout = 5000
7
+;
8
+database_dir = /var/db/couchdb2
9
+view_index_dir = /var/db/couchdb2
10
 
11
 [couch_peruser]
12
 ; If enabled, couch_peruser ensures that a private per-user database
13
@@ -111,3 +114,7 @@
14
 ; changing this.
15
 [admins]
16
 ;admin = mysecretpassword
17
+;
18
+[log]
19
+writer = file
20
+file = /var/log/couchdb2/couch.log
(-)databases/couchdb2/pkg-descr (+6 lines)
Line 0 Link Here
1
Apache CouchDB lets you access your data where you need it by defining the
2
Couch Replication Protocol that is implemented by a variety of projects and
3
products that span every imaginable computing environment from globally
4
distributed server-clusters, over mobile phones to web browsers.
5
6
WWW: http://couchdb.apache.org/
(-)databases/couchdb2/pkg-message (+10 lines)
Line 0 Link Here
1
***********************************************************
2
If this is the first time you are installing couchdb2, you will need to initialise the database node.
3
For a single node setup run the following commands once the database is started for the first time.
4
5
curl -X PUT http://127.0.0.1:5984/_users
6
curl -X PUT http://127.0.0.1:5984/_replicator
7
curl -X PUT http://127.0.0.1:5984/_global_changes
8
9
See http://docs.couchdb.org/en/2.1.1/install/setup.html#single-node-setup for more information.
10
***********************************************************
(-)databases/couchdb2/pkg-plist (+8 lines)
Line 0 Link Here
1
@dir %%ETCDIR%%
2
@sample(couchdb,couchdb,660) %%ETCDIR%%/vm.args.sample
3
@sample(couchdb,couchdb,660) %%ETCDIR%%/local.ini.sample
4
@dir(couchdb,couchdb,770) /var/db/couchdb2
5
@dir(couchdb,couchdb,770) /var/log/couchdb2
6
@dir(couchdb,couchdb,770) /var/run/couchdb2
7
%%DOCS%%man/man1/apachecouchdb.1.gz
8
@comment plist for files in /usr/local/libexec/couchdb2/* is built dynamically

Return to bug 218844