summaryrefslogtreecommitdiff
path: root/www/archiva/Makefile
blob: 939e3eeca87673c253e1328a03ad36857d7fef79 (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

PORTNAME=	archiva
PORTVERSION=	2.2.3
CATEGORIES=	www java
MASTER_SITES=	APACHE/${PORTNAME}/${PORTVERSION}/binaries
DISTNAME=	apache-${PORTNAME}-${PORTVERSION}-bin

MAINTAINER=	freebsd@dussan.org
COMMENT=	Extensible repository management software

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE

RUN_DEPENDS=	javaservicewrapper:sysutils/javaservicewrapper

USES=		cpe
CPE_VENDOR=	apache

USE_JAVA=	yes

USE_RC_SUBR=	${PORTNAME}

PLIST_SUB=	ARCHIVA_CONF=${PREFIX}/${PORTNAME} \
		ARCHIVA_GROUP=${GROUPS} \
		ARCHIVA_HOME=${DATADIR} \
		ARCHIVA_USER=${USERS}

NO_ARCH=	yes
NO_BUILD=	yes

WRKSRC=		${WRKDIR}/apache-${PORTNAME}-${PORTVERSION}

post-patch:
	@${REINPLACE_CMD} \
		-e 's|%%BASEDIR%%|${PREFIX}/${PORTNAME}|' \
		-e 's|%%LOCALBASE%%|${LOCALBASE}|' \
		-e 's|%%USER%%|${USERS}|' \
		-e 's|%%WRAPPER_CMD%%|${LOCALBASE}/bin/wrapper|' \
		${WRKSRC}/bin/${PORTNAME}
	@${REINPLACE_CMD} \
		-e 's|%%ARCHIVA_BASE%%|${PREFIX}/${PORTNAME}|' \
		-e 's|%%DIR%%|${DATADIR}|' \
		-e 's|%%JAVA%%|${JAVA}|' \
		-e 's|%%LOCALBASE%%|${LOCALBASE}|' \
		-e 's|%%REPO_DIR%%|${DATADIR}|' \
		-e 's|%%WRAPPER_DIR%%|${LOCALBASE}/lib/javaservicewrapper|' \
		-e 's|%%WRAPPER_JAR%%|${LOCALBASE}/lib/javaservicewrapper/lib/wrapper.jar|' \
		${WRKSRC}/conf/wrapper.conf
	@${RM} \
		${WRKSRC}/bin/${PORTNAME}.bak \
		${WRKSRC}/bin/${PORTNAME}.bat \
		${WRKSRC}/bin/${PORTNAME}.orig \
		${WRKSRC}/bin/wrapper-linux-x86-32 \
		${WRKSRC}/bin/wrapper-linux-x86-64 \
		${WRKSRC}/bin/wrapper-macosx-universal-32 \
		${WRKSRC}/bin/wrapper-macosx-universal-64 \
		${WRKSRC}/bin/wrapper-solaris-sparc-32 \
		${WRKSRC}/bin/wrapper-solaris-sparc-64 \
		${WRKSRC}/bin/wrapper-solaris-x86-32 \
		${WRKSRC}/bin/wrapper-windows-x86-32.exe \
		${WRKSRC}/bin/wrapper-windows-x86-64.exe \
		${WRKSRC}/conf/wrapper.conf.bak \
		${WRKSRC}/conf/wrapper.conf.orig \
		${WRKSRC}/lib/libwrapper-linux-x86-32.so \
		${WRKSRC}/lib/libwrapper-linux-x86-64.so \
		${WRKSRC}/lib/libwrapper-macosx-universal-32.jnilib \
		${WRKSRC}/lib/libwrapper-macosx-universal-64.jnilib \
		${WRKSRC}/lib/libwrapper-solaris-sparc-32.so \
		${WRKSRC}/lib/libwrapper-solaris-sparc-64.so \
		${WRKSRC}/lib/libwrapper-solaris-x86-32.so \
		${WRKSRC}/lib/wrapper-windows-x86-32.dll \
		${WRKSRC}/lib/wrapper-windows-x86-64.dll \
		${WRKSRC}/lib/wrapper.jar

do-install:
	${MKDIR} ${STAGEDIR}${DATADIR}
	(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR})
.for dir in conf data logs temp
	${MKDIR} ${STAGEDIR}${PREFIX}/${PORTNAME}/${dir}
.endfor
	(cd ${STAGEDIR}${DATADIR}/conf && ${FIND} . -type f -exec \
		${INSTALL_DATA} '{}' ${STAGEDIR}${PREFIX}/${PORTNAME}/conf/'{}'.sample \;)

.include <bsd.port.mk>