aboutsummaryrefslogtreecommitdiff
path: root/devel/sonarqube/Makefile
blob: 916923822234a84bed6df515774724e1e8cab5fc (plain) (blame)
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
# Created by: Dusan Vejnovic <freebsd@dussan.org>
# $FreeBSD$

PORTNAME=	sonarqube
PORTVERSION=	5.6
CATEGORIES=	devel www java
MASTER_SITES=	http://sonarsource.bintray.com/Distribution/sonarqube/

MAINTAINER=	freebsd@dussan.org
COMMENT=	Platform for continuous inspection of code quality

LICENSE=	LGPL3
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libbiconv.so:converters/iconv
RUN_DEPENDS=	javaservicewrapper:sysutils/javaservicewrapper

NO_ARCH=	yes
NO_BUILD=	yes

USE_RC_SUBR=	${PORTNAME}
USERS=		www
GROUPS=		www

USES=		cpe dos2unix zip
CPE_VENDOR=	sonarsource
DOS2UNIX_GLOB=	*.properties *.conf

USE_JAVA=	yes
JAVA_VERSION=	1.7+

SQ_FILE=	sonar.sh
SQ_HOME=	${PREFIX}/${PORTNAME}
SQ_LOG_DIR=	/var/log/${PORTNAME}
SQ_LOG_FILE=	${PORTNAME}.log
SQ_JSW=		${PREFIX}/lib/javaservicewrapper

SUB_LIST+=	SQ_GROUP=${GROUPS} \
		SQ_LOG_DIR=${SQ_LOG_DIR} \
		SQ_LOG_FILE=${SQ_LOG_FILE} \
		SQ_RC=${PORTNAME} \
		SQ_RUN=${SQ_HOME}/bin/freebsd/${SQ_FILE} \
		SQ_USER=${USERS}
PLIST_SUB+=	SQ_GROUP=${GROUPS} \
		SQ_HOME=${SQ_HOME} \
		SQ_USER=${USERS}

OPTIONS_RADIO=		SQL
OPTIONS_RADIO_SQL=	MYSQL PGSQL

MYSQL_USE=	mysql=yes
PGSQL_USES=	pgsql

post-patch:
	@${REINPLACE_CMD} -e 's|%%DIR%%|${SQ_HOME}|' \
		-e 's|%%LIB%%|${SQ_JSW}|' \
		-e 's|%%LOG%%|${SQ_LOG_DIR}/${SQ_LOG_FILE}|' \
		-e 's|%%WRAPPER_JAR%%|${SQ_JSW}/lib/wrapper.jar|' \
		${WRKSRC}/conf/wrapper.conf

do-install:
	@${MKDIR} ${STAGEDIR}${SQ_HOME}
	@(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${SQ_HOME})
	@${MKDIR} ${STAGEDIR}${SQ_HOME}/bin/freebsd/lib
	@${CP} ${STAGEDIR}${SQ_HOME}/bin/linux-x86-64/${SQ_FILE} \
		${STAGEDIR}${SQ_HOME}/bin/freebsd
	@${REINPLACE_CMD} -e 's|#RUN_AS_USER=|RUN_AS_USER=${USERS}|' \
		-e 's|-p $$pid -o args|ww $$pid|' \
		-e 's|=\"./wrapper\"|=\"${SQ_JSW}/bin/wrapper\"|' \
		${STAGEDIR}${SQ_HOME}/bin/freebsd/${SQ_FILE}
	@${MV} -f ${STAGEDIR}${SQ_HOME}/bin/freebsd/${SQ_FILE} \
		${STAGEDIR}${SQ_HOME}/bin/freebsd/${SQ_FILE}.sample
	@${MV} -f ${STAGEDIR}${SQ_HOME}/conf/sonar.properties \
		${STAGEDIR}${SQ_HOME}/conf/sonar.properties.sample
	@${MV} -f ${STAGEDIR}${SQ_HOME}/conf/wrapper.conf \
		${STAGEDIR}${SQ_HOME}/conf/wrapper.conf.sample
	@${RM} -drf ${STAGEDIR}${SQ_HOME}/bin/linux-x86-32
	@${RM} -drf ${STAGEDIR}${SQ_HOME}/bin/linux-x86-64
	@${RM} -drf ${STAGEDIR}${SQ_HOME}/bin/macosx-universal-64
	@${RM} -drf ${STAGEDIR}${SQ_HOME}/bin/windows-x86-32
	@${RM} -drf ${STAGEDIR}${SQ_HOME}/bin/windows-x86-64

.include <bsd.port.mk>