summaryrefslogtreecommitdiff
path: root/devel/rt-mysql/Makefile.common
blob: d6380fc74113daf873fc43fb878b3030e4ebb409 (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
128
129
130
# $NetBSD: Makefile.common,v 1.18 2011/03/21 11:39:27 obache Exp $
# used by devel/rt-mysql/Makefile
# used by devel/rt-pgsql/Makefile

DISTNAME=	rt-2-0-15
CATEGORIES=	devel
MASTER_SITES=	http://www.bestpractical.com/rt/release/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.bestpractical.com/rt/
COMMENT=	Industrial-grade ticketing system
CONFLICTS=	rt-*-[0-9]*

PKG_DESTDIR_SUPPORT=	destdir

.include "../../mk/bsd.prefs.mk"

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

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

RT_WEB_USER?=	nobody
RT_WEB_GROUP?=	nobody

PKG_GROUPS_VARS+=	RT_GROUP RT_WEB_GROUP
PKG_USERS_VARS+=	RT_DB_USER RT_WEB_USER

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
REQD_DIRS+=	${RT_PATH}
REQD_DIRS+=	${RT_PATH}/etc
REQD_DIRS+=	${RT_PATH}/WebRT
OWN_DIRS+=	${RT_VAR_PATH}
OWN_DIRS+=	${RT_LOG_PATH}
OWN_DIRS+=	${RT_DATA_PATH}
OWN_DIRS+=	${RT_SESSION_PATH}

USE_TOOLS+=	perl:run
REPLACE_PERL+=	tools/insertdata \
		tools/initdb

.if (${RT_DB_TYPE} == "mysql")
PKGNAME=	${DISTNAME:S/-/./g:S/./-mysql-/}
DEPENDS+=	p5-DBD-mysql-[0-9]*:../../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-[0-9]*:../../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-[0-9]*:../../security/p5-Digest-MD5
DEPENDS+=	p5-Storable-[0-9]*:../../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-[0-9]*:../../www/p5-libwww
DEPENDS+=	p5-MLDBM-[0-9]*:../../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-[0-9]*:../../www/p5-CGI
DEPENDS+=	p5-libapreq2-[0-9]*:../../www/p5-libapreq2
DEPENDS+=	p5-Apache-Session>=1.53:../../www/p5-Apache-Session
DEPENDS+=	p5-TimeDate-[0-9]*:../../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-[0-9]*:../../devel/p5-Tie-IxHash
DEPENDS+=	p5-Text-Wrapper-[0-9]*:../../textproc/p5-Text-Wrapper
DEPENDS+=	p5-Text-Template-[0-9]*:../../textproc/p5-Text-Template
DEPENDS+=	p5-FreezeThaw-[0-9]*:../../devel/p5-FreezeThaw
DEPENDS+=	p5-Log-Dispatch-[0-9]*:../../devel/p5-Log-Dispatch
DEPENDS+=	p5-Apache-DBI-[0-9]*:../../databases/p5-Apache-DBI

SUBST_CLASSES+=	rt
SUBST_STAGE.rt=	pre-configure
SUBST_FILES.rt=	Makefile rtconfig README.pkg
SUBST_VARS.rt=	PREFIX RT_GROUP \
	RT_PATH RT_LOG_PATH RT_DATA_PATH RT_SESSION_PATH \
	RT_DB_TYPE RT_DB_DBA RT_DB_DBA_PASSWORD RT_DB_DATABASE RT_DB_USER \
	RT_DB_PASS RT_DB_HOME RT_DB_HOST RT_DB_PORT RT_WEB_USER RT_WEB_GROUP

INSTALL_MAKE_FLAGS+=	BIN_OWNER=${BINOWN}
INSTALL_MAKE_FLAGS+=	LIBS_OWNER=${LIBOWN}
INSTALL_MAKE_FLAGS+=	LIBS_GROUP=${LIBGRP}
INSTALL_MAKE_FLAGS+=	RTGROUP=${RT_GROUP}
USERGROUP_PHASE=	pre-install

post-extract:
	@${STEP_MSG} "Removing CVS directories from work directory"
	${FIND} ${WRKSRC} -name CVS -type d -print | ${XARGS} ${RM} -rf

post-patch:
	${CP} ${FILESDIR}/rtconfig ${WRKSRC}/rtconfig
	${CP} ${FILESDIR}/README ${WRKSRC}/README.pkg

pre-build:
	set -e; (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"