summaryrefslogtreecommitdiff
path: root/databases/apache-cassandra/Makefile.common
blob: 090352b76839ac629fcbeaa907ec07632af2c38c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# $NetBSD: Makefile.common,v 1.5 2020/01/26 17:30:52 rillig Exp $
# used by databases/apache-cassandra/Makefile
# used by databases/apache-cassandra2/Makefile
#

DISTNAME=	apache-cassandra-${CASSANDRA_VER}
CATEGORIES=	databases
MASTER_SITES=	${MASTER_SITE_APACHE:=cassandra/${CASSANDRA_VER:C/-.*//}/}
DISTFILES=	${DISTNAME}-bin${EXTRACT_SUFX}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://cassandra.apache.org/
COMMENT=	Highly scalable, distributed structured key-value store

LICENSE=	apache-2.0
NO_BUILD=	yes
USE_LANGUAGES=	# none
USE_JAVA=	run
USE_TOOLS+=	bash:run pax

FILESDIR=	${.CURDIR}/../../databases/apache-cassandra/files

.include "../../mk/bsd.prefs.mk"

CASSANDRA_HOME=		${PREFIX}/share/cassandra
EGDIR=			${PREFIX}/share/examples/cassandra
DOCDIR=			${PREFIX}/share/doc/cassandra

RCD_SCRIPTS=		cassandra
SMF_NAME=		cassandra
CASSANDRA_USER?=	cassandra
CASSANDRA_GROUP?=	cassandra
PKG_GROUPS=		${CASSANDRA_GROUP}
PKG_USERS=		${CASSANDRA_USER}:${CASSANDRA_GROUP}
PKG_GROUPS_VARS+=	CASSANDRA_GROUP
PKG_USERS_VARS=		CASSANDRA_USER
PKG_HOME.cassandra=	${CASSANDRA_HOME}
PKG_SHELL.cassandra=	${SH}

# Following line only to unlock PKG_SYSCONFDIR_PERMS
PKG_SYSCONFSUBDIR=	conf
PKG_SYSCONFVAR=		cass
PKG_SYSCONFDIR.cass=	${CASSANDRA_HOME}/${PKG_SYSCONFSUBDIR}
PKG_SYSCONFDIR_PERMS=	${CASSANDRA_USER} ${CASSANDRA_GROUP} 0755

OWN_DIRS_PERMS+=	${CASSANDRA_HOME}/conf/triggers ${CASSANDRA_USER} ${CASSANDRA_GROUP} 0755
OWN_DIRS_PERMS+=	${VARBASE}/lib/cassandra ${CASSANDRA_USER} ${CASSANDRA_GROUP} 0751
OWN_DIRS_PERMS+=	${VARBASE}/log/cassandra ${CASSANDRA_USER} ${CASSANDRA_GROUP} 0755

FILES_SUBST+=		JAVA_HOME=${PKG_JAVA_HOME}		\
			CASSANDRA_HOME=${CASSANDRA_HOME}	\
			CASSANDRA_USER=${CASSANDRA_USER}	\
			CASSANDRA_GROUP=${CASSANDRA_GROUP}

SUBST_CLASSES+=		path
SUBST_STAGE.path=	pre-install
SUBST_MESSAGE.path=	Fixing default paths
SUBST_FILES.path=	bin/cassandra.in.sh bin/cassandra conf/cassandra-env.sh
SUBST_VARS.path=	VARBASE

.for f in ${EGFILES}
CONF_FILES_PERMS+=	${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f} \
			${CASSANDRA_USER} ${CASSANDRA_GROUP} 0644
.endfor

REPLACE_BASH+=		bin/cassandra bin/cqlsh bin/cqlsh.py bin/debug-cql \
			bin/nodetool bin/sstable*

INSTALLATION_DIRS+=	${CASSANDRA_HOME} ${EGDIR} ${DOCDIR}
INSTALLATION_DIRS+=	${CASSANDRA_HOME} ${CASSANDRA_HOME}/bin ${EGDIR} ${DOCDIR}

CHECK_SSP_SUPPORTED=		no
CHECK_INTERPRETER_SKIP+=	share/cassandra/interface/cassandra.thrift
CHECK_INTERPRETER_SKIP+=	share/cassandra/pylib/setup.py
CHECK_INTERPRETER_SKIP+=	share/cassandra/tools/bin/token-generator

# Skip checks on other arch libs to keep this simple
CHECK_SHLIBS_SKIP+=	share/cassandra/lib/sigar-bin/*

do-install:
.for d in ${WORK_DIRS}
	${RM} -rf ${WRKSRC}/${d}
.endfor
.for f in ${BINFILES}
	${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${DESTDIR}${CASSANDRA_HOME}/bin/${f}
.endfor
.for f in ${DOCFILES}
	${INSTALL_DATA} ${WRKSRC}/${f}.txt ${DESTDIR}${DOCDIR}/${f}
	${RM} -f ${WRKSRC}/${f}.txt
.endfor
.for f in ${EGFILES}
	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${DESTDIR}${EGDIR}/${f}
.endfor
	${FIND} ${WRKSRC} -name \*.exe -type f -print | ${XARGS} ${RM} -f
	${FIND} ${WRKSRC} -name \*.bat -type f -print | ${XARGS} ${RM} -f
	cd ${WRKSRC} && \
	  ${PAX} -rw -pm interface javadoc lib pylib tools \
	  ${DESTDIR}${CASSANDRA_HOME}
	${FIND} ${DESTDIR}${CASSANDRA_HOME} -type d -print |	\
		${XARGS} ${CHMOD} ${PKGDIRMODE}
	${FIND} ${DESTDIR}${CASSANDRA_HOME} -type f -print |	\
		${XARGS} ${CHMOD} ${SHAREMODE}
	${FIND} ${DESTDIR}${CASSANDRA_HOME}/bin -type f -print |	\
		${XARGS} ${CHMOD} ${BINMODE}
	${FIND} ${DESTDIR}${CASSANDRA_HOME} -type f -name \*.sh -print |	\
		${XARGS} ${CHMOD} ${BINMODE}

.include "../../lang/python/application.mk"
.include "../../mk/java-vm.mk"