aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt/tinderbox-devel/Makefile
blob: 68e91d2a9f2d94572357f3dae02806977d9014b3 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Ports collection makefile for:	misc/tinderbox
# Whom:			Edwin Groothuis <edwin@mavetju.org>
# Date created:		31 december 2005
#
# $FreeBSD$

PORTNAME=	tinderbox
DISTVERSION=	${PORTVERSION}-${PORTREVISION}
PORTVERSION=	2.4.2
PORTREVISION=	2	# cvs snapshot from 2008-05-19 14:00
CATEGORIES=	ports-mgmt
MASTER_SITES=	http://T32.TecNik93.com/FreeBSD/ports/${PORTNAME}/sources/
DIST_SUBDIR=	tinderbox

MAINTAINER=	itetcu@FreeBSD.org
COMMENT=	Port build tinderbox system

OPTIONS=	PGSQL "With pgsql" Off \
		MYSQL "With mysql" On \
		CSUP  "Use csup for updates" On \
		CVSUP "Use cvsup for updates" Off \
		WEB   "Install web interface" Off \
		WEB_EXP "Install the new web interface" On \
		APACHE "Use Apache for web interface" On \
		LIGHTTPD "Use LightHTTPD for web interface" Off

NO_BUILD=	yes
WANT_PERL=	yes
SUB_FILES=	pkg-message
PKGMESSAGE=	${WRKDIR}/pkg-message

MAN1=		tc-configCcache.1 tc-configDistfile.1 tc-configGet.1 \
		tc-configJail.1 tc-configTinderd.1 tc-init.1

.include <bsd.port.pre.mk>

.if !defined(WITH_PGSQL) && defined(WITHOUT_MYSQL)
IGNORE=	is useless without a database. Please (re)run 'make config' and choose one of PGSQL and MYSQL
.endif

.if defined(WITH_WEB) || !defined(WITHOUT_WEB_EXP)
RUN_DEPENDS+=	${LOCALBASE}/share/pear/DB.php:${PORTSDIR}/databases/pear-DB
WANT_PHP_WEB=	yes
USE_PHP=	session
DISTFILES=	${DISTNAME}${EXTRACT_SUFX} \
		favicon.ico tb242_template_paefchen_v2.tbz
EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
.endif

.if defined(WITH_WEB)
PLIST_SUB+=	WEB=""
.else
PLIST_SUB+=	WEB="@comment "
.endif

.if !defined(WITHOUT_WEB_EXP)
PLIST_SUB+=	WEB_EXP=""
.else
PLIST_SUB+=	WEB_EXP="@comment "
.endif

.if defined(WITH_PGSQL)
USE_PGSQL=	yes
.if defined(WITH_WEB) || !defined(WITHOUT_WEB_EXP)
USE_PHP+=	pgsql
.endif
RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/DBD/Pg.pm:${PORTSDIR}/databases/p5-DBD-Pg
.endif

.if !defined(WITHOUT_MYSQL)
.if defined(WITH_WEB) || !defined(WITHOUT_WEB_EXP)
USE_PHP+=	mysql
.endif
USE_MYSQL=	yes
IGNORE_WITH_MYSQL=	323 40
RUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql${MYSQL_VER:S/323//}
.endif

.if ! (${OSVERSION} > 700014 || ( ${OSVERSION} >= 601101 && ${OSVERSION} < 700000 ))
.if !defined(WITHOUT_CSUP)
RUN_DEPENDS+=	csup:${PORTSDIR}/net/csup
.endif
.endif

.if defined(WITH_CVSUP)
RUN_DEPENDS+=	cvsup:${PORTSDIR}/net/cvsup-without-gui
.endif

.if !defined(WITHOUT_APACHE) && (defined(WITH_WEB) || !defined(WITHOUT_WEB_EXP))
USE_APACHE=	1.3+
.elif defined(WITH_LIGHTTPD) && (defined(WITH_WEB) || !defined(WITHOUT_WEB_EXP))
RUN_DEPENDS+=	lighttpd:${PORTSDIR}/www/lighttpd
.endif

pre-everything::
.if (!defined(WITHOUT_APACHE) || defined(WITH_LIGHTTPD)) && !(defined(WITH_WEB) || !defined(WITHOUT_WEB_EXP))
	@${ECHO_CMD} "It doesn't make sense to depend on Apache or LightHTTPD if not using either web interface."
	@${FALSE}
.endif

post-extract:
.if !defined(WITH_WEB)
	@${RM} -R ${WRKSRC}/www
.else
	@${CP} ${_DISTDIR}/favicon.ico ${WRKSRC}/www
.endif
.if defined(WITHOUT_WEB_EXP)
	@${RM} -R ${WRKSRC}/www-exp
.else
	@${CP} ${_DISTDIR}/favicon.ico ${WRKSRC}/www-exp
	@${TAR} -C ${WRKSRC}/www-exp/templates -xf ${_DISTDIR}/tb242_template_paefchen_v2.tbz
	@${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${WRKSRC}/www-exp/templates/paefchen
	@${REINPLACE_CMD} 's|/templates/default|/templates/paefchen|' ${WRKSRC}/www-exp/inc_tinderbox.php.dist
	@${RM} ${WRKSRC}/www-exp/inc_tinderbox.php.dist.bak
.endif

post-patch:
.if defined(WITH_MYSQL)
	@${REINPLACE_CMD} \
		-e 's,DB_MAN_PREREQS=.*,DB_MAN_PREREQS="databases/p5-DBD-mysql${MYSQL_VER} databases/mysql${MYSQL_VER}-client",' \
		${WRKSRC}/lib/setup-mysql.sh
	@${RM} ${WRKSRC}/lib/setup-mysql.sh.bak
.endif

do-install:
	${MKDIR} ${PREFIX}/tinderbox/scripts
	${CP} -R ${WRKSRC}/* ${PREFIX}/tinderbox/scripts

post-install:
	cd ${WRKSRC}/man/man1 && ${INSTALL_MAN} ${MAN1} ${MAN1PREFIX}/man/man1
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>