summaryrefslogtreecommitdiffstats
path: root/www/eyeos/Makefile
blob: dfe6c77c4a1bc52e6fa85e90df5b0cfcf48b8526 (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
# New ports collection makefile for:	eyeOS
# Date created:		2006-04-04
# Whom:			Nicola Vitale <nivit@email.it>
#
# $FreeBSD$
#

PORTNAME=	eyeOS
DISTVERSION=	0.9.3-5
CATEGORIES=	www
MASTER_SITES=	SFE

MAINTAINER=	nivit@FreeBSD.org
COMMENT=	Web Based Desktop System

NO_BUILD=	yes
USE_PHP=	pcre session

WRKSRC=		${WRKDIR}/${PORTNAME}
EYEDIR?=	${PREFIX}/www/${PORTNAME}
RWDIRS=		etc
RODIRS=		apps login system
SUB_FILES=	pkg-message
PKGMESSAGE=	${WRKDIR}/pkg-message
PLIST_SUB+=	EYEDIR="${EYEDIR:S,^${PREFIX}/,,}"
SUB_LIST+=	EYEDIR=${EYEDIR}

post-extract:
	@${RM} -f ${WRKSRC}/DOCS/gpl-license.txt
	@${MV} ${WRKSRC}/README.txt ${WRKSRC}/DOCS/USER.MANUAL

post-patch:
	@${FIND} ${WRKSRC}/ -iname \*php | ${XARGS} ${REINPLACE_CMD} -e 's/0777/0775/g'
	@${FIND} ${WRKSRC}/ -iname \*bak -delete

do-install:
	@${INSTALL} -d ${EYEDIR}
	@${CP} -Rp ${WRKSRC}/[a-z]* ${EYEDIR}/
	@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${EYEDIR}/
	@${CHMOD} 775 ${RWDIRS:S,^,${EYEDIR}/,}
	${ECHO_CMD} @exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} %D/${EYEDIR:S,^${PREFIX}/,,}/ >> ${TMPPLIST}
	${ECHO_CMD} @exec ${CHMOD} 775 ${RWDIRS:S,^,%D/${EYEDIR:S,^${PREFIX}/,,}/,} >> ${TMPPLIST}
.ifndef NOPORTDOCS
	@${INSTALL} -d ${DOCSDIR}
	@${CP} -Rp ${WRKSRC}/DOCS/ ${DOCSDIR}/
	@${CHMOD} -R ${SHAREMODE} ${DOCSDIR}/
	@${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOCSDIR}/
.endif

post-install:
	@${CAT} ${PKGMESSAGE}

# Maintainer section
create-plist: build
	${FIND} -s ${WRKSRC} -type f -or -type l | \
		${SED} -e 's#^${WRKSRC}/DOCS#%%PORTDOCS%%%%DOCSDIR%%#' \
			-e 's#^${WRKSRC}#%%EYEDIR%%#' > ${PLIST}
	${FIND} -ds ${WRKSRC}/DOCS ${RODIRS:S,^,${WRKSRC}/,} -type d | \
		${SED} -e 's#^${WRKSRC}/DOCS#%%PORTDOCS%%@dirrm %%DOCSDIR%%#' \
			-e 's#^${WRKSRC}/system/themes$$#@dirrmtry %%EYEDIR%%/system/themes#' \
			-e 's#^${WRKSRC}/system$$#@dirrmtry %%EYEDIR%%/system#' \
			-e 's#^${WRKSRC}#@dirrm %%EYEDIR%%#' >> ${PLIST}
	${FIND} -ds ${RWDIRS:S,^,${WRKSRC}/,} -type d | \
		${SED} -e 's#^${WRKSRC}#@dirrmtry %%EYEDIR%%#' >> ${PLIST}
	${ECHO_CMD} @dirrmtry %%EYEDIR%% >> ${PLIST}

.include <bsd.port.mk>
OpenPOWER on IntegriCloud