aboutsummaryrefslogtreecommitdiff
path: root/www/coppermine/Makefile
blob: 0ac0996b966ba7618a20d115acb56acf20afdac6 (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
84
85
86
87
# Ports collection makefile for:	coppermine
# Date created:				05 April 2004
# Whom:					Brooks Davis <brooks@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	coppermine
PORTVERSION=	1.4.10
CATEGORIES=	www
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR=	${PORTNAME}
DISTNAME=	cpg${PORTVERSION}

MAINTAINER=	farrokhi@FreeBSD.org
COMMENT=	A web picture gallery script

USE_PHP=	mysql pcre
USE_ZIP=	yes

.if defined (WITH_IMAGEMAGICK)
RUN_DEPENDS+=	${LOCALBASE}/bin/convert:${PORTSDIR}/graphics/ImageMagick
.else
USE_PHP+=	gd
.endif

CPGDIR?=	www/coppermine

NO_BUILD=	yes
PKGMESSAGE=	${WRKDIR}/pkg-message
WRKSRC=		${WRKDIR}/cpg${PORTVERSION:S/.//g}
DOCFILES=	CHANGELOG
EXCEPTFILES=	${DOCFILES} COPYING docs/COPYING
CPIOARGS=	--quiet -pdum -R
PLIST_SUB=	CPGDIR=${CPGDIR}

SUB_FILES+=	pkg-message
SUB_LIST+=	CPGDIR=${CPGDIR}

pre-everything::
.if ${CPGDIR} == "www/coppermine"
	@${ECHO_MSG} ""
	@${ECHO_MSG} "Define CPGDIR to override default of 'www/coppermine'."
	@${ECHO_MSG} ""
	@${ECHO_MSG} "By default, coppermine depends on PHP with GD support."
	@${ECHO_MSG} "You may define WITH_IMAGEMAGICK to depend on ImageMagick instead of GD."
	@${ECHO_MSG} ""
.endif

post-extract:
	@${CHMOD} -R o-w ${WRKSRC}

do-install:
	@${MKDIR} -m 0755 ${PREFIX}/${CPGDIR}
	cd ${WRKSRC} && \
	    ${FIND} . -name \*.orig ${EXCEPTFILES:S/^/-o -name /} -o -print | \
	    ${CPIO} ${CPIOARGS} ${WWWOWN}:${WWWGRP} ${PREFIX}/${CPGDIR}

post-install:
.if !defined(NOPORTDOCS)
	@${MKDIR} ${DOCSDIR}
	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCFILES} ${DOCSDIR}
.endif
	@${CAT} ${PKGMESSAGE}

########################################################################
# The following targets are for the port maintainer. Use it atyour own #
# risk, no user-serviceable parts inside.                              #
########################################################################
# Assuming the port is installed cleanly (i.e. it's unconfigured)
# build a pkg-plist file.
build-plist:
	${FIND} ${DOCSDIR} -type f | \
		${SED} -e 's|${DOCSDIR}|%%PORTDOCS%%%%DOCSDIR%%|' | \
		${SORT} > pkg-plist
	${FIND} ${PREFIX}/${CPGDIR}/* -type f | \
		${SED} -e 's|${PREFIX}/${CPGDIR}|%%CPGDIR%%|' | \
		${SORT} >> pkg-plist
	${FIND} ${PREFIX}/${CPGDIR}/* -type d | \
		${SED} -e 's|${PREFIX}/${CPGDIR}|@dirrm %%CPGDIR%%|' | \
		${SORT} -r >> pkg-plist
	${FIND} ${DOCSDIR} -type d | \
		${SED} -e 's|${DOCSDIR}|%%PORTDOCS%%@dirrm %%DOCSDIR%%|' | \
		${SORT} -r >> pkg-plist
	${ECHO} "@dirrmtry %%CPGDIR%%" >> pkg-plist

.include <bsd.port.mk>