summaryrefslogtreecommitdiff
path: root/devel/rt-mysql/Makefile.common
blob: 5e62ef3b4578fb794fe2207ded785748220878e0 (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
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
# $NetBSD: Makefile.common,v 1.5 2004/01/27 00:53:10 heinz Exp $

DISTNAME=      	rt-2-0-13
CATEGORIES=	devel
MASTER_SITES=	http://www.fsck.com/pub/rt/release/

MAINTAINER=	tech-pkg@NetBSD.org
HOMEPAGE=	http://www.fsck.com/projects/rt/
COMMENT=	Industrial-grade ticketing system
CONFLICTS=	rt-*

RT_GROUP?=	rt
RT_PATH?=	${PREFIX}/rt
RT_VAR_PATH?=	/var/pkg/rt
RT_LOG_PATH?=	${RT_VAR_PATH}/log
RT_DATA_PATH?=	${RT_VAR_PATH}/data
RT_SESSION_PATH?=	${RT_VAR_PATH}/sessiondata

RT_DB_HOME?=	${PREFIX}
RT_DB_DATABASE?=rt2
RT_DB_USER?=	rt
RT_DB_PASS?=	changemeplease

RT_WEB_USER?=	nobody
RT_WEB_GROUP?=	nobody

USE_PKGINSTALL=	yes

PKGDIR=		${.CURDIR}/../../devel/rt-mysql
DISTINFO_FILE=	${PKGDIR}/distinfo
FILESDIR=	${PKGDIR}/files
PATCHDIR=	${PKGDIR}/patches
PLIST_SRC=	${PKGDIR}/PLIST
PKG_GROUPS=	${RT_GROUP}
CONF_FILES=	${RT_PATH}/etc/config.pm.default ${RT_PATH}/etc/config.pm
OWN_DIRS+=	${RT_PATH}
OWN_DIRS+=	${RT_PATH}/etc
OWN_DIRS+=	${RT_PATH}/WebRT
OWN_DIRS+=	${RT_VAR_PATH}
OWN_DIRS+=	${RT_LOG_PATH}
OWN_DIRS+=	${RT_DATA_PATH}
OWN_DIRS+=	${RT_SESSION_PATH}

REPLACE_PERL+=	tools/insertdata \
		tools/initdb

.if (${RT_DB_TYPE} == "mysql")
PKGNAME=	${DISTNAME:S/-/./g:S/./-mysql-/}
DEPENDS+=	p5-DBD-mysql-*:../../databases/p5-DBD-mysql
RT_DB_HOST?=	localhost
RT_DB_PORT?=
RT_DB_PATH?=	${PREFIX}/lib/mysql
RT_DB_DBA?=	root
RT_DB_DBA_PASSWORD?=
.elif (${RT_DB_TYPE} == "Pg")
PKGNAME=	${DISTNAME:S/-/./g:S/./-pgsql-/}
DEPENDS+=	p5-DBD-postgresql-*:../../databases/p5-DBD-postgresql
RT_DB_HOST?=
RT_DB_PORT?=
RT_DB_PATH?=	${PREFIX}/lib/postgresql
RT_DB_DBA?=	pgsql
RT_DB_DBA_PASSWORD?=
.else
#
# oracle is supposed to be an option, but not yet.
#
.endif

DEPENDS+=	p5-Digest-MD5-*:../../security/p5-Digest-MD5
DEPENDS+=	p5-Storable-*:../../devel/p5-Storable
DEPENDS+=	p5-DBI>=1.18:../../databases/p5-DBI
DEPENDS+=	p5-DBIx-DataSource>=0.02:../../databases/p5-DBIx-Datasource
DEPENDS+=	p5-DBIx-SearchBuilder>=0.48:../../databases/p5-DBIx-SearchBuilder
DEPENDS+=	p5-libwww-*:../../www/p5-libwww
DEPENDS+=	p5-MLDBM-*:../../databases/p5-MLDBM
DEPENDS+=	p5-Params-Validate>=0.02:../../devel/p5-Params-Validate
DEPENDS+=	p5-HTML-Mason>=1.02:../../www/p5-HTML-Mason
DEPENDS+=	p5-CGI-*:../../www/p5-CGI
DEPENDS+=	p5-libapreq-*:../../www/p5-libapreq
DEPENDS+=	p5-Apache-Session>=1.53:../../www/p5-Apache-Session
DEPENDS+=	p5-TimeDate-*:../../time/p5-TimeDate
DEPENDS+=	p5-MIME-tools>=5.108:../../mail/p5-MIME-tools
DEPENDS+=	p5-MailTools>=1.20:../../mail/p5-MailTools
DEPENDS+=	p5-Tie-IxHash-*:../../devel/p5-Tie-IxHash
DEPENDS+=	p5-Text-Wrapper-*:../../textproc/p5-Text-Wrapper
DEPENDS+=	p5-Text-Template-*:../../textproc/p5-Text-Template
DEPENDS+=	p5-FreezeThaw-*:../../devel/p5-FreezeThaw
DEPENDS+=	p5-Log-Dispatch-*:../../devel/p5-Log-Dispatch
DEPENDS+=	p5-Apache-DBI-[0-9]*:../../databases/p5-Apache-DBI

pre-configure:
	@${ECHO} "=> Removing CVS directories from work directory"
	@${FIND} ${WRKSRC} -name CVS -type d -print | ${XARGS} ${RM} -rf
	@${CP} ${FILESDIR}/rtconfig ${WRKSRC}/rtconfig
	@${CP} ${FILESDIR}/README ${WRKSRC}/README.pkg
	@cd ${WRKSRC} ; \
	for f in Makefile rtconfig README.pkg; do \
	${ECHO} "=> Doing RT variable replacement in $$f"; \
	[ -f $$f.BAK ] || ${MV} $$f $$f.BAK ; \
	${SED}	-e 's|@PREFIX@|${PREFIX}|g' \
		-e 's|@RT_GROUP@|${RT_GROUP}|g' \
		-e 's|@RT_PATH@|${RT_PATH}|g' \
		-e 's|@RT_LOG_PATH@|${RT_LOG_PATH}|g' \
		-e 's|@RT_DATA_PATH@|${RT_DATA_PATH}|g' \
		-e 's|@RT_SESSION_PATH@|${RT_SESSION_PATH}|g' \
		-e 's|@RT_DB_TYPE@|${RT_DB_TYPE}|g' \
		-e 's|@RT_DB_DBA@|${RT_DB_DBA}|g' \
		-e 's|@RT_DB_DBA_PASSWORD@|${RT_DB_DBA_PASSWORD}|g' \
		-e 's|@RT_DB_DATABASE@|${RT_DB_DATABASE}|g' \
		-e 's|@RT_DB_USER@|${RT_DB_USER}|g' \
		-e 's|@RT_DB_PASS@|${RT_DB_PASS}|g' \
		-e 's|@RT_DB_HOME@|${RT_DB_HOME}|g' \
		-e 's|@RT_DB_HOST@|${RT_DB_HOST}|g' \
		-e 's|@RT_DB_PORT@|${RT_DB_PORT}|g' \
		-e 's|@RT_WEB_USER@|${RT_WEB_USER}|g' \
		-e 's|@RT_WEB_GROUP@|${RT_WEB_GROUP}|g' < $$f.BAK > $$f; \
	done

pre-build:
	(mkdir -p ${WRKSRC}/src; \
	cd ${WRKSRC}/src; \
	${CP} ${FILESDIR}/wrapper.c .; \
	${ECHO} '#define RT_REAL_PATH "${RT_PATH}/bin/real"' > config.h; \
	${ECHO} '#define DATABASE_LIBRARY_PATH "${RT_DB_PATH}"' >> config.h; \
	${ECHO} '#define RT_GROUP "${RT_GROUP}"' >> config.h )

.include "../../mk/bsd.pkg.mk"