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 (+109 lines)
Line 0 Link Here
1
#
2
#Created by: Reshad Patuck <reshadpatuck1@gmail.com>
3
# $FreeBSD$
4
5
PORTNAME=	couchdb2
6
PORTVERSION=	2.1.1
7
CATEGORIES=	databases
8
MASTER_SITES=	APACHE/couchdb/source/${PORTVERSION}
9
DISTNAME=	apache-couchdb-${PORTVERSION}
10
11
MAINTAINER=	reshadpatuck1@gmail.com
12
COMMENT=	JSON document database with HTTP API and scalable multi-master sync
13
14
LICENSE=	APACHE20 BSD3CLAUSE ISCL WTFPL OFL11
15
LICENSE_COMB=	multi
16
17
LIB_DEPENDS=	libicudata.so:devel/icu \
18
		libmozjs185.so:lang/spidermonkey185
19
BUILD_DEPENDS=  ${LOCALBASE}/bin/rebar:devel/rebar
20
21
#CONFLICTS=	couchdb-1*
22
23
USERS=		couchdb
24
GROUPS=		couchdb
25
26
USE_RC_SUBR=	couchdb2
27
28
USES=		cpe gmake libtool ssl
29
CPE_VENDOR=	apache
30
HAS_CONFIGURE=	yes
31
USE_LDCONFIG=	yes
32
33
CONFIGURE_ARGS = --skip-deps --user couchdb
34
35
ALL_TARGET=	release
36
37
38
39
PLIST=${WRKDIR}/couchdb2-pkg-plist
40
41
42
OPTIONS_DEFINE=	DOCS WITH_CURL FAUXTON 
43
OPTIONS_SUB=	yes
44
OPTIONS_DEFAULT=DOCS FAUXTON
45
DOCS_DESC=	Build documentation and manpages
46
WITH_CURL_DESC=	Request that couchjs is linked to cURL
47
FAUXTON_DESC=	Build Fauxton
48
OTPVER20_DESC=  Use Erlang OTP20 instead of OTP19
49
OPTIONS_GROUP=  ENV
50
OPTIONS_GROUP_ENV = OTPVER20
51
52
WITH_CURL_BUILD_DEPENDS=${LOCALBASE}/lib/libcurl.so:ftp/curl
53
54
OTPVER20_BUILD_DEPENDS=${LOCALBASE}/lib/erlang20/bin/erlc:lang/erlang-runtime20 
55
OTPVER20_BUILD_DEPENDS_OFF=${LOCALBASE}/lib/erlang19/bin/erlc:lang/erlang-runtime19 
56
57
58
.include <bsd.port.options.mk>
59
60
.if ! ${PORT_OPTIONS:MDOCS} 
61
CONFIGURE_ARGS+=--disable-docs
62
.endif
63
64
.if ! ${PORT_OPTIONS:MFAUXTON} 
65
CONFIGURE_ARGS+=--disable-fauxton
66
.endif
67
68
.if ${PORT_OPTIONS:MWITH_CURL} 
69
CONFIGURE_ARGS+=-c
70
.endif
71
72
.if ${PORT_OPTIONS:MOTPVER20} 
73
MAKE_ENV=       PATH=${LOCALBASE}/lib/erlang20/bin:${PATH}
74
.else
75
MAKE_ENV=       PATH=${LOCALBASE}/lib/erlang19/bin:${PATH}
76
.endif
77
78
pre-install:
79
	# Cleanup source
80
	${FIND} ${WRKSRC} -type f -name '*.a' -exec ${RM} {} +
81
	${FIND} ${WRKSRC} -type f -name '*.c' -exec ${RM} {} +
82
	${FIND} ${WRKSRC} -type f -name '*.o' -exec ${RM} {} +
83
84
	${CP} pkg-plist ${PLIST}
85
	@${MKDIR} ${STAGEDIR}${ETCDIR} 
86
	${MV} ${WRKSRC}/rel/couchdb/etc/local.ini ${STAGEDIR}/${ETCDIR}/local.ini.sample
87
	${FIND} ${WRKSRC}/rel/couchdb -type f | sed 's|^${WRKSRC}/rel/couchdb|libexec/couchdb2|' >> ${PLIST}
88
89
90
do-install:
91
92
	# Make required staging directories
93
	@${MKDIR} \
94
	    ${STAGEDIR}/var/db/couchdb2 \
95
	    ${STAGEDIR}/var/log/couchdb2 \
96
	    ${STAGEDIR}/var/run/couchdb2
97
98
.if ${PORT_OPTIONS:MDOCS}
99
	${INSTALL_MAN} ${WRKSRC}/share/docs/man/apachecouchdb.1 \
100
	    ${STAGEDIR}${MANPREFIX}/man/man1
101
.endif
102
103
	# Copy configs
104
	${CP} ${WRKSRC}/rel/couchdb/etc/vm.args   ${STAGEDIR}/${ETCDIR}/vm.args.sample
105
106
	# Copy couchdb files.
107
	${CP} -R -p ${WRKSRC}/rel/couchdb ${STAGEDIR}${PREFIX}/libexec/couchdb2
108
109
.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 03:52:10.000000000 +0100
2
+++ rel/overlay/bin/couchdb	2018-05-19 02:06:36.922291000 +0200
3
@@ -26,6 +26,12 @@
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 03:52:10.000000000 +0100
2
+++ rel/overlay/etc/local.ini	2018-05-19 11:41:48.050519000 +0200
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